mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
build-gem5: --clang
This commit is contained in:
10
README.adoc
10
README.adoc
@@ -10182,6 +10182,16 @@ This does not run the test however.
|
||||
|
||||
Note that the command and it's corresponding results don't need to show consecutively on stdout because tests are run in parallel. You just have to match them based on the class name `CircleBufTest` to the file `circlebuf.test.cpp`.
|
||||
|
||||
=== gem5 clang build
|
||||
|
||||
TODO test properly, benchmark vs GCC.
|
||||
|
||||
....
|
||||
sudo apt-get install clang
|
||||
./build-gem5 --clang
|
||||
./run --clang --emulator gem5
|
||||
....
|
||||
|
||||
== Buildroot
|
||||
|
||||
=== Introduction to Buildroot
|
||||
|
||||
12
build-gem5
12
build-gem5
@@ -115,20 +115,30 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t
|
||||
targets = [self.env['gem5_unit_test_target']]
|
||||
else:
|
||||
targets = [self.env['gem5_executable']]
|
||||
if self.env['clang']:
|
||||
extra_env = {
|
||||
'CC': 'clang',
|
||||
'CXX': 'clang++',
|
||||
}
|
||||
gold_linker_cmd = []
|
||||
else:
|
||||
extra_env = {}
|
||||
gold_linker_cmd = ['--gold-linker', LF,]
|
||||
exit_status = self.sh.run_cmd(
|
||||
(
|
||||
[
|
||||
'scons', LF,
|
||||
'-j', str(self.env['nproc']), LF,
|
||||
# '--gold-linker', LF,
|
||||
'--ignore-style', LF,
|
||||
] +
|
||||
gold_linker_cmd +
|
||||
verbose +
|
||||
self.sh.add_newlines(targets) +
|
||||
self.sh.add_newlines(self.env['extra_scons_args'])
|
||||
),
|
||||
cwd=self.env['gem5_source_dir'],
|
||||
extra_paths=[self.env['ccache_dir']],
|
||||
extra_env=extra_env,
|
||||
raise_on_failure = False,
|
||||
)
|
||||
return exit_status
|
||||
|
||||
10
common.py
10
common.py
@@ -158,6 +158,14 @@ CPU architecture to use. If given multiple times, run the action
|
||||
for each arch sequentially in that order. If one of them fails, stop running.
|
||||
Valid archs: {}
|
||||
'''.format(arches_string)
|
||||
)
|
||||
self.add_argument(
|
||||
'--clang',
|
||||
default=False,
|
||||
help='''\
|
||||
Build with clang as much as possible. Set the build-id to clang by default unless
|
||||
one is given explicitly. Currently supported components: gem5.
|
||||
'''
|
||||
)
|
||||
self.add_argument(
|
||||
'--dry-run',
|
||||
@@ -437,6 +445,8 @@ Valid emulators: {}
|
||||
if not env['_args_given']['gem5_build_id']:
|
||||
if env['_args_given']['gem5_worktree']:
|
||||
env['gem5_build_id'] = env['gem5_worktree']
|
||||
elif env['_args_given']['clang']:
|
||||
env['gem5_build_id'] = 'clang'
|
||||
else:
|
||||
env['gem5_build_id'] = consts['default_build_id']
|
||||
env['is_arm'] = False
|
||||
|
||||
Reference in New Issue
Block a user