1 |
commit: 10a57644d5a354baac5d1018fe2dbb34342a14fd |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 31 07:56:56 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 31 07:57:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10a57644 |
7 |
|
8 |
dev-libs/gmp: add USE=pic for static libraries, bug #707332 |
9 |
|
10 |
gmp makes a decision to use PIC or non-PIC assemply at |
11 |
./configure time instead of (typical) build time. |
12 |
|
13 |
On top of that non-PIC assembly also has TEXTRELs in it |
14 |
which musl can't handle and crashes binaries at relocation |
15 |
setup time. For gmp is it relevant only for static linking. |
16 |
|
17 |
The change adds USE=pic to force static libraries to generate |
18 |
assembly code without TEXTRELs. |
19 |
|
20 |
Reported-by: Andrew Aladjev |
21 |
Closes: https://bugs.gentoo.org/707332 |
22 |
Package-Manager: Portage-2.3.86, Repoman-2.3.20 |
23 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
24 |
|
25 |
dev-libs/gmp/gmp-6.1.2-r1.ebuild | 7 +++++-- |
26 |
dev-libs/gmp/gmp-6.1.2.ebuild | 7 +++++-- |
27 |
dev-libs/gmp/gmp-6.2.0-r1.ebuild | 5 ++++- |
28 |
dev-libs/gmp/gmp-6.2.0.ebuild | 5 ++++- |
29 |
dev-libs/gmp/metadata.xml | 1 + |
30 |
5 files changed, 19 insertions(+), 6 deletions(-) |
31 |
|
32 |
diff --git a/dev-libs/gmp/gmp-6.1.2-r1.ebuild b/dev-libs/gmp/gmp-6.1.2-r1.ebuild |
33 |
index ba741c4f37d..31bf8c0b5eb 100644 |
34 |
--- a/dev-libs/gmp/gmp-6.1.2-r1.ebuild |
35 |
+++ b/dev-libs/gmp/gmp-6.1.2-r1.ebuild |
36 |
@@ -1,4 +1,4 @@ |
37 |
-# Copyright 1999-2019 Gentoo Authors |
38 |
+# Copyright 1999-2020 Gentoo Authors |
39 |
# Distributed under the terms of the GNU General Public License v2 |
40 |
|
41 |
EAPI=6 |
42 |
@@ -19,7 +19,7 @@ LICENSE="|| ( LGPL-3+ GPL-2+ )" |
43 |
# The subslot reflects the C & C++ SONAMEs. |
44 |
SLOT="0/10.4" |
45 |
KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
46 |
-IUSE="+asm doc cxx static-libs" |
47 |
+IUSE="+asm doc cxx pic static-libs" |
48 |
|
49 |
DEPEND="sys-devel/m4 |
50 |
app-arch/xz-utils" |
51 |
@@ -77,12 +77,15 @@ multilib_src_configure() { |
52 |
filter-flags -O? |
53 |
fi |
54 |
|
55 |
+ # --with-pic forces static libraries to be built as PIC |
56 |
+ # and without TEXTRELs. musl does not support TEXTRELs: bug #707332 |
57 |
tc-export CC |
58 |
ECONF_SOURCE="${S}" econf \ |
59 |
--localstatedir="${EPREFIX}"/var/state/gmp \ |
60 |
--enable-shared \ |
61 |
$(use_enable asm assembly) \ |
62 |
$(use_enable cxx) \ |
63 |
+ $(use pic && echo --with-pic) \ |
64 |
$(use_enable static-libs static) |
65 |
} |
66 |
|
67 |
|
68 |
diff --git a/dev-libs/gmp/gmp-6.1.2.ebuild b/dev-libs/gmp/gmp-6.1.2.ebuild |
69 |
index d7e8b5b45d4..38497f189d2 100644 |
70 |
--- a/dev-libs/gmp/gmp-6.1.2.ebuild |
71 |
+++ b/dev-libs/gmp/gmp-6.1.2.ebuild |
72 |
@@ -1,4 +1,4 @@ |
73 |
-# Copyright 1999-2019 Gentoo Authors |
74 |
+# Copyright 1999-2020 Gentoo Authors |
75 |
# Distributed under the terms of the GNU General Public License v2 |
76 |
|
77 |
EAPI="5" |
78 |
@@ -19,7 +19,7 @@ LICENSE="|| ( LGPL-3+ GPL-2+ )" |
79 |
# The subslot reflects the C & C++ SONAMEs. |
80 |
SLOT="0/10.4" |
81 |
KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
82 |
-IUSE="+asm doc cxx static-libs" |
83 |
+IUSE="+asm doc cxx pic static-libs" |
84 |
|
85 |
DEPEND="sys-devel/m4 |
86 |
app-arch/xz-utils" |
87 |
@@ -76,12 +76,15 @@ multilib_src_configure() { |
88 |
filter-flags -O? |
89 |
fi |
90 |
|
91 |
+ # --with-pic forces static libraries to be built as PIC |
92 |
+ # and without TEXTRELs. musl does not support TEXTRELs: bug #707332 |
93 |
tc-export CC |
94 |
ECONF_SOURCE="${S}" econf \ |
95 |
--localstatedir="${EPREFIX}"/var/state/gmp \ |
96 |
--enable-shared \ |
97 |
$(use_enable asm assembly) \ |
98 |
$(use_enable cxx) \ |
99 |
+ $(use pic && echo --with-pic) \ |
100 |
$(use_enable static-libs static) |
101 |
} |
102 |
|
103 |
|
104 |
diff --git a/dev-libs/gmp/gmp-6.2.0-r1.ebuild b/dev-libs/gmp/gmp-6.2.0-r1.ebuild |
105 |
index b5347356b32..d5fd3a7c0fa 100644 |
106 |
--- a/dev-libs/gmp/gmp-6.2.0-r1.ebuild |
107 |
+++ b/dev-libs/gmp/gmp-6.2.0-r1.ebuild |
108 |
@@ -19,7 +19,7 @@ LICENSE="|| ( LGPL-3+ GPL-2+ )" |
109 |
# The subslot reflects the C & C++ SONAMEs. |
110 |
SLOT="0/10.4" |
111 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
112 |
-IUSE="+asm doc cxx static-libs" |
113 |
+IUSE="+asm doc cxx pic static-libs" |
114 |
|
115 |
DEPEND="sys-devel/m4 |
116 |
app-arch/xz-utils" |
117 |
@@ -77,12 +77,15 @@ multilib_src_configure() { |
118 |
filter-flags -O? |
119 |
fi |
120 |
|
121 |
+ # --with-pic forces static libraries to be built as PIC |
122 |
+ # and without TEXTRELs. musl does not support TEXTRELs: bug #707332 |
123 |
tc-export CC |
124 |
ECONF_SOURCE="${S}" econf \ |
125 |
--localstatedir="${EPREFIX}"/var/state/gmp \ |
126 |
--enable-shared \ |
127 |
$(use_enable asm assembly) \ |
128 |
$(use_enable cxx) \ |
129 |
+ $(use pic && echo --with-pic) \ |
130 |
$(use_enable static-libs static) |
131 |
} |
132 |
|
133 |
|
134 |
diff --git a/dev-libs/gmp/gmp-6.2.0.ebuild b/dev-libs/gmp/gmp-6.2.0.ebuild |
135 |
index c5495e13aef..e49ac021edd 100644 |
136 |
--- a/dev-libs/gmp/gmp-6.2.0.ebuild |
137 |
+++ b/dev-libs/gmp/gmp-6.2.0.ebuild |
138 |
@@ -19,7 +19,7 @@ LICENSE="|| ( LGPL-3+ GPL-2+ )" |
139 |
# The subslot reflects the C & C++ SONAMEs. |
140 |
SLOT="0/10.4" |
141 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
142 |
-IUSE="+asm doc cxx static-libs" |
143 |
+IUSE="+asm doc cxx pic static-libs" |
144 |
|
145 |
DEPEND="sys-devel/m4 |
146 |
app-arch/xz-utils" |
147 |
@@ -77,12 +77,15 @@ multilib_src_configure() { |
148 |
filter-flags -O? |
149 |
fi |
150 |
|
151 |
+ # --with-pic forces static libraries to be built as PIC |
152 |
+ # and without TEXTRELs. musl does not support TEXTRELs: bug #707332 |
153 |
tc-export CC |
154 |
ECONF_SOURCE="${S}" econf \ |
155 |
--localstatedir="${EPREFIX}"/var/state/gmp \ |
156 |
--enable-shared \ |
157 |
$(use_enable asm assembly) \ |
158 |
$(use_enable cxx) \ |
159 |
+ $(use pic && echo --with-pic) \ |
160 |
$(use_enable static-libs static) |
161 |
} |
162 |
|
163 |
|
164 |
diff --git a/dev-libs/gmp/metadata.xml b/dev-libs/gmp/metadata.xml |
165 |
index 84e19205350..2b4236a14c6 100644 |
166 |
--- a/dev-libs/gmp/metadata.xml |
167 |
+++ b/dev-libs/gmp/metadata.xml |
168 |
@@ -7,6 +7,7 @@ |
169 |
</maintainer> |
170 |
<use> |
171 |
<flag name="asm">Enable use of hand optimized assembly routines (faster execution)</flag> |
172 |
+ <flag name="pic">Force static libraries to be built as PIC to avoid TEXTRELs.</flag> |
173 |
</use> |
174 |
<upstream> |
175 |
<remote-id type="cpe">cpe:/a:gmplib:gmp</remote-id> |