1 |
commit: 307f357e8b9ad53abb505b29536788d4a507ccb5 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 1 06:52:37 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 1 19:54:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=307f357e |
7 |
|
8 |
mozcoreconf-v6.eclass: don't force -mminimal-toc on ppc64 |
9 |
|
10 |
This is a really old flag which was needed to compile with |
11 |
GCC <4.6 |
12 |
|
13 |
I've traced down the existence of this flag here up to |
14 |
commit 5980a31194da3376ea9dcf804139a2999199508c |
15 |
Author: Raúl Porcel <armin76 <AT> gentoo.org> |
16 |
Date: Sat Mar 15 18:09:25 2008 +0000 |
17 |
Add eclasses for mozilla-firefox-3 and xulrunner-1.9 |
18 |
|
19 |
probably it also was in earlier eclasses. |
20 |
it was there to fix this kind of bugs: https://bugs.gentoo.org/241900 |
21 |
|
22 |
Problem WAS that on ppc64 .toc1 section could be at most 64KB in size |
23 |
It's true on GCC versions prior to 4.6 or if mminimal-toc passed on modern gcc |
24 |
|
25 |
However, since GCC4.6[1] they implemented 3 new TOC models |
26 |
|
27 |
-mcmodel=small |
28 |
uses 16-bit toc offsets, ie. what we had before. |
29 |
|
30 |
-mcmodel=medium [ the new default ] |
31 |
uses 32-bit toc offsets and addresses static data, string constants |
32 |
etc. relative to the toc pointer. Limits data to around 2G. |
33 |
|
34 |
-mcmodel=large |
35 |
uses 32-bit toc offsets, no limit on static data. |
36 |
|
37 |
By passing -mminimal-toc on modern GCC we force -mcmodel=small |
38 |
it means The TOC is limited to 64k. |
39 |
|
40 |
The default for gcc currently is -mcmodel=medium, with it TOC static |
41 |
data may grow up to 4G |
42 |
|
43 |
But here's the problem: |
44 |
current mozilla builds (thunderbird and firefox) force -O3 optimization |
45 |
by default, making it very easy to overflow TOC section |
46 |
|
47 |
{standard input}:1344252: Error: operand out of range \ |
48 |
(0x00000000000178b8 is not between 0xffffffffffff8000 and 0x0000000000007ffc) |
49 |
|
50 |
Passing -O3 is THE DEFAULT configuration, unless |
51 |
USE=custom-optimization is set, which voids the warranty =) |
52 |
|
53 |
So I propose removing this flag from eclass and building with default |
54 |
model on modern toolchain. Quite unlikely someone tries to build FF/TB |
55 |
using gcc-4.5, and if they do - they have other problems to solve. |
56 |
|
57 |
[1] https://gcc.gnu.org/ml/gcc-patches/2010-06/msg00747.html |
58 |
|
59 |
Acked-by: Jory Pratt <anarchy <AT> gentoo.org> |
60 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
61 |
|
62 |
eclass/mozcoreconf-v6.eclass | 2 +- |
63 |
1 file changed, 1 insertion(+), 1 deletion(-) |
64 |
|
65 |
diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass |
66 |
index df08dd19af6..2789e6046b9 100644 |
67 |
--- a/eclass/mozcoreconf-v6.eclass |
68 |
+++ b/eclass/mozcoreconf-v6.eclass |
69 |
@@ -229,7 +229,7 @@ mozconfig_init() { |
70 |
append-flags -fPIC |
71 |
;; |
72 |
ppc64) |
73 |
- append-flags -fPIC -mminimal-toc |
74 |
+ append-flags -fPIC |
75 |
# Reduce the memory requirements for linking |
76 |
if use clang ; then |
77 |
# Nothing to do |