summaryrefslogtreecommitdiff
path: root/scripts/build/cc/gcc.sh
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-12-11 16:55:07 (GMT)
committerAlexey Neyman <stilor@att.net>2018-12-11 16:55:07 (GMT)
commitf2b64524b0a15dd7ee830db302199bb183566356 (patch)
tree9d75d3707ec335e088cfc5dc131b89691a6440e3 /scripts/build/cc/gcc.sh
parentabee9bd48239468b49913ae73dcab5283bcb8810 (diff)
Add a symlink to LTO for binutils
... so that ar can find the plugin even when invoked directly, not via the gcc-ar plugin. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/cc/gcc.sh')
-rw-r--r--scripts/build/cc/gcc.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 5132444..64755ab 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -713,6 +713,13 @@ do_gcc_core_backend() {
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-${CT_CC}" \
host="${host}"
+
+ # If binutils want the LTO plugin, point them to it
+ if [ -d "${CT_PREFIX_DIR}/lib/bfd-plugins" -a "${build_step}" = "gcc_host" ]; then
+ local gcc_version=$(cat "${CT_SRC_DIR}/gcc/gcc/BASE-VER" )
+ CT_DoExecLog ALL ln -sfv "../../libexec/gcc/${CT_TARGET}/${gcc_version}/liblto_plugin.so" \
+ "${CT_PREFIX_DIR}/lib/bfd-plugins/liblto_plugin.so"
+ fi
}
#------------------------------------------------------------------------------
@@ -1186,4 +1193,11 @@ do_gcc_backend() {
cc_gcc_multilib_housekeeping cc="${prefix}/bin/${CT_TARGET}-${CT_CC}" \
host="${host}"
+
+ # If binutils want the LTO plugin, point them to it
+ if [ -d "${CT_PREFIX_DIR}/lib/bfd-plugins" -a "${build_step}" = "gcc_host" ]; then
+ local gcc_version=$(cat "${CT_SRC_DIR}/gcc/gcc/BASE-VER" )
+ CT_DoExecLog ALL ln -sfv "../../libexec/gcc/${CT_TARGET}/${gcc_version}/liblto_plugin.so" \
+ "${CT_PREFIX_DIR}/lib/bfd-plugins/liblto_plugin.so"
+ fi
}