Skip to contentSkip to conversation

tcwg_kernel-build.sh: Report toolchain versions

PATCH New Kees Cook 1 participant 1 message Jan 31, 2022

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 tcwg_kernel-build.sh: Report toolchain versions

Report the toolchain versions after locating them.

---
Repo: https://git.linaro.org/toolchain/jenkins-scripts.git/

---
 tcwg_kernel-build.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
tcwg_kernel-build.sh +11 -3
index 42ed4a55907c..7f76c4bcce52 100755
@@ -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
Signature · 1 line
2.30.2