[coreboot-gerrit] Patch set updated for coreboot: util/genbuild_h: Add compiler version
Paul Menzel (paulepanter@users.sourceforge.net)
gerrit at coreboot.org
Mon Jul 11 22:56:30 CEST 2016
Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15592
-gerrit
commit c0392aad65ffd9dcee9e98d061adb5f35589f72d
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date: Sun Jul 10 12:17:45 2016 +0200
util/genbuild_h: Add compiler version
It’s useful to note the compiler used for a build, and output it in the
banner. Linux and SeaBIOS do that for example.
```
$ dmesg | grep gcc
[ 0.000000] Linux version 4.7.0-rc4-686-pae (debian-kernel at lists.debian.org) (gcc version 5.4.0 20160609 (Debian 5.4.0-4) ) #1 SMP Debian 4.7~rc4-1~exp1 (2016-06-20)
$ sudo cbmem -c | grep gcc
BUILD: gcc: (Debian 5.4.0-6) 5.4.0 20160609 binutils: (GNU Binutils for Debian) 2.26.1
```
The version information for the two supported compilers look like below.
```
$ gcc --version
gcc (Debian 5.4.0-6) 5.4.0 20160609
$ clang --version
Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5)
Target: x86_64-pc-linux-gnu
Thread model: posix
```
Change-Id: Ide2d719dcbafa49cb1e75bae207981f722ae36b5
Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
util/genbuild_h/genbuild_h.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 044d901..f5d4218 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -24,6 +24,12 @@ export TZ=UTC
top=`dirname $0`/../..
+COMPILER_VERSION=$($(CC)_x86_32 --version | head -1)
+
+if [ -z COMPILER_VERSION ] ; then
+ COMPILER_VERSION="Unknown"
+fi
+
if [ "${BUILD_TIMELESS}" = "1" ]; then
GITREV=Timeless
TIMESOURCE="fixed"
@@ -68,4 +74,6 @@ printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x$(our_date "$DATE" +%w)\n"
printf "#define COREBOOT_DMI_DATE \"$(our_date "$DATE" +%m/%d/%Y)\"\n"
printf "\n"
printf "#define COREBOOT_COMPILE_TIME \"$(our_date "$DATE" +%T)\"\n"
+
+printf "#define COREBOOT_COMPILER_VERSION \"$COMPILER_VERSION\"\n"
printf "#endif\n"
More information about the coreboot-gerrit
mailing list