Skip to content

Commit

Permalink
Fix SBOM glibc and gcc version info
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <anleonar@redhat.com>
  • Loading branch information
andrew-m-leonard committed Aug 4, 2023
1 parent b1cfc6b commit 26a2c71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,11 @@ addGLIBCforLinux() {
# Get CC and SYSROOT_CFLAGS from the built build spec.gmk.
local CC=$(grep "^CC :=" ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/build/*/spec.gmk)
# Remove env=xx from CC, so we can call from bash to get __GLIBC.
echo $CC
CC=$(echo "$CC" | tr -s " " | cut -d" " -f3- | sed -E "s/[^ ]*=[^ ]*//g")
echo $CC
local SYSROOT_CFLAGS=$(grep "^SYSROOT_CFLAGS :=" ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/build/*/spec.gmk | tr -s " " | cut -d" " -f3-)
echo $SYSROOT_CFLAGS

local GLIBC_MAJOR=$(echo "#include <features.h>" | $CC $SYSROOT_CFLAGS -dM -E - 2>&1 | tr -s " " | grep "#define __GLIBC__" | cut -d" " -f3)
local GLIBC_MINOR=$(echo "#include <features.h>" | $CC $SYSROOT_CFLAGS -dM -E - 2>&1 | tr -s " " | grep "#define __GLIBC_MINOR__" | cut -d" " -f3)
Expand Down

0 comments on commit 26a2c71

Please sign in to comment.