Skip to content

Commit 7f81db9

Browse files
committed
qemu: use ccache
readme: improve build variants
1 parent 40b5c5a commit 7f81db9

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

README.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9305,14 +9305,17 @@ For example, if you want to keep two builds around, one for the latest Linux ver
93059305

93069306
....
93079307
./build-buildroot
9308+
git -C "$(./getvar linux_src_dir)" fetch --tags --unshallow
93089309
git -C "$(./getvar linux_src_dir)" checkout v4.16
93099310
./build-buildroot --linux-build-id v4.16
93109311
git -C "$(./getvar linux_src_dir)" checkout -
93119312
./run
93129313
./run --linux-build-id v4.16
93139314
....
93149315

9315-
The `-L` option should be passed to all scripts that support it, much like `-a` for the <<cpu-architecture>>, e.g. to step debug:
9316+
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
9317+
9318+
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:
93169319

93179320
.....
93189321
./rungdb --linux-build-id v4.16
@@ -9322,7 +9325,7 @@ This technique is implemented semi-hackishly by moving symlinks around inside th
93229325

93239326
==== QEMU build variants
93249327

9325-
Analogous to the <<linux-kernel-build-variants>> but with the `-Q` option instead:
9328+
Analogous to the <<linux-kernel-build-variants>> but with the `--qemu-build-id` option instead:
93269329

93279330
....
93289331
./build-qemu
@@ -9335,7 +9338,7 @@ git -C "$(./getvar qemu_src_dir)" checkout -
93359338

93369339
==== gem5 build variants
93379340

9338-
Analogous to the <<linux-kernel-build-variants>> but with the `-M` option instead:
9341+
Analogous to the <<linux-kernel-build-variants>> but with the `--gem5-build-id` option instead:
93399342

93409343
....
93419344
# Build master.

build-gem5

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ else:
6969
# TODO cross_compile is ignored because the make does not use CC...
7070
subprocess.check_call(['make', '-C', bootloader64_dir])
7171
shutil.copy2(os.path.join(bootloader64_dir, 'boot_emm.arm64'), binaries_dir)
72-
assert common.run_cmd([
72+
assert common.run_cmd(
73+
[
7374
'scons',
7475
# TODO factor with build.
7576
'-j', str(multiprocessing.cpu_count()),
@@ -78,7 +79,7 @@ else:
7879
] +
7980
args.extra_scons_args,
8081
cwd=common.gem5_src_dir,
81-
extra_env={'PATH': '/usr/lib/ccache:' + os.environ['PATH']},
82+
extra_env={'PATH': common.ccache_dir + ':' + os.environ['PATH']},
8283
) == 0
8384
term_src_dir = os.path.join(common.gem5_src_dir, 'util/term')
8485
subprocess.check_call(['make', '-C', term_src_dir])

build-qemu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ else:
3333
args.extra_config_args,
3434
cwd=common.qemu_build_dir
3535
)
36-
subprocess.check_call(
36+
assert common.run_cmd(
3737
[
3838
'make',
3939
# TODO factor with build.
4040
'-j', str(multiprocessing.cpu_count()),
4141
],
4242
cwd=common.qemu_build_dir,
43-
extra_env={'PATH': '/usr/lib/ccache:' + os.environ['PATH']},
44-
)
43+
extra_env={'PATH': common.ccache_dir + ':' + os.environ['PATH']},
44+
) == 0
4545
end_time = time.time()
4646
common.print_time(end_time - start_time)

common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
linux_src_dir = os.path.join(submodules_dir, 'linux')
3333
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
3434
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
35+
ccache_dir = os.path.join('/usr', 'lib', 'ccache')
3536

3637
# Other default variables.
3738
arch_map = {

0 commit comments

Comments
 (0)