]> 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>
Sat, 24 Aug 2024 14:38:31 +0000 (16:38 +0200)
Reference: <https://savannah.gnu.org/patch/?10469>.

* build-aux/config.libpath: Accept a second argument. Use it on
FreeBSD/powerpc64.
(func_usage): Document it.
* 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 00db30f0782d157237fa1133aba58a88d266ced9..1c9e76d63d5e37d15b053cd3c6d6508576469a36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
+       (func_usage): Document it.
+       * 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 173cd0d90ba78b054df631b1ba8d0bc187a7637d..ba0f94426b2b2ecf8b089c36aef03b98895d5e87 100755 (executable)
@@ -29,7 +29,7 @@
 func_usage ()
 {
   echo "\
-Usage: config.libpath [OPTION] HOST
+Usage: config.libpath [OPTION] HOST HOST_CPU_C_ABI_32BIT
 
 Prints shell variable assignments that describe how to set the
 run time search path of shared libraries in an executable at run time.
@@ -39,6 +39,9 @@ The first argument passed to this file is the canonical host specification,
 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.
@@ -102,6 +105,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
@@ -133,7 +137,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 b86829e24633721b7fc4b7204c6ce98d138adc29..54423a8336cfec566dc4aceec46d5faf6ba6e4c7 100644 (file)
@@ -1,5 +1,5 @@
 # relocatable.m4
-# serial 25
+# 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,
@@ -149,10 +149,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