gem5: use lld as the default linker

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-10-12 02:00:01 +00:00
parent 2cfdbf79f2
commit 066c717aad
3 changed files with 11 additions and 8 deletions

1
build
View File

@@ -201,6 +201,7 @@ so looping over all of them would waste time.
'libpng-dev', 'libpng-dev',
'libprotobuf-dev', 'libprotobuf-dev',
'libprotoc-dev', 'libprotoc-dev',
'lld',
'm4', 'm4',
'protobuf-compiler', 'protobuf-compiler',
'python-is-python3', 'python-is-python3',

View File

@@ -33,6 +33,7 @@ Build and run all the gem5 unit tests instead of the gem5 executable.
https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-tests https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-tests
''' '''
) )
self._add_argument('--ldflags')
self._add_argument('extra_make_args') self._add_argument('extra_make_args')
def build(self): def build(self):
@@ -108,15 +109,10 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t
'CC': 'clang', 'CC': 'clang',
'CXX': 'clang++', 'CXX': 'clang++',
} }
gold_linker_cmd = []
else: else:
extra_env = {} extra_env = {}
if self.env['gem5_build_type'] == 'debug': # https://cirosantilli.com/cirodown#benchmark-gem5-single-file-change-rebuild-time
# A debug build is pointless if I can't... debug! ldflags_extra = ['-fuse-ld=lld'] + self.env['ldflags']
# https://github.com/cirosantilli/linux-kernel-module-cheat/issues/109
gold_linker_cmd = []
else:
gold_linker_cmd = ['--gold-linker', LF]
kwargs = {} kwargs = {}
if self.env['ccache']: if self.env['ccache']:
kwargs['extra_paths'] = [self.env['ccache_dir']] kwargs['extra_paths'] = [self.env['ccache_dir']]
@@ -126,9 +122,9 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t
'scons', LF, 'scons', LF,
'-j', str(self.env['nproc']), LF, '-j', str(self.env['nproc']), LF,
'--ignore-style', LF, '--ignore-style', LF,
'LDFLAGS_EXTRA={}'.format(self.sh.cmd_to_string(ldflags_extra, force_oneline=True)), LF,
'USE_HDF5=1', LF, 'USE_HDF5=1', LF,
] + ] +
gold_linker_cmd +
verbose + verbose +
[ [
# TODO reenable, broken, had enough of this. # TODO reenable, broken, had enough of this.

View File

@@ -1747,6 +1747,12 @@ class BuildCliFunction(LkmcCliFunction):
'default': '', 'default': '',
'help': '''\ 'help': '''\
Pass the given compiler flags to all languages (C, C++, Fortran, etc.) Pass the given compiler flags to all languages (C, C++, Fortran, etc.)
''',
},
'--ldflags': {
'default': '',
'help': '''\
Extra linker flags.
''', ''',
}, },
'--configure': { '--configure': {