[bug #68146] build.sh: segfault on macOS when $(wildcard) matches files
anonymous <[email protected]> Wed, 11 Mar 2026 19:49:44 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <[email protected]> |
--8323329-846930886-1773272984=:4162299 Content-Type: TEXT/plain; CHARSET=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-Disposition: inline Follow-up Comment #1, bug #68146 (group make):=0A=0ACorrection: my initial = report stated that versions 4.3 and 4.4 are not=0A affected. That was inco= rrect =E2=80=94 I tested those versions with the system=0A compiler (Apple= Clang) directly, which happens to resolve glob from=0A libgnu.a first due= to link order. Sorry for the confusion.=0A=0A The issue is not a regressi= on between 4.4 and 4.4.1. All versions have=0A the same fragile linking in= build.sh: glob() from libgnu.a is a static=0A archive symbol, so it only = gets pulled in if glob is still undefined at=0A the point -lgnu is process= ed. If any library linked before -lgnu pulls=0A in libSystem's glob() firs= t (e.g. additional frameworks or libraries=0A injected by a build system's= C++ toolchain), the system glob wins and=0A causes a segfault due to ABI = mismatch.=0A=0A The fix in the attached patch (-Wl,-force_load,libgnu.a on= macOS) is=0A still correct =E2=80=94 it makes the link robust regardless = of what other=0A libraries are present.=0A=0A =E2=80=94 Alexander Bayandi= n=0A=0A=0A _______________________________________________________=0A=0A= Reply to this item at:=0A=0A <https://savannah.gnu.org/bugs/?68146>=0A=0A_= ______________________________________________=0AMessage sent via Savannah= =0Ahttps://savannah.gnu.org/=0A --8323329-846930886-1773272984=:4162299 Content-Type: APPLICATION/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCabH/mAAKCRCqLAuaBUf3 ToJyAQD6Xy9jEztsS5Q7QS/3nfX88GuNI4/mTKMc3EPyEy5sKgD+L7lt3p8Blako PmGO1un83s5VS1iDygQLw4M3SqzdEQc= =5CK1 -----END PGP SIGNATURE----- --8323329-846930886-1773272984=:4162299--