]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix libtool wrapper programs in 32-bit mode on FreeBSD/powerpc64.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 11:50:42 +0000 (13:50 +0200)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Tue, 27 Aug 2024 14:07:29 +0000 (17:07 +0300)
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): On FreeBSD/powerpc64, in 32-bit mode,
set shlibpath_var to LD_32_LIBRARY_PATH instead of LD_LIBRARY_PATH.

m4/libtool.m4

index edd9b3cfc8aec8ddc8655e1f9a66d69e020f47cb..bb0ae820a6e689ef1e616e91c34685c73cc686ad 100644 (file)
@@ -2727,7 +2727,21 @@ freebsd* | dragonfly* | midnightbsd*)
       need_version=yes
       ;;
   esac
-  shlibpath_var=LD_LIBRARY_PATH
+  case $host_cpu in
+    powerpc64)
+      # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+      # binaries.  See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+      AC_COMPILE_IFELSE(
+        [AC_LANG_SOURCE(
+           [[int test_pointer_size[sizeof (void *) - 5];
+           ]])],
+        [shlibpath_var=LD_LIBRARY_PATH],
+        [shlibpath_var=LD_32_LIBRARY_PATH])
+      ;;
+    *)
+      shlibpath_var=LD_LIBRARY_PATH
+      ;;
+  esac
   case $host_os in
   freebsd2.*)
     shlibpath_overrides_runpath=yes