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 396407 2b2e0bc442c77da9a2d19aeb6e72d679f7159668
parent 396406 5cb53dbde83a1471fe8a18c22f4339711ab22784
child 396408 a9c5f2fbb7fbdef723b6d954aef9c21456a718c7
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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)