From 7ed3355c04f0978ec16f7c83214172add4e8adad Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Tue, 21 Mar 2023 19:49:23 +0100 Subject: [PATCH] glibc: Fix RUNPATH in gconv libraries Those libraries uses a special RUNPATH called $ORIGIN which we do not support in IPFire. So changing this to the directory where the are installed. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- glibc/glibc.nm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/glibc/glibc.nm b/glibc/glibc.nm index a58a826c8..3b1362d4d 100644 --- a/glibc/glibc.nm +++ b/glibc/glibc.nm @@ -5,7 +5,7 @@ name = glibc version = 2.37 -release = 4 +release = 5 maintainer = Michael Tremer groups = System/Base @@ -44,6 +44,7 @@ build libcap-devel libstdc++-static make >= 4.0 + patchelf python3 >= 3.4 texinfo end @@ -119,6 +120,22 @@ build # Strip any object files strip --strip-debug %{BUILDROOT}%{libdir}/*.o + + # Some gconv libraries requires other libraries and contain $ORIGIN + # as RUNPATH because they are all located in the same directory. + # We do not support $ORIGIN as RUNPATH so change this to the directory + # where the modules are located. + find %{BUILDROOT}%{libdir}/gconv -type f -name "*.so" -exec sh -c ' + for file do + # Obtain the RUNPATH of the module in case it has one set. + runpath=$(patchelf --print-rpath ${file} | tr -d '\n') + + # Check if the RUNPATH is $ORIGIN + if [ "${runpath}" == "\$ORIGIN" ]; then + # Use patchelf to change the RUNPATH + patchelf --set-rpath %{libdir}/gconv ${file} + fi + done ' sh {} + end end -- 2.39.5