qemu: use ccache

readme: improve build variants
This commit is contained in:
Ciro Santilli
2018-09-14 16:56:12 +01:00
parent 40b5c5a023
commit 7f81db9a46
4 changed files with 13 additions and 8 deletions

View File

@@ -9305,6 +9305,7 @@ For example, if you want to keep two builds around, one for the latest Linux ver
.... ....
./build-buildroot ./build-buildroot
git -C "$(./getvar linux_src_dir)" fetch --tags --unshallow
git -C "$(./getvar linux_src_dir)" checkout v4.16 git -C "$(./getvar linux_src_dir)" checkout v4.16
./build-buildroot --linux-build-id v4.16 ./build-buildroot --linux-build-id v4.16
git -C "$(./getvar linux_src_dir)" checkout - git -C "$(./getvar linux_src_dir)" checkout -
@@ -9312,7 +9313,9 @@ git -C "$(./getvar linux_src_dir)" checkout -
./run --linux-build-id v4.16 ./run --linux-build-id v4.16
.... ....
The `-L` option should be passed to all scripts that support it, much like `-a` for the <<cpu-architecture>>, e.g. to step debug: The `git fetch --unshallow` is needed the first time because link:configure[] only does a shallow clone of the Linux kernel to save space and time, see also: https://stackoverflow.com/questions/6802145/how-to-convert-a-git-shallow-clone-to-a-full-clone
The `--linux-build-id` option should be passed to all scripts that support it, much like `-a` for the <<cpu-architecture>>, e.g. to step debug:
..... .....
./rungdb --linux-build-id v4.16 ./rungdb --linux-build-id v4.16
@@ -9322,7 +9325,7 @@ This technique is implemented semi-hackishly by moving symlinks around inside th
==== QEMU build variants ==== QEMU build variants
Analogous to the <<linux-kernel-build-variants>> but with the `-Q` option instead: Analogous to the <<linux-kernel-build-variants>> but with the `--qemu-build-id` option instead:
.... ....
./build-qemu ./build-qemu
@@ -9335,7 +9338,7 @@ git -C "$(./getvar qemu_src_dir)" checkout -
==== gem5 build variants ==== gem5 build variants
Analogous to the <<linux-kernel-build-variants>> but with the `-M` option instead: Analogous to the <<linux-kernel-build-variants>> but with the `--gem5-build-id` option instead:
.... ....
# Build master. # Build master.

View File

@@ -69,7 +69,8 @@ else:
# TODO cross_compile is ignored because the make does not use CC... # TODO cross_compile is ignored because the make does not use CC...
subprocess.check_call(['make', '-C', bootloader64_dir]) subprocess.check_call(['make', '-C', bootloader64_dir])
shutil.copy2(os.path.join(bootloader64_dir, 'boot_emm.arm64'), binaries_dir) shutil.copy2(os.path.join(bootloader64_dir, 'boot_emm.arm64'), binaries_dir)
assert common.run_cmd([ assert common.run_cmd(
[
'scons', 'scons',
# TODO factor with build. # TODO factor with build.
'-j', str(multiprocessing.cpu_count()), '-j', str(multiprocessing.cpu_count()),
@@ -78,7 +79,7 @@ else:
] + ] +
args.extra_scons_args, args.extra_scons_args,
cwd=common.gem5_src_dir, cwd=common.gem5_src_dir,
extra_env={'PATH': '/usr/lib/ccache:' + os.environ['PATH']}, extra_env={'PATH': common.ccache_dir + ':' + os.environ['PATH']},
) == 0 ) == 0
term_src_dir = os.path.join(common.gem5_src_dir, 'util/term') term_src_dir = os.path.join(common.gem5_src_dir, 'util/term')
subprocess.check_call(['make', '-C', term_src_dir]) subprocess.check_call(['make', '-C', term_src_dir])

View File

@@ -33,14 +33,14 @@ else:
args.extra_config_args, args.extra_config_args,
cwd=common.qemu_build_dir cwd=common.qemu_build_dir
) )
subprocess.check_call( assert common.run_cmd(
[ [
'make', 'make',
# TODO factor with build. # TODO factor with build.
'-j', str(multiprocessing.cpu_count()), '-j', str(multiprocessing.cpu_count()),
], ],
cwd=common.qemu_build_dir, cwd=common.qemu_build_dir,
extra_env={'PATH': '/usr/lib/ccache:' + os.environ['PATH']}, extra_env={'PATH': common.ccache_dir + ':' + os.environ['PATH']},
) ) == 0
end_time = time.time() end_time = time.time()
common.print_time(end_time - start_time) common.print_time(end_time - start_time)

View File

@@ -32,6 +32,7 @@ gem5_default_src_dir = os.path.join(submodules_dir, 'gem5')
linux_src_dir = os.path.join(submodules_dir, 'linux') linux_src_dir = os.path.join(submodules_dir, 'linux')
qemu_src_dir = os.path.join(submodules_dir, 'qemu') qemu_src_dir = os.path.join(submodules_dir, 'qemu')
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark') parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
ccache_dir = os.path.join('/usr', 'lib', 'ccache')
# Other default variables. # Other default variables.
arch_map = { arch_map = {