Gentoo Archives: gentoo-commits

From: Alexandre Restovtsev <tetromino@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: net-libs/webkit-gtk/files/, net-libs/webkit-gtk/
Date: Sun, 04 Mar 2012 21:11:24
Message-Id: 1330895124.283cead650ab41ccdf2ec0a12ffe3c90b5e0bd76.tetromino@gentoo
1 commit: 283cead650ab41ccdf2ec0a12ffe3c90b5e0bd76
2 Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 4 20:59:14 2012 +0000
4 Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
5 CommitDate: Sun Mar 4 21:05:24 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=283cead6
7
8 net-libs/webkit-gtk: fix build-time segfaults with USE="introspection jit" (bug #404215)
9
10 Fix build problems on PaX with USE="introspection jit" (bug #404215,
11 thanks to Grant and Magnus Granberg) by having g-ir-scanner call a
12 libtool wrapper that disables secure memory protection on generated gir
13 dumper binaries.
14
15 ---
16 net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper | 33 ++++++++++++++++++++
17 .../webkit-gtk-1.6.3-paxctl-introspection.patch | 21 ++++++++++++
18 net-libs/webkit-gtk/webkit-gtk-1.7.90-r200.ebuild | 4 ++
19 net-libs/webkit-gtk/webkit-gtk-1.7.90-r300.ebuild | 4 ++
20 4 files changed, 62 insertions(+), 0 deletions(-)
21
22 diff --git a/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper
23 new file mode 100755
24 index 0000000..b80b6bb
25 --- /dev/null
26 +++ b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper
27 @@ -0,0 +1,33 @@
28 +#!/bin/sh
29 +# Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary
30 +# generated by g-ir-scanner.
31 +# PaX marking code stolen from pax-utils.eclass
32 +
33 +flags=$1; shift
34 +
35 +echo ${LIBTOOL} "$@"
36 +${LIBTOOL} "$@"
37 +
38 +retval=$?
39 +
40 +files=$(find . -path "*tmp-introspect*/.libs/*")
41 +
42 +if type -p paxctl > /dev/null; then
43 + echo "PT PaX marking -${flags} ${files}"
44 + for f in ${files}; do
45 + # First, try modifying the existing PAX_FLAGS header
46 + paxctl -q${flags} "${f}" && continue
47 + # Second, try stealing the (unused under PaX) PT_GNU_STACK header
48 + paxctl -qc${flags} "${f}" && continue
49 + # Third, try pulling the base down a page, to create space and
50 + # insert a PT_GNU_STACK header (works on ET_EXEC)
51 + paxctl -qC${flags} "${f}" && continue
52 + done
53 +elif type -p scanelf > /dev/null; then
54 + # Try scanelf, the Gentoo swiss-army knife ELF utility
55 + # Currently this sets PT if it can, no option to control what it does.
56 + echo "Fallback PaX marking -${flags} ${files}"
57 + scanelf -Xxz ${flags} ${files}
58 +fi
59 +
60 +exit ${retval}
61
62 diff --git a/net-libs/webkit-gtk/files/webkit-gtk-1.6.3-paxctl-introspection.patch b/net-libs/webkit-gtk/files/webkit-gtk-1.6.3-paxctl-introspection.patch
63 new file mode 100644
64 index 0000000..c34cc40
65 --- /dev/null
66 +++ b/net-libs/webkit-gtk/files/webkit-gtk-1.6.3-paxctl-introspection.patch
67 @@ -0,0 +1,21 @@
68 +diff -ru a/Source/WebKit/gtk/GNUmakefile.am b/Source/WebKit/gtk/GNUmakefile.am
69 +--- a/Source/WebKit/gtk/GNUmakefile.am
70 ++++ b/Source/WebKit/gtk/GNUmakefile.am
71 +@@ -269,7 +269,7 @@
72 + WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir
73 +
74 + $(WEBKIT_GIRSOURCES): $(G_IR_SCANNER) $(JSCORE_GIRSOURCES) libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
75 +- $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \
76 ++ $(AM_V_GEN)LIBTOOL="$(LIBTOOL)" $(G_IR_SCANNER) -v --warn-all \
77 + --symbol-prefix=webkit \
78 + --identifier-prefix=WebKit \
79 + --namespace=WebKit \
80 +@@ -280,7 +280,7 @@
81 + --include=Soup-2.4 \
82 + --library=webkitgtk-@WEBKITGTK_API_VERSION@ \
83 + --library=javascriptcoregtk-@WEBKITGTK_API_VERSION@ \
84 +- --libtool="$(LIBTOOL)" \
85 ++ --libtool="bash $(top_srcdir)/gir-paxctl-lt-wrapper m" \
86 + --pkg=gobject-2.0 \
87 + --pkg=gtk+-@GTK_API_VERSION@ \
88 + --pkg=libsoup-2.4 \
89
90 diff --git a/net-libs/webkit-gtk/webkit-gtk-1.7.90-r200.ebuild b/net-libs/webkit-gtk/webkit-gtk-1.7.90-r200.ebuild
91 index bc59f8d..f29db1e 100644
92 --- a/net-libs/webkit-gtk/webkit-gtk-1.7.90-r200.ebuild
93 +++ b/net-libs/webkit-gtk/webkit-gtk-1.7.90-r200.ebuild
94 @@ -92,6 +92,10 @@ src_prepare() {
95 # Don't force -O2
96 sed -i 's/-O2//g' "${S}"/configure.ac || die
97
98 + # Build-time segfaults under PaX with USE="introspection jit", bug #404215
99 + epatch "${FILESDIR}/${PN}-1.6.3-paxctl-introspection.patch"
100 + cp "${FILESDIR}/gir-paxctl-lt-wrapper" "${S}/" || die
101 +
102 # We need to reset some variables to prevent permissions problems and failures
103 # like https://bugs.webkit.org/show_bug.cgi?id=35471 and bug #323669
104 gnome2_environment_reset
105
106 diff --git a/net-libs/webkit-gtk/webkit-gtk-1.7.90-r300.ebuild b/net-libs/webkit-gtk/webkit-gtk-1.7.90-r300.ebuild
107 index 6a740d7..2d56cb9 100644
108 --- a/net-libs/webkit-gtk/webkit-gtk-1.7.90-r300.ebuild
109 +++ b/net-libs/webkit-gtk/webkit-gtk-1.7.90-r300.ebuild
110 @@ -94,6 +94,10 @@ src_prepare() {
111 # Don't force -O2
112 sed -i 's/-O2//g' "${S}"/configure.ac || die
113
114 + # Build-time segfaults under PaX with USE="introspection jit", bug #404215
115 + epatch "${FILESDIR}/${PN}-1.6.3-paxctl-introspection.patch"
116 + cp "${FILESDIR}/gir-paxctl-lt-wrapper" "${S}/" || die
117 +
118 # We need to reset some variables to prevent permissions problems and failures
119 # like https://bugs.webkit.org/show_bug.cgi?id=35471 and bug #323669
120 gnome2_environment_reset