diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-18 15:18:11 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-18 15:35:58 +0000 |
commit | f7e8218a73db5f4177ef8d3389bda6476be5bab9 (patch) | |
tree | 530e4f8013230c5772b7e70020b507b5ad6ea08c | |
parent | 55fa597a9e4651e92b921e5d2e84f5d15858fea7 (diff) |
tcwg_kernel-build.sh: Use GNU Binutils for LLVM builds
... since, apparently, clang needs stand-alone assembler for cases
that integrated assembler can't handle.
This used to work because we had binutils-arm-linux-gnueabihf and
binutils-aarch64-linux-gnu packages in the base docker images.
Change-Id: I0467b6c062d2e0f090c7e8628c07b6da07cdf4c9
-rwxr-xr-x | tcwg_kernel-build.sh | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh index ca0fc01d..247ebce8 100755 --- a/tcwg_kernel-build.sh +++ b/tcwg_kernel-build.sh @@ -43,7 +43,7 @@ rr[linux_config]=${rr[linux_config]-${ci_config[4]}} case "${rr[toolchain]}" in llvm) # shellcheck disable=SC2154 - rr[components]="llvm linux qemu" ;; + rr[components]="binutils llvm linux qemu" ;; gnu) rr[components]="binutils gcc linux qemu" ;; *) assert_with_msg "Unknown toolchain \"${rr[toolchain]}\"" false ;; @@ -109,29 +109,35 @@ build_linux_1 () rm -rf "$(pwd)"/bin mkdir "$(pwd)"/bin - local bin cc ld_opt="" + local abe_bin cc ld_opt="" + + abe_bin="$(pwd)/abe/builds/destdir/x86_64-pc-linux-gnu/bin" + # Use binutils $abe_bin for both GNU and LLVM builds. + # For LLVM builds at the very least we need target assembler, since, + # otherwise, clang will try to use /usr/bin/as for cases that integrated + # assembler can't handle. + export PATH="$abe_bin:$PATH" case "${rr[toolchain]}" in llvm) - bin="$(pwd)/llvm-install/bin" - cc="$bin/clang" + local llvm_bin + llvm_bin="$(pwd)/llvm-install/bin" + export PATH="$llvm_bin:$PATH" + + cc="$llvm_bin/clang" # Use LLD linker when building with LLVM. # TODO: Improve LLD to handle ARM's allmodconfig and # allyesconfig. case "${rr[target]}-${rr[linux_config]}" in arm-allmodconfig|arm-allyesconfig) ;; - *) ld_opt="LD=$bin/ld.lld" ;; + *) ld_opt="LD=$llvm_bin/ld.lld" ;; esac ;; gnu) - bin="$(pwd)/abe/builds/destdir/x86_64-pc-linux-gnu/bin" - cc="$bin/$(print_gnu_target ${rr[target]})-gcc" + cc="$abe_bin/$(print_gnu_target ${rr[target]})-gcc" ;; esac - # Use binutils, etc from $bin - export PATH="$bin:$PATH" - # Use ccache only when bisecting linux (or preparing to). # Otherwise the compiler is new in every build and we would # only clobber ccache volume. @@ -308,9 +314,9 @@ rr[breakup_updated_components]=tcwg_kernel_breakup_updated_components run_step stop_on_fail -10 reset_artifacts run_step stop_on_fail x prepare_abe +run_step skip_on_fail -9 build_abe binutils case "${rr[toolchain]}" in gnu) - run_step skip_on_fail -9 build_abe binutils run_step skip_on_fail -1 build_abe stage1 ;; llvm) |