1 |
commit: 1b84859faa3792c2f3431945c48b07d25bc055cb |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 08:52:00 2016 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 08:52:00 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=1b84859f |
7 |
|
8 |
toolchain.eclass: add gcc 6 support |
9 |
|
10 |
eclass/toolchain.eclass | 33 ++++++++++++++++++++++++++++++++- |
11 |
1 file changed, 32 insertions(+), 1 deletion(-) |
12 |
|
13 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
14 |
index a272810..1192f62 100644 |
15 |
--- a/eclass/toolchain.eclass |
16 |
+++ b/eclass/toolchain.eclass |
17 |
@@ -153,7 +153,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then |
18 |
# the older versions, we don't want to bother supporting it. #448024 |
19 |
tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize ) |
20 |
tc_version_is_at_least 4.9 && IUSE+=" cilk" |
21 |
- tc_version_is_at_least 5.0 && IUSE+=" jit" |
22 |
+ tc_version_is_at_least 5.0 && IUSE+=" jit pch" |
23 |
tc_version_is_at_least 6.0 && IUSE+=" pie +ssp" |
24 |
fi |
25 |
|
26 |
@@ -626,6 +626,23 @@ do_gcc_PIE_patches() { |
27 |
|
28 |
# configure to build with the hardened GCC specs as the default |
29 |
make_gcc_hard() { |
30 |
+ |
31 |
+ # Gcc >= 6.X we don't need to sed in Makefile |
32 |
+ # It have configurations options to turn pie/ssp on as default |
33 |
+ if tc_version_is_at_least 6.0 ; then |
34 |
+ if use hardened ; then |
35 |
+ # rebrand to make bug reports easier |
36 |
+ BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} |
37 |
+ fi |
38 |
+ if use pie ; then |
39 |
+ einfo "Updating gcc to use automatic PIE building ..." |
40 |
+ fi |
41 |
+ if use ssp ; then |
42 |
+ einfo "Updating gcc to use automatic SSP building ..." |
43 |
+ fi |
44 |
+ return 1 |
45 |
+ fi |
46 |
+ |
47 |
# we want to be able to control the pie patch logic via something other |
48 |
# than ALL_CFLAGS... |
49 |
sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \ |
50 |
@@ -899,6 +916,11 @@ toolchain_src_configure() { |
51 |
confgcc+=( --enable-libstdcxx-time ) |
52 |
fi |
53 |
|
54 |
+ # Support to disable pch when building libstdcxx |
55 |
+ if tc_version_is_at_least 5.0 && ! use pch ; then |
56 |
+ confgcc+=( --disable-libstdcxx-pch ) |
57 |
+ fi |
58 |
+ |
59 |
# The jit language requires this. |
60 |
is_jit && confgcc+=( --enable-host-shared ) |
61 |
|
62 |
@@ -1915,6 +1937,11 @@ create_gcc_env_entry() { |
63 |
} |
64 |
|
65 |
copy_minispecs_gcc_specs() { |
66 |
+ # on gcc 6 we don't need minispecs |
67 |
+ if tc_version_is_at_least 6.0 ; then |
68 |
+ return 0 |
69 |
+ fi |
70 |
+ |
71 |
# setup the hardenedno* specs files and the vanilla specs file. |
72 |
if hardened_gcc_works ; then |
73 |
create_gcc_env_entry hardenednopiessp |
74 |
@@ -2263,6 +2290,10 @@ hardened_gcc_is_stable() { |
75 |
} |
76 |
|
77 |
want_minispecs() { |
78 |
+ # on gcc 6 we don't need minispecs |
79 |
+ if tc_version_is_at_least 6.0 ; then |
80 |
+ return 0 |
81 |
+ fi |
82 |
if tc_version_is_at_least 4.3.2 && use hardened ; then |
83 |
if ! want_pie ; then |
84 |
ewarn "PIE_VER or SPECS_VER is not defined in the GCC ebuild." |