From: Bruno Haible Date: Sat, 24 Aug 2024 14:33:05 +0000 (+0200) Subject: relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ab5cd68f2fa013bcda6a2c5fd4ca6fdbd89e864a;p=gnulib.git relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64. Reference: . * 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. --- diff --git a/ChangeLog b/ChangeLog index 00db30f078..1c9e76d63d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-08-24 Bruno Haible + + relocatable-prog: Add support for 32-bit build on FreeBSD/powerpc64. + Reference: . + * 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 diffseq: port to GCC 14.2.1 in ‘patch’ diff --git a/build-aux/config.libpath b/build-aux/config.libpath index 173cd0d90b..ba0f94426b 100755 --- a/build-aux/config.libpath +++ b/build-aux/config.libpath @@ -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 diff --git a/m4/relocatable.m4 b/m4/relocatable.m4 index b86829e246..54423a8336 100644 --- a/m4/relocatable.m4 +++ b/m4/relocatable.m4 @@ -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} diff --git a/modules/relocatable-prog b/modules/relocatable-prog index 8e22b20dd0..4d13fda63b 100644 --- a/modules/relocatable-prog +++ b/modules/relocatable-prog @@ -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