linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcwg_kernel-build.sh: Report toolchain versions
@ 2022-01-31 22:45 Kees Cook
  0 siblings, 0 replies; only message in thread
From: Kees Cook @ 2022-01-31 22:45 UTC (permalink / raw)
  To: Maxim Kuvyrkov; +Cc: Kees Cook, linaro-kernel, linux-hardening

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 --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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-31 22:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 22:45 [PATCH] tcwg_kernel-build.sh: Report toolchain versions Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).