1 |
commit: dc95bdeba8feeaefea57bc1c81f5473415616e1a |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 19 21:36:18 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 19 23:28:59 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc95bdeb |
7 |
|
8 |
sys-devel/gcc: add support for USE=jit #568834 |
9 |
|
10 |
eclass/toolchain.eclass | 10 ++++++++++ |
11 |
sys-devel/gcc/metadata.xml | 2 ++ |
12 |
2 files changed, 12 insertions(+) |
13 |
|
14 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
15 |
index 43fa8bf..b18d418 100644 |
16 |
--- a/eclass/toolchain.eclass |
17 |
+++ b/eclass/toolchain.eclass |
18 |
@@ -152,6 +152,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then |
19 |
# the older versions, we don't want to bother supporting it. #448024 |
20 |
tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize ) |
21 |
tc_version_is_at_least 4.9 && IUSE+=" cilk" |
22 |
+ tc_version_is_at_least 5.0 && IUSE+=" jit" |
23 |
tc_version_is_at_least 6.0 && IUSE+=" pie +ssp" |
24 |
fi |
25 |
|
26 |
@@ -841,6 +842,7 @@ toolchain_src_configure() { |
27 |
is_d && GCC_LANG+=",d" |
28 |
is_gcj && GCC_LANG+=",java" |
29 |
is_go && GCC_LANG+=",go" |
30 |
+ is_jit && GCC_LANG+=",jit" |
31 |
if is_objc || is_objcxx ; then |
32 |
GCC_LANG+=",objc" |
33 |
if tc_version_is_at_least 4 ; then |
34 |
@@ -904,6 +906,9 @@ toolchain_src_configure() { |
35 |
confgcc+=( --enable-libstdcxx-time ) |
36 |
fi |
37 |
|
38 |
+ # The jit language requires this. |
39 |
+ is_jit && confgcc+=( --enable-host-shared ) |
40 |
+ |
41 |
# # Turn on the -Wl,--build-id flag by default for ELF targets. #525942 |
42 |
# # This helps with locating debug files. |
43 |
# case ${CTARGET} in |
44 |
@@ -2155,6 +2160,11 @@ is_go() { |
45 |
use cxx && use_if_iuse go |
46 |
} |
47 |
|
48 |
+is_jit() { |
49 |
+ gcc-lang-supported jit || return 1 |
50 |
+ use_if_iuse jit |
51 |
+} |
52 |
+ |
53 |
is_multilib() { |
54 |
tc_version_is_at_least 3 || return 1 |
55 |
use multilib |
56 |
|
57 |
diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml |
58 |
index 29330fe..2e74979 100644 |
59 |
--- a/sys-devel/gcc/metadata.xml |
60 |
+++ b/sys-devel/gcc/metadata.xml |
61 |
@@ -12,6 +12,8 @@ |
62 |
<flag name="go">Build the GCC Go language frontend.</flag> |
63 |
<flag name="graphite">Add support for the framework for loop |
64 |
optimizations based on a polyhedral intermediate representation</flag> |
65 |
+ <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation. |
66 |
+ This will slow down the compiler a bit as it forces all of the toolchain to be shared libs.</flag> |
67 |
<flag name="libssp">Build SSP support into a dedicated library rather than use the |
68 |
code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag> |
69 |
<flag name="mudflap">Add support for mudflap, a pointer use checking library</flag> |