Skip to content

Commit 71eb5fb

Browse files
authoredJul 3, 2024
compiler: Upgrade from CentOS 7 to AlmaLinux 8
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.
1 parent 0454b9e commit 71eb5fb

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed
 

‎buildscripts/grpc-java-artifacts/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
FROM centos:7.9.2009
1+
FROM almalinux:8
22

33
RUN yum install -y \
44
autoconf \
55
automake \
6+
diffutils \
67
gcc-c++ \
7-
gcc-c++.i686 \
88
glibc-devel \
99
glibc-devel.i686 \
1010
java-11-openjdk-devel \
1111
libstdc++-devel \
1212
libstdc++-devel.i686 \
13-
libstdc++-static \
14-
libstdc++-static.i686 \
1513
libtool \
1614
make \
1715
tar \

‎compiler/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ model {
117117
// Link other (system) libraries dynamically.
118118
// Clang under OSX doesn't support these options.
119119
linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc",
120-
"-static-libstdc++",
121120
"-Wl,-Bdynamic", "-lpthread", "-s"
122121
}
123122
addEnvArgs("LDFLAGS", linker.args)

‎compiler/check-artifact.sh

+5-14
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,14 @@ checkDependencies ()
113113
dump_cmd='objdump -x '"$1"' | fgrep "DLL Name"'
114114
white_list="KERNEL32\.dll\|msvcrt\.dll\|USER32\.dll"
115115
elif [[ "$OS" == linux ]]; then
116-
dump_cmd='ldd '"$1"
116+
dump_cmd='objdump -x '"$1"' | grep "NEEDED"'
117+
white_list="libpthread\.so\.0\|libstdc++\.so\.6\|libc\.so\.6"
117118
if [[ "$ARCH" == x86_32 ]]; then
118-
white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2"
119+
white_list="${white_list}\|libm\.so\.6"
119120
elif [[ "$ARCH" == x86_64 ]]; then
120-
white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2"
121+
white_list="${white_list}\|libm\.so\.6"
121122
elif [[ "$ARCH" == aarch_64 ]]; then
122-
dump_cmd='aarch64-linux-gnu-objdump -x '"$1"' |grep "NEEDED"'
123-
white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1"
124-
elif [[ "$ARCH" == loongarch_64 ]]; then
125-
dump_cmd='objdump -x '"$1"' | grep NEEDED'
126-
white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld\.so\.1"
127-
elif [[ "$ARCH" == ppcle_64 ]]; then
128-
dump_cmd='powerpc64le-linux-gnu-objdump -x '"$1"' |grep "NEEDED"'
129-
white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld64\.so\.2"
130-
elif [[ "$ARCH" == s390_64 ]]; then
131-
dump_cmd='s390x-linux-gnu-objdump -x '"$1"' |grep "NEEDED"'
132-
white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld64\.so\.1"
123+
white_list="${white_list}\|ld-linux-aarch64\.so\.1"
133124
fi
134125
elif [[ "$OS" == osx ]]; then
135126
dump_cmd='otool -L '"$1"' | fgrep dylib'

0 commit comments

Comments
 (0)