Bug 1367267 - Pass -fPIC when compiling the -pie configure test. r=gps, a=gchang
authorMike Hommey <mh@glandium.org>
Wed, 24 May 2017 09:24:09 +0900
changeset 585409 2b2e0bc442c77da9a2d19aeb6e72d679f7159668
parent 585408 5cb53dbde83a1471fe8a18c22f4339711ab22784
child 585410 a9c5f2fbb7fbdef723b6d954aef9c21456a718c7
push id61106
push userbmo:dkeeler@mozilla.com
push dateFri, 26 May 2017 21:26:31 +0000
reviewersgps, gchang
bugs1367267
milestone54.0
Bug 1367267 - Pass -fPIC when compiling the -pie configure test. r=gps, a=gchang
build/autoconf/compiler-opts.m4
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -266,17 +266,17 @@ fi
 MOZ_ARG_ENABLE_BOOL(pie,
 [  --enable-pie           Enable Position Independent Executables],
     MOZ_PIE=1,
     MOZ_PIE= )
 
 if test "$GNU_CC" -a -n "$MOZ_PIE"; then
     AC_MSG_CHECKING([for PIE support])
     _SAVE_LDFLAGS=$LDFLAGS
-    LDFLAGS="$LDFLAGS -pie"
+    LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS -pie"
     AC_TRY_LINK(,,AC_MSG_RESULT([yes])
                   [MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -pie"],
                   AC_MSG_RESULT([no])
                   AC_MSG_ERROR([--enable-pie requires PIE support from the linker.]))
     LDFLAGS=$_SAVE_LDFLAGS
 fi
 
 AC_SUBST(MOZ_PROGRAM_LDFLAGS)