Bug 1367267 - Pass -fPIC when compiling the -pie configure test. r?gps draft
authorMike Hommey <mh@glandium.org>
Wed, 24 May 2017 09:24:09 +0900
changeset 583379 63e5810f8bee7857904b7a4818ca18463b4cbb57
parent 582695 795b9715ed9d2d28702b60922dc641fcd452678b
child 630043 cf146f3eb0af8cdc4bc2cf145f6a83e35213a195
push id60380
push userbmo:mh+mozilla@glandium.org
push dateWed, 24 May 2017 00:35:00 +0000
reviewersgps
bugs1367267
milestone55.0a1
Bug 1367267 - Pass -fPIC when compiling the -pie configure test. r?gps
build/autoconf/compiler-opts.m4
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -262,17 +262,17 @@ fi
 MOZ_ARG_ENABLE_BOOL(pie,
 [  --enable-pie           Enable Position Independent Executables],
     MOZ_PIE=1,
     MOZ_PIE= )
 
 if test "$GNU_CC$CLANG_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)