Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 578396 - toolchain.eclass: add support for libmpx w/gcc-5+
Summary: toolchain.eclass: add support for libmpx w/gcc-5+
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/wiki/Intel%20MPX%...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-27 18:55 UTC by Steven Noonan
Modified: 2016-05-11 14:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to enable support for libmpx (toolchain-libmpx.patch,1.87 KB, patch)
2016-03-28 11:24 UTC, Steven Noonan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Noonan 2016-03-27 18:55:16 UTC
GCC 5.0 introduced libmpx:

https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler

But there's currently no way to enable it with the existing toolchain.eclass.

Reproducible: Always




Something like this would probably be sufficient to enable it (untested, aside from checking that 'emerge -pv' shows the new use flag):

--- a/profile/use.local 2016-03-24 00:37:27.000000000 +0000
+++ b/profile/use.local 2016-03-27 18:49:14.357366533 +0000
@@ -7521,6 +7521,7 @@
 sys-devel/gcc:graphite - Add support for the framework for loop optimizations based on a polyhedral intermediate representation
 sys-devel/gcc: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.
 sys-devel/gcc: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)
+sys-devel/gcc:mpx - Add compiler support for Intel Memory Protection Extensions (MPX)
 sys-devel/gcc:mudflap - Add support for mudflap, a pointer use checking library
 sys-devel/gcc:multislot - Allow for multiple versions to be emerged at once for same CTARGET
 sys-devel/gcc:nopie - Disable PIE support (NOT FOR GENERAL USE)
--- a/eclass/toolchain.eclass   2016-03-27 18:46:05.966708059 +0000
+++ b/eclass/toolchain.eclass   2016-03-27 18:42:31.875886003 +0000
@@ -153,7 +153,7 @@
        # 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 5.0 && IUSE+=" jit mpx"
        tc_version_is_at_least 6.0 && IUSE+=" pie +ssp"
 fi

@@ -1161,6 +1161,14 @@
                fi
        fi

+       if tc_version_is_at_least 5.0 ; then
+               if in_iuse mpx ; then
+                       confgcc+=( $(use_enable mpx libmpx ) )
+               else
+                       confgcc+=( --disable-libmpx )
+               fi
+       fi
+
        if in_iuse cilk ; then
                confgcc+=( $(use_enable cilk libcilkrts) )
        fi
Comment 1 Steven Noonan 2016-03-28 11:24:31 UTC
Created attachment 429160 [details, diff]
patch to enable support for libmpx

My patch above had slightly muddled paths. Attached a fixed one.
Comment 2 Steven Noonan 2016-03-28 12:21:02 UTC
Just verified that my patch did make it install the libmpx bits as expected:

# qlist gcc | grep mpx | sort
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.a
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.la
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.so
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.so.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.so.0.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpx.spec
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpxwrappers.a
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpxwrappers.la
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpxwrappers.so
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpxwrappers.so.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/32/libmpxwrappers.so.0.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.a
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.la
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.so
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.so.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.so.0.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpx.spec
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpxwrappers.a
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpxwrappers.la
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpxwrappers.so
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpxwrappers.so.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/libmpxwrappers.so.0.0.0

Patch should be good to go.