Skip to content

Commit

Permalink
Toolchain: Explicitly enable LTO, fix build on OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs authored and awesomekling committed Feb 14, 2021
1 parent 0d215b5 commit 4a2209d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Toolchain/BuildIt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,15 @@ pushd "$DIR/Build/$ARCH"
--enable-shared \
--enable-languages=c,c++ \
--enable-default-pie \
--enable-lto \
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1

echo "XXX build gcc and libgcc"
"$MAKE" -j "$MAKEJOBS" all-gcc all-target-libgcc || exit 1
"$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
if [ "$(uname -s)" = "OpenBSD" ]; then
ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
fi
"$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
echo "XXX install gcc and libgcc"
"$MAKE" install-gcc install-target-libgcc || exit 1

Expand All @@ -259,7 +264,7 @@ pushd "$DIR/Build/$ARCH"
"$MAKE" install-target-libstdc++-v3 || exit 1

if [ "$(uname -s)" = "OpenBSD" ]; then
cd "$DIR/Local/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
cd "$DIR/Local/${ARCH}/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
fi

popd
Expand Down

0 comments on commit 4a2209d

Please sign in to comment.