Merge pull request #208859 from trofi/gcc-builder-cleanup

gcc/builder.sh: drop dead RPATH clobbering code
This commit is contained in:
Sergei Trofimovich 2023-01-05 18:42:01 +00:00 committed by GitHub
commit b18eedcdab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,25 +240,6 @@ postInstall() {
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
rm -rf $out/bin/gccbug
if [[ buildConfig == *"linux"* ]]; then
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
for i in $(find "$out"/libexec/gcc/*/*/* -type f -a \! -name '*.la'); do
PREV_RPATH=`patchelf --print-rpath "$i"`
NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'`
patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
done
fi
if [[ targetConfig == *"linux"* ]]; then
# For some reason, when building for linux on darwin, the libs retain
# RPATH to $out.
for i in "$lib"/"$targetConfig"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do
PREV_RPATH=`patchelf --print-rpath "$i"`
NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"`
patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK
done
fi
if type "install_name_tool"; then
for i in "${!outputLib}"/lib/*.*.dylib "${!outputLib}"/lib/*.so.[0-9]; do
install_name_tool -id "$i" "$i" || true