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 <[email protected]>
  • Loading branch information
andrew-m-leonard committed Aug 4, 2023
1 parent b95d6ac commit af70b81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ addGLIBCforLinux() {
# Remove env=xx from CC, so we can call from bash to get __GLIBC.
CC=$(echo "$CC" | tr -s " " | cut -d" " -f3- | sed -E "s/[^ ]*=[^ ]*//g")
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 "CC=$CC"
echo "SYSROOT=$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)
local GLIBC_VERSION="${GLIBC_MAJOR}.${GLIBC_MINOR}"
Expand Down

0 comments on commit af70b81

Please sign in to comment.