sys-devel/gcc: add support for USE=jit #568834
authorMike Frysinger <vapier@gentoo.org>
Sat, 19 Dec 2015 21:36:18 +0000 (16:36 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 19 Dec 2015 23:28:59 +0000 (18:28 -0500)
eclass/toolchain.eclass
sys-devel/gcc/metadata.xml

index 43fa8bffc970cf2d8b3ae4d4a8392fcb1892b3fb..b18d41816eb59dc34cf08ddbb71f2ec5dc470ee2 100644 (file)
@@ -152,6 +152,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
        # the older versions, we don't want to bother supporting it.  #448024
        tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize )
        tc_version_is_at_least 4.9 && IUSE+=" cilk"
+       tc_version_is_at_least 5.0 && IUSE+=" jit"
        tc_version_is_at_least 6.0 && IUSE+=" pie +ssp"
 fi
 
@@ -841,6 +842,7 @@ toolchain_src_configure() {
        is_d   && GCC_LANG+=",d"
        is_gcj && GCC_LANG+=",java"
        is_go  && GCC_LANG+=",go"
+       is_jit && GCC_LANG+=",jit"
        if is_objc || is_objcxx ; then
                GCC_LANG+=",objc"
                if tc_version_is_at_least 4 ; then
@@ -904,6 +906,9 @@ toolchain_src_configure() {
                confgcc+=( --enable-libstdcxx-time )
        fi
 
+       # The jit language requires this.
+       is_jit && confgcc+=( --enable-host-shared )
+
        # # Turn on the -Wl,--build-id flag by default for ELF targets. #525942
        # # This helps with locating debug files.
        # case ${CTARGET} in
@@ -2155,6 +2160,11 @@ is_go() {
        use cxx && use_if_iuse go
 }
 
+is_jit() {
+       gcc-lang-supported jit || return 1
+       use_if_iuse jit
+}
+
 is_multilib() {
        tc_version_is_at_least 3 || return 1
        use multilib
index 29330fe592521e0ac22839044e3bc7d1798544d1..2e74979dae7b2062894de6ffea36ac0d43b3a2ed 100644 (file)
@@ -12,6 +12,8 @@
     <flag name="go">Build the GCC Go language frontend.</flag>
     <flag name="graphite">Add support for the framework for loop
       optimizations based on a polyhedral intermediate representation</flag>
+    <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.
+      This will slow down the compiler a bit as it forces all of the toolchain to be shared libs.</flag>
     <flag name="libssp">Build SSP support into a dedicated library rather than use the
       code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
     <flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>