diff mbox series

tcwg_kernel-build.sh: Report toolchain versions

Message ID 20220131224527.2391044-1-keescook@chromium.org (mailing list archive)
State Handled Elsewhere
Headers show
Series tcwg_kernel-build.sh: Report toolchain versions | expand

Commit Message

Kees Cook Jan. 31, 2022, 10:45 p.m. UTC
Report the toolchain versions after locating them.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
Repo: https://git.linaro.org/toolchain/jenkins-scripts.git/
---
 tcwg_kernel-build.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index 42ed4a55907c..7f76c4bcce52 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -97,7 +97,7 @@  build_linux_1 ()
     rm -rf "$(pwd)"/bin
     mkdir "$(pwd)"/bin
 
-    local gnu_host abe_bin cc ld_opt=""
+    local gnu_host abe_bin cc ld hostcc ld_opt=""
 
     gnu_host=$(print_gnu_target native)
     abe_bin="$(pwd)/abe/builds/destdir/$gnu_host/bin"
@@ -114,12 +114,19 @@  build_linux_1 ()
 	    export PATH="$llvm_bin:$PATH"
 
 	    cc="$llvm_bin/clang"
-	    ld_opt="LD=$llvm_bin/ld.lld"
+	    ld="$llvm_bin/ld.lld"
+	    hostcc="$cc"
+
+	    ld_opt="LD=$ld"
 	    ;;
 	gnu)
 	    cc="$abe_bin/$(print_gnu_target ${rr[target]})-gcc"
+	    ld="$abe_bin/$(print_gnu_target ${rr[target]})-ld"
+	    hostcc=gcc
 	    ;;
     esac
+    echo -n "Compiler: "; $cc --version | head -n1
+    echo -n "Linker:   "; $ld --version | head -n1
 
     # Use ccache only when bisecting linux or qemu (or preparing to).
     # Otherwise the compiler is new in every build and we would
@@ -142,7 +149,8 @@  EOF
     if [ x"${rr[target]}" != x"$(uname -m)" ]; then
 	opts="$opts ARCH=$(print_kernel_target ${rr[target]})"
 	opts="$opts CROSS_COMPILE=$(print_gnu_target ${rr[target]})-"
-	opts="$opts HOSTCC=gcc"
+	opts="$opts HOSTCC=$hostcc"
+	echo -n "Host cc:  "; $cc --version | head -n1
     fi
 
     cd linux