From 0d94621c1e182f5a13a9504523afcb01ec546b37 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 24 Aug 2024 15:46:59 +0200 Subject: [PATCH] Fix shared library support in 32-bit mode on FreeBSD/powerpc64. Patch from . * m4/libtool.m4: On FreeBSD, fix shlibpath_var. * libcharset/m4/libtool.m4: Likewise. --- ChangeLog | 6 ++++++ libcharset/ChangeLog | 6 ++++++ libcharset/m4/libtool.m4 | 16 +++++++++++++++- m4/libtool.m4 | 16 +++++++++++++++- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f35c850..815109a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-08-24 Bruno Haible + + Fix shared library support in 32-bit mode on FreeBSD/powerpc64. + Patch from . + * m4/libtool.m4: On FreeBSD, fix shlibpath_var. + 2024-08-14 Collin Funk (tiny change) Prefer #include <...> for system headers. diff --git a/libcharset/ChangeLog b/libcharset/ChangeLog index befb0ed..996cfcc 100644 --- a/libcharset/ChangeLog +++ b/libcharset/ChangeLog @@ -1,3 +1,9 @@ +2024-08-24 Bruno Haible + + Fix shared library support in 32-bit mode on FreeBSD/powerpc64. + Patch from . + * m4/libtool.m4: On FreeBSD, fix shlibpath_var. + 2023-09-18 Bruno Haible Fix shared library support on Android. diff --git a/libcharset/m4/libtool.m4 b/libcharset/m4/libtool.m4 index c95d015..670eb6f 100644 --- a/libcharset/m4/libtool.m4 +++ b/libcharset/m4/libtool.m4 @@ -2699,7 +2699,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 . + 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 diff --git a/m4/libtool.m4 b/m4/libtool.m4 index c95d015..670eb6f 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2699,7 +2699,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 . + 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 -- 2.11.4.GIT