Bug 1367267 - Pass -fPIC when compiling the -pie configure test. r?gps
--- 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)