aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Peelar <lookatyouhacker@gmail.com>2017-09-21 13:05:14 -0400
committerAndreas K. Hüttel <dilfridge@gentoo.org>2017-12-16 21:13:41 +0100
commitaab6bf7095a0ab921c78b07a202db207ce07a5f8 (patch)
treed81c32447ae03afe97ad51f61088e9fdec0baf63 /gcc-config
parentgcc-config: ensure we run env-update for prefix too (diff)
downloadgcc-config-aab6bf7095a0ab921c78b07a202db207ce07a5f8.tar.gz
gcc-config-aab6bf7095a0ab921c78b07a202db207ce07a5f8.tar.bz2
gcc-config-aab6bf7095a0ab921c78b07a202db207ce07a5f8.zip
Add support for symlinking appropriate LTO plugin
Since Binutils 2.25, automatic loading of LTO plugins is supported from binutils, but the LTO plugins must be in the bfd-plugins directory in order to be found. This patches gcc-config to automatically do this. Signed-off-by: Shane Peelar <lookatyouhacker@gmail.com>
Diffstat (limited to 'gcc-config')
-rwxr-xr-xgcc-config13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc-config b/gcc-config
index ff8d8ac..e9afa24 100755
--- a/gcc-config
+++ b/gcc-config
@@ -689,6 +689,19 @@ switch_profile() {
update_wrappers ${CTARGET}
+ # Update LTO plugin for GCC. Supported as of binutils 2.25.
+ local BFD_PLUGINS_DIR
+ local LIBLTO_PLUGIN
+ LIBLTO_PLUGIN="${EROOT}usr/libexec/gcc/${CTARGET}/${CC_COMP_VERSION}/liblto_plugin.so"
+ if is_cross_compiler; then
+ BFD_PLUGINS_DIR="${EROOT}usr/${CHOST}/${CTARGET}/binutils-bin/lib/bfd-plugins"
+ else
+ BFD_PLUGINS_DIR="${EROOT}usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ fi
+ ewarn "Updating LTO plugin symlink in ${BFD_PLUGINS_DIR}"
+ mkdir -p "${BFD_PLUGINS_DIR}"
+ ln -sf "${LIBLTO_PLUGIN}" "${BFD_PLUGINS_DIR}"
+
if [[ ${ROOT} == "/" ]] && \
[[ ${FORCE} == "yes" || ${envd_changed} -gt 0 ]]
then