gnustep / tools-make

The makefile package is a simple, powerful and extensible way to write makefiles for a GNUstep-based project.
https://www.gnustep.org/
GNU General Public License v3.0
29 stars 43 forks source link

Rewrite linker detection (GS_CHECK_ABI20_LINKER) #37

Closed hmelder closed 1 year ago

hmelder commented 1 year ago

See: #36

Instead of just printing the path for ld, we compile a small test program with the CFLAGS and LDFLAGS from configure and increased verbosity, and grep the linker output.

Configure script was rebuild using autoreconf -vi.

Demonstration:

LLD

./configure --with-layout=debian \
 --enable-native-objc-exceptions  \
--enable-objc-arc \
--prefix=/usr \
--with-runtime-abi=gnustep-2.0 \
--with-library-combo=ng-gnu-gnu \
LDFLAGS="-fuse-ld=lld -L/usr/lib/aarch64-linux-gnu" SHELLPROG=/bin/bash GNUMAKE=make
[...]
checking for runtime ABI... gnustep-2.0
checking which linker is being used... lld
checking whether the compiler supports native ObjC exceptions... yes
[...]

GNU Gold

./configure --with-layout=debian \
 --enable-native-objc-exceptions  \
--enable-objc-arc \
--prefix=/usr \
--with-runtime-abi=gnustep-2.0 \
--with-library-combo=ng-gnu-gnu \
LDFLAGS="-fuse-ld=gold -L/usr/lib/aarch64-linux-gnu" SHELLPROG=/bin/bash GNUMAKE=make
[...]
checking whether runtime library supports the gnustep-2.0 ABI... yes
checking for runtime ABI... gnustep-2.0
checking which linker is being used... GNU gold
checking whether the compiler supports native ObjC exceptions... yes
[...]

Otherwise

[...]
checking for runtime ABI... gnustep-2.0
checking which linker is being used... GNU ld
configure: WARNING: The detected linker (GNU ld) might not produce working Objective-C binaries using the gnustep-2.0 ABI. Consider using GNU gold or LLD.
checking whether the compiler supports native ObjC exceptions... yes
[...]