]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
force link errors on OSX for unknown symbols
authorAlan T. DeKok <aland@freeradius.org>
Wed, 18 Aug 2021 15:51:35 +0000 (11:51 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 18 Aug 2021 15:54:48 +0000 (11:54 -0400)
When linking binaries.  So that we get errors at compile time,
and not at run-time, or even later in CI tests.

scripts/boiler.mk

index 1dc69fcced1db4498c4da44bbc9afca39e1455c1..2e500dc51b1c3e2b4b2824937249702d339e220e 100644 (file)
@@ -446,6 +446,14 @@ define INCLUDE_SUBMAKEFILE
         # has to be linked to both libfoo.a and -lbar.
        ifeq "$${$${TGT}_SUFFIX}" ".exe"
                $${TGT}_LDLIBS += $$(filter-out %.a %.so %.la,$${$${TGT_PREREQS}_LDLIBS})
+
+               #
+               #  OSX does lazy linking by default.  We want to over-ride that for binaries.
+               #  That way we catch errors at compile time, and not at run time.
+               #
+               ifneq "$(findstring apple-darwin,$(TARGET_SYSTEM))" ""
+                       $${TGT}_LDFLAGS += -Wl,-undefined -Wl,error
+               endif
        endif
 
         $${TGT}_BUILD := $$(if $$(suffix $${TGT}),$${BUILD_DIR}/lib,$${BUILD_DIR}/bin)