Skip to content

Instantly share code, notes, and snippets.

@xvjau
xvjau / updateLTOPlugin.sh
Created April 24, 2017 14:37
Update LTO plugins after GCC build.
#!/bin/bash
GCCVERSION=$(gcc --version | grep ^gcc | sed 's/^.* //g')
DESTDIR=/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins
if [ ! -d ${DESTDIR} ]; then
mkdir -p ${DESTDIR}
else
rm -iv ${DESTDIR}/liblto_plugin.so*
fi
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
GRAPHITE="-floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block"
LTOFLAGS="-flto=6 -fuse-linker-plugin"
CFLAGS="-O3 -pipe -march=native -fstack-protector-strong ${LTOFLAGS} ${GRAPHITE}"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -fdevirtualize"