Since Mac OS X 10.1, Mach-O object files are by default built with a
so-called two-level namespace which prevents symbol lookups in BIND unit
tests that attempt to override the implementations of certain library
functions from working as intended. This feature can be disabled by
passing the "-flat_namespace" flag to the linker. Fix unit tests
affected by this issue on macOS by adding "-flat_namespace" to LDFLAGS
used for building all object files on that operating system (it is not
enough to only set that flag for the unit test executables).
fi
;; #(
+ *-darwin*) :
+ LDFLAGS="$LDFLAGS -Wl,-flat_namespace" ;; #(
*) :
;;
esac
[LDFLAGS="$LDFLAGS -zrelax=transtls"
AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
])
- ])
+ ],
+ [*-darwin*],[LDFLAGS="$LDFLAGS -Wl,-flat_namespace"])
#
# CCNOOPT defaults to -O0 on gcc and disables optimization when is last