summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory A. Pratt <anarchy@gentoo.org>2017-01-29 21:01:01 -0600
committerJory A. Pratt <anarchy@gentoo.org>2017-01-29 21:01:01 -0600
commit50a543bdfe736ec8faa708c93471e1e31ef1e8eb (patch)
tree2ab56c49ea68c17cb285cdd17a9dc0e238c649ed /www-client
parentdev-db/mariadb: Version bump for 10.1.21 (diff)
downloadgentoo-50a543bdfe736ec8faa708c93471e1e31ef1e8eb.tar.gz
gentoo-50a543bdfe736ec8faa708c93471e1e31ef1e8eb.tar.bz2
gentoo-50a543bdfe736ec8faa708c93471e1e31ef1e8eb.zip
www-client/firefox: Fix pie detection on hardened toolchain, bug #607350
Diffstat (limited to 'www-client')
-rw-r--r--www-client/firefox/files/fix_hardened_pie_detection.patch36
-rw-r--r--www-client/firefox/firefox-51.0.ebuild3
2 files changed, 38 insertions, 1 deletions
diff --git a/www-client/firefox/files/fix_hardened_pie_detection.patch b/www-client/firefox/files/fix_hardened_pie_detection.patch
new file mode 100644
index 000000000000..7cc74cd1eb72
--- /dev/null
+++ b/www-client/firefox/files/fix_hardened_pie_detection.patch
@@ -0,0 +1,36 @@
+From: Jory A. Pratt <anarchy@gentoo.org>
+
+CFLAGS must contain -fPIC when checking the linker
+
+https://bugs.gentoo.org/show_bug.cgi?id=607350
+
+diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
+--- a/build/autoconf/compiler-opts.m4
++++ b/build/autoconf/compiler-opts.m4
+@@ -263,23 +263,26 @@ 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_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS -fPIC"
+ _SAVE_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -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
++ CFLAGS=$_SAVE_CFLAGS
+ fi
+
+ AC_SUBST(MOZ_PROGRAM_LDFLAGS)
+
+ dnl ASan assumes no symbols are being interposed, and when that happens,
+ dnl it's not happy with it. Unconveniently, since Firefox is exporting
+ dnl libffi symbols and Gtk+3 pulls system libffi via libwayland-client,
+ dnl system libffi interposes libffi symbols that ASan assumes are in
diff --git a/www-client/firefox/firefox-51.0.ebuild b/www-client/firefox/firefox-51.0.ebuild
index f1f2b1c9674f..579ef6ecd65a 100644
--- a/www-client/firefox/firefox-51.0.ebuild
+++ b/www-client/firefox/firefox-51.0.ebuild
@@ -127,7 +127,8 @@ src_unpack() {
src_prepare() {
# Apply our patches
- eapply "${WORKDIR}/firefox"
+ eapply "${WORKDIR}/firefox" \
+ "${FILESDIR}"/fix_hardened_pie_detection.patch
# Enable gnomebreakpad
if use debug ; then