Bug 973176 - Move BSD workaround close to the option it's for. r=khuey
authorJan Beich <jbeich@tormail.org>
Wed, 26 Feb 2014 16:56:59 -0500
changeset 188038 e6950f359b60f3ca667ecc683f5f3fe1f7ae8e59
parent 188037 75b8e45e9beb630512d705cebb306c04896d631a
child 188039 ac9709133b272c4774dd7a483025f5f5a19c7761
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs973176
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 973176 - Move BSD workaround close to the option it's for. r=khuey
configure.in
toolkit/library/Makefile.in
--- a/configure.in
+++ b/configure.in
@@ -1302,16 +1302,23 @@ if test "$GNU_CC"; then
     DSO_LDOPTS='-shared'
     if test "$GCC_USE_GNU_LD"; then
         # Some tools like ASan use a runtime library that is only
         # linked against executables, so we must allow undefined
         # symbols for shared objects in some cases.
         if test -z "$MOZ_NO_WLZDEFS"; then
             # Don't allow undefined symbols in libraries
             DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
+
+            # BSDs need `environ' exposed for posix_spawn (bug 753046)
+            case "$OS_TARGET" in
+            DragonFly|FreeBSD|NetBSD|OpenBSD)
+                DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
+                ;;
+            esac
         fi
     fi
     WARNINGS_AS_ERRORS='-Werror'
     DSO_CFLAGS=''
     DSO_PIC_CFLAGS='-fPIC'
     ASFLAGS="$ASFLAGS -fPIC"
     AC_MSG_CHECKING([for --noexecstack option to as])
     _SAVE_CFLAGS=$CFLAGS
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -219,18 +219,16 @@ ifdef GNU_CC
 EXTRA_DSO_LDOPTS += -lelf
 else
 EXTRA_DSO_LDOPTS += -lelf -ldemangle
 endif
 endif
 
 ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-# keep `environ' unresolved, see bug 14426 for binutils
-EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 endif
 
 ifeq ($(OS_ARCH),FreeBSD)
 OS_LIBS += $(call EXPAND_LIBNAME,util)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet wbemuuid wintrust)