Skip to content

Commit

Permalink
Disable LTO in both toolchains
Browse files Browse the repository at this point in the history
LTO support on Windows is buggy, and occasionally I need to turn it off
(-fno-lto) to avoid problems, so just disable it entirely. Also shaves
about 9MiB off the distribution.
  • Loading branch information
skeeto committed Jan 31, 2024
1 parent 41aff0c commit 103b45d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ RUN cat $PREFIX/src/gcc-*.patch | patch -d/gcc-$GCC_VERSION -p1 \
--enable-version-specific-runtime-libs \
--disable-dependency-tracking \
--disable-nls \
--disable-lto \
--disable-multilib \
CFLAGS_FOR_TARGET="-Os" \
CXXFLAGS_FOR_TARGET="-Os" \
Expand Down Expand Up @@ -269,6 +270,7 @@ RUN /gcc-$GCC_VERSION/configure \
--enable-threads=posix \
--enable-version-specific-runtime-libs \
--disable-dependency-tracking \
--disable-lto \
--disable-multilib \
--disable-nls \
--disable-win32-registry \
Expand All @@ -282,7 +284,7 @@ RUN /gcc-$GCC_VERSION/configure \
&& make -j$(nproc) \
&& make install \
&& rm -rf $PREFIX/$ARCH/bin/ $PREFIX/bin/$ARCH-* \
$PREFIX/bin/ld.bfd.exe $PREFIX/bin/c++.exe $PREFIX/bin/lto-dump.exe \
$PREFIX/bin/ld.bfd.exe $PREFIX/bin/c++.exe \
&& $ARCH-gcc -DEXE=g++.exe -DCMD=c++ \
-Os -fno-asynchronous-unwind-tables \
-Wl,--gc-sections -s -nostdlib \
Expand Down

0 comments on commit 103b45d

Please sign in to comment.