[patch #10469] Add support for 32-bit mode on FreeBSD/powerpc64
Bruno Haible <[email protected]> Sat, 24 Aug 2024 08:12:59 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.libtool.patches |
|---|---|
| Message-ID | <[email protected]> |
--8323329-4706545-1724501579=:667853
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
URL:=0A <https://savannah.gnu.org/patch/?10469>=0A=0A Summ=
ary: Add support for 32-bit mode on FreeBSD/powerpc64=0A =
Group: GNU Libtool=0A Submitter: haible=0A Subm=
itted: Sat 24 Aug 2024 02:12:56 PM CEST=0A Category: None=0A=
Priority: 5 - Normal=0A Status: None=0A =
Privacy: Public=0A Assigned to: None=0A Or=
iginator Email: =0A Open/Closed: Open=0A Discussion Loc=
k: Any=0A=0A=0A _______________________________________________________=
=0A=0AFollow-up Comments:=0A=0A=0A-----------------------------------------=
--------------=0ADate: Sat 24 Aug 2024 02:12:56 PM CEST By: Bruno Haible <h=
aible>=0AFreeBSD 14 has two PowerPC64 ports:=0A* A little-endian one (power=
pc64le),=0A* a big-endian one (powerpc64).=0A=0AThe latter is a bi-arch sys=
tem: While "cc" creates 64-bit binaries, "cc -m32"=0Acreates 32-bit binarie=
s. 32-bit executables have /libexec/ld-elf32.so.1 as=0Adynamic loader.=0A=
=0AIn GNU libunistring, the unit tests in the build tree are libtool wrappe=
r=0Ascripts. In 32-bit mode, they all fail:=0A=0A=0A$ ./test-accept=0Ald-el=
f32.so.1: Shared object "libunistring.so.5" not found, required by=0A"test-=
accept"=0A=0A=0AThe library was built correctly in the build tree:=0A=0A=0A=
$ ls -lL /home/bruno/libunistring-1.2/build-32/lib/.libs/libunistring.so.5=
=0A-rwxr-xr-x 1 bruno bruno 3347152 Aug 24 04:25=0A/home/bruno/libunistrin=
g-1.2/build-32/lib/.libs/libunistring.so.5=0A=0A=0AThe problem is that the =
wrapper script uses the variable 'LD_LIBRARY_PATH':=0A=0A=0A$ grep LIBRARY_=
PATH test-accept=0A # Add our own library path to LD_LIBRARY_PATH=0A =
=0ALD_LIBRARY_PATH=3D"/home/bruno/libunistring-1.2/build-32/lib/.libs:$LD_L=
IBRARY_PATH"=0A # Some systems cannot cope with colon-terminated LD_LIBR=
ARY_PATH=0A LD_LIBRARY_PATH=3D`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed '=
s/::*$//'`=0A export LD_LIBRARY_PATH=0A=0A=0AAnd indeed, LD_LIBRARY_PATH=
seems to be ignored here:=0A=0A=0A$ LD_LIBRARY_PATH=3D/home/bruno/libunist=
ring-1.2/build-32/lib/.libs=0A.libs/test-accept=0Ald-elf32.so.1: Shared obj=
ect "libunistring.so.5" not found, required by=0A"test-accept"=0A=0A=0AThe =
documentation <https://man.freebsd.org/cgi/man.cgi?query=3Dld.so> says:=0A =
"On 64-bit architectures, the linker for 32-bit objects recognizes all the=
=0Aenvironment variables listed below, but is being prefixed with LD_32_,=
=09for=0Aexample: LD_32_TRACE_LOADED_OBJECTS."=0A=0ASo, let's try LD_32_LIB=
RARY_PATH instead:=0A=0A=0A$ LD_32_LIBRARY_PATH=3D/home/bruno/libunistring-=
1.2/build-32/lib/.libs=0A.libs/test-accept=0A(works)=0A=0A=0AOr like this:=
=0A=0A=0A$ sed -i -e 's/LD_LIBRARY_PATH/LD_32_LIBRARY_PATH/g' test-accept=
=0A$ ./test-accept=0A(works)=0A=0A=0AThe fix is, of course, to change the v=
alue of shlibpath_var in the generated=0A'libtool' script.=0A=0ANote: The l=
t_cv_* values in config.cache are the same for the 32-bit build as=0Afor th=
e 64-bit build:=0A=0A=0A$ diff build-64/config.cache build-32/config.cache =
=0A23c23=0A< ac_cv_env_CC_value=3D'cc -ferror-limit=3D0'=0A---=0A> ac_cv_en=
v_CC_value=3D'cc -m32 -ferror-limit=3D0'=0A...=0A407,408c402,403=0A< gl_cv_=
header_working_stdint_h=3D${gl_cv_header_working_stdint_h=3Dno}=0A< gl_cv_h=
ost_cpu_c_abi_32bit=3D${gl_cv_host_cpu_c_abi_32bit=3Dno}=0A---=0A> gl_cv_he=
ader_working_stdint_h=3D${gl_cv_header_working_stdint_h=3Dyes}=0A> gl_cv_ho=
st_cpu_c_abi_32bit=3D${gl_cv_host_cpu_c_abi_32bit=3Dyes}=0A...=0A=0A=0AFind=
attached:=0A* freebsd-biarch.diff: a patch relative to libtool-2.4.7.=0A* =
0001-Fix-libtool-wrapper-programs-in-32-bit-mode-on-FreeB.patch: a commit=
=0Afor libtool 'master'.=0A=0A=0A=0A=0A=0A=0A=0A _______________________=
________________________________=0AFile Attachments:=0A=0A=0A--------------=
-----------------------------------------=0AName: freebsd-biarch.diff Size=
: 761B=0A<https://file.savannah.gnu.org/file/freebsd-biarch.diff?file_id=3D=
56379>=0A-------------------------------------------------------=0AName: 00=
01-Fix-libtool-wrapper-programs-in-32-bit-mode-on-FreeB.patch Size:=0A1KiB=
=0A<https://file.savannah.gnu.org/file/0001-Fix-libtool-wrapper-programs-in=
-32-bit-mode-on-FreeB.patch?file_id=3D56380>=0A=0A AGPL NOTICE=0A=0AThes=
e attachments are served by Savane. You can download the corresponding=0Aso=
urce code of Savane at=0Ahttps://git.savannah.nongnu.org/cgit/administratio=
n/savane.git/snapshot/savane-d29f54e45b7d24f2f4db4b8f43b4a13267e27d3b.tar.g=
z=0A=0A _______________________________________________________=0A=0ARep=
ly to this item at:=0A=0A <https://savannah.gnu.org/patch/?10469>=0A=0A___=
____________________________________________=0AMessage sent via Savannah=0A=
https://savannah.gnu.org/=0A
--8323329-4706545-1724501579=:667853
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHQEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZsnOSwAKCRCqLAuaBUf3
TvbsAP9jkA69JplbOwZsNfieN2ycHn/iMrj4v8cd8+IZb7OnDgD2K0c0ODFu0PlT
MEaDy5M+eVe2Jb5AnG7i6iIqq7O8Bw==
=tA1d
-----END PGP SIGNATURE-----
--8323329-4706545-1724501579=:667853--