From 83902713c8f45222cb7949f7ddf2e835b21f1495 Mon Sep 17 00:00:00 2001 From: Larry Safran Date: Wed, 10 Jul 2024 14:13:06 -0700 Subject: [PATCH] compiler: Upgrade from CentOS 7 to AlmaLinux 8 (#11372) CentOS 7 became end-of-life on July 1st and is no longer working. We now dynamically link against libstdc++, as RHEL 8 doesn't support static linking: https://access.redhat.com/articles/rhel8-abi-compatibility We now use objdump in check-artifact for all linux architectures. This avoids using a mix of objdump and ldd. ldd shows transitive dependencies, which is less convenient. Co-authored-by: Eric Anderson --- buildscripts/grpc-java-artifacts/Dockerfile | 6 ++---- compiler/build.gradle | 1 - compiler/check-artifact.sh | 19 +++++-------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/buildscripts/grpc-java-artifacts/Dockerfile b/buildscripts/grpc-java-artifacts/Dockerfile index 47be5c46145..97c152780a3 100644 --- a/buildscripts/grpc-java-artifacts/Dockerfile +++ b/buildscripts/grpc-java-artifacts/Dockerfile @@ -1,17 +1,15 @@ -FROM centos:7.9.2009 +FROM almalinux:8 RUN yum install -y \ autoconf \ automake \ + diffutils \ gcc-c++ \ - gcc-c++.i686 \ glibc-devel \ glibc-devel.i686 \ java-11-openjdk-devel \ libstdc++-devel \ libstdc++-devel.i686 \ - libstdc++-static \ - libstdc++-static.i686 \ libtool \ make \ tar \ diff --git a/compiler/build.gradle b/compiler/build.gradle index 8bed90b8678..7947e18b22a 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -117,7 +117,6 @@ model { // Link other (system) libraries dynamically. // Clang under OSX doesn't support these options. linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc", - "-static-libstdc++", "-Wl,-Bdynamic", "-lpthread", "-s" } addEnvArgs("LDFLAGS", linker.args) diff --git a/compiler/check-artifact.sh b/compiler/check-artifact.sh index a80207af692..4d0c2fa6286 100755 --- a/compiler/check-artifact.sh +++ b/compiler/check-artifact.sh @@ -113,23 +113,14 @@ checkDependencies () dump_cmd='objdump -x '"$1"' | fgrep "DLL Name"' white_list="KERNEL32\.dll\|msvcrt\.dll\|USER32\.dll" elif [[ "$OS" == linux ]]; then - dump_cmd='ldd '"$1" + dump_cmd='objdump -x '"$1"' | grep "NEEDED"' + white_list="libpthread\.so\.0\|libstdc++\.so\.6\|libc\.so\.6" if [[ "$ARCH" == x86_32 ]]; then - white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2" + white_list="${white_list}\|libm\.so\.6" elif [[ "$ARCH" == x86_64 ]]; then - white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2" + white_list="${white_list}\|libm\.so\.6" elif [[ "$ARCH" == aarch_64 ]]; then - dump_cmd='aarch64-linux-gnu-objdump -x '"$1"' |grep "NEEDED"' - white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1" - elif [[ "$ARCH" == loongarch_64 ]]; then - dump_cmd='objdump -x '"$1"' | grep NEEDED' - white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld\.so\.1" - elif [[ "$ARCH" == ppcle_64 ]]; then - dump_cmd='powerpc64le-linux-gnu-objdump -x '"$1"' |grep "NEEDED"' - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld64\.so\.2" - elif [[ "$ARCH" == s390_64 ]]; then - dump_cmd='s390x-linux-gnu-objdump -x '"$1"' |grep "NEEDED"' - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld64\.so\.1" + white_list="${white_list}\|ld-linux-aarch64\.so\.1" fi elif [[ "$OS" == osx ]]; then dump_cmd='otool -L '"$1"' | fgrep dylib'