Blame SOURCES/libidn2-2.0.0-rpath.patch

fc1c4c
Patch by Robert Scheck <robert@fedoraproject.org> for libidn2 >= 2.0.0, which works
fc1c4c
around the broken libtool of Debian. Multilib/multiarch systems like Fedora or Red
fc1c4c
Hat Enterprise Linux are using /usr/lib64 for 64 bit libraries and /usr/lib is used
fc1c4c
for 32 bit libraries. That allows to run 32 bit software on 64 bit systems. Debian
fc1c4c
systems only use /usr/lib which contains only 32 or 64 bit systems depending on the
fc1c4c
architecture.
fc1c4c
fc1c4c
Libtool hardcodes the runtime search path in a library (rpath), if the library that
fc1c4c
is used for linking is not within the default system library path. The result is,
fc1c4c
that if libtool.m4/configure files are generated by a Debian system, but used on a
fc1c4c
Fedora or Red Hat Enterprise Linux 64 bit system for compiling, "-rpath /usr/lib64"
fc1c4c
makes it into the binary.
fc1c4c
fc1c4c
Fedora and EPEL (for Red Hat Enterprise Linux) do not allow binaries with rpath, as
fc1c4c
the Linux dynamic linker is usually smarter than the hardcoded path.
fc1c4c
fc1c4c
The fix for this issue is to add the optional /lib64 and /usr/lib64 directories at/
fc1c4c
within libtool in front of the regular /lib and /usr/lib directories at the system
fc1c4c
library path. These libtool information are hold in libtool.m4, which is generated
fc1c4c
by running aclocal. As the content of libtool.m4 is included into configure during
fc1c4c
a run of autoconf, libtool.m4 needs to be modified within the upstream build system
fc1c4c
each time after a aclocal run - until Debian's libtool is fixed at Debian upstream.
fc1c4c
fc1c4c
Applying the fix is either possible by using the last hunk of the patch (the other
fc1c4c
hunks are runtime-only if configure file has been already generated) or by running
fc1c4c
the following sed command after each aclocal run within the upstream build system:
fc1c4c
fc1c4c
  sed -e 's@\(# Ideally, we could use ldconfig to report\)@# Add ABI-specific directories to the system library path.\n  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"\n\n  \1@' \
fc1c4c
      -e 's@/lib /usr/lib $lt_ld_extra@$sys_lib_dlsearch_path_spec $lt_ld_extra@' -i libidn2-2.0.0/m4/libtool.m4
fc1c4c
fc1c4c
More information regarding this topic can be found for example at:
fc1c4c
fc1c4c
 - http://osdir.com/ml/bug-libtool-gnu/2009-12/msg00034.html
fc1c4c
 - http://lists.gnu.org/archive/html/libtool/2009-01/msg00039.html
fc1c4c
 - http://thread.gmane.org/gmane.comp.gnu.libtool.general/8339/focus=8345
fc1c4c
fc1c4c
--- libidn2-2.0.0/configure		2017-03-29 17:26:58.000000000 +0200
fc1c4c
+++ libidn2-2.0.0/configure.rpath	2017-04-07 00:59:43.000000000 +0200
fc1c4c
@@ -14266,6 +14266,9 @@
fc1c4c
   # before this can be enabled.
fc1c4c
   hardcode_into_libs=yes
fc1c4c
 
fc1c4c
+  # Add ABI-specific directories to the system library path.
fc1c4c
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
fc1c4c
+
fc1c4c
   # Ideally, we could use ldconfig to report *all* directores which are
fc1c4c
   # searched for libraries, however this is still not possible.  Aside from not
fc1c4c
   # being certain /sbin/ldconfig is available, command
fc1c4c
@@ -14274,7 +14277,7 @@
fc1c4c
   # appending ld.so.conf contents (and includes) to the search path.
fc1c4c
   if test -f /etc/ld.so.conf; then
fc1c4c
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
fc1c4c
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fc1c4c
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fc1c4c
   fi
fc1c4c
 
fc1c4c
   # We used to test for /lib/ld.so.1 and disable shared libraries on
fc1c4c
--- libidn2-2.0.0/m4/libtool.m4		2017-02-15 10:54:29.000000000 +0100
fc1c4c
+++ libidn2-2.0.0/m4/libtool.m4.rpath	2017-04-07 00:58:52.000000000 +0200
fc1c4c
@@ -2866,6 +2866,9 @@
fc1c4c
   # before this can be enabled.
fc1c4c
   hardcode_into_libs=yes
fc1c4c
 
fc1c4c
+  # Add ABI-specific directories to the system library path.
fc1c4c
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
fc1c4c
+
fc1c4c
   # Ideally, we could use ldconfig to report *all* directores which are
fc1c4c
   # searched for libraries, however this is still not possible.  Aside from not
fc1c4c
   # being certain /sbin/ldconfig is available, command
fc1c4c
@@ -2874,7 +2877,7 @@
fc1c4c
   # appending ld.so.conf contents (and includes) to the search path.
fc1c4c
   if test -f /etc/ld.so.conf; then
fc1c4c
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
fc1c4c
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fc1c4c
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fc1c4c
   fi
fc1c4c
 
fc1c4c
   # We used to test for /lib/ld.so.1 and disable shared libraries on