]> Savannah Git Hosting - gnulib.git/commitdiff
relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 14:33:05 +0000 (16:33 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 17 Sep 2024 12:46:15 +0000 (14:46 +0200)
Reference: <https://savannah.gnu.org/patch/?10469>.

* build-aux/config.libpath: Accept a second argument. Use it on
FreeBSD/powerpc64.
* m4/relocatable.m4 (AC_LIB_LIBPATH): Require gl_HOST_CPU_C_ABI_32BIT.
Pass HOST_CPU_C_ABI_32BIT to the config.libpath script.
* modules/relocatable-prog (Files): Add m4/host-cpu-c-abi.m4.

ChangeLog
build-aux/config.libpath
m4/relocatable.m4
modules/relocatable-prog

index df74aab4cf37bd41bcd733850f45fe44ce59e56a..ac1e7e6c7bee5ce61d30d972e013d7e749c331ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-08-24  Bruno Haible  <bruno@clisp.org>
+
+       relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64.
+       Reference: <https://savannah.gnu.org/patch/?10469>.
+       * build-aux/config.libpath: Accept a second argument. Use it on
+       FreeBSD/powerpc64.
+       * m4/relocatable.m4 (AC_LIB_LIBPATH): Require gl_HOST_CPU_C_ABI_32BIT.
+       Pass HOST_CPU_C_ABI_32BIT to the config.libpath script.
+       * modules/relocatable-prog (Files): Add m4/host-cpu-c-abi.m4.
+
 2024-08-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        diffseq: port to GCC 14.2.1 in ‘patch’
index 323b7669c8f49fe37a6ef58cf648a0fdcd84a69e..3acf2da2c9bbcd1e0d00ced470b80584d315ce20 100755 (executable)
 #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
 # or
 #    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+#
+# The second argument passed to this file is 'yes' if the C language ABI
+# is 32-bit, or 'no' if it is 64-bit.
+#
 # The environment variable LD should be set by the caller.
 #
 # The set of defined variables is at the end of this script.
@@ -36,6 +40,7 @@ host="$1"
 host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+abi_32bit="$2"
 
 shlibpath_var=
 case $host_os in
@@ -67,7 +72,18 @@ case $host_os in
     shlibpath_var=LD_LIBRARY_PATH
     ;;
   freebsd* | dragonfly* | midnightbsd*)
-    shlibpath_var=LD_LIBRARY_PATH
+    case $host_cpu in
+      powerpc64)
+        if test "$abi_32bit" != yes; then
+          shlibpath_var=LD_LIBRARY_PATH
+        else
+          shlibpath_var=LD_32_LIBRARY_PATH
+        fi
+        ;;
+      *)
+        shlibpath_var=LD_LIBRARY_PATH
+        ;;
+    esac
     ;;
   gnu*)
     shlibpath_var=LD_LIBRARY_PATH
index 22b463bd114a3631fdf5a406c71d016f338bdac0..3a9fc7508432631c2cf132eba3cf048961e06f80 100644 (file)
@@ -1,4 +1,4 @@
-# relocatable.m4 serial 25
+# relocatable.m4 serial 26
 dnl Copyright (C) 2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -148,10 +148,11 @@ AC_DEFUN([AC_LIB_LIBPATH],
 [
   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD
   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])   dnl we use $HOST_CPU_C_ABI_32BIT
   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
   AC_CACHE_CHECK([for shared library path variable], [acl_cv_libpath], [
     LD="$LD" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.libpath" "$host" > conftest.sh
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.libpath" "$host" "$HOST_CPU_C_ABI_32BIT" > conftest.sh
     . ./conftest.sh
     rm -f ./conftest.sh
     acl_cv_libpath=${acl_cv_shlibpath_var:-none}
index 8e22b20dd072357522c7f0b2a98e433dba9c26ce..4d13fda63b023081bd1a6e44baa82dd0aa086909 100644 (file)
@@ -13,6 +13,7 @@ lib/progreloc.c
 m4/relocatable.m4
 m4/relocatable-lib.m4
 m4/lib-ld.m4
+m4/host-cpu-c-abi.m4
 
 Depends-on:
 relocatable-prog-wrapper