From c53e29c5ac1ccb49b8a86874ed2a610bb68bf8a6 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sat, 29 Aug 2020 15:02:33 -0400 Subject: [PATCH] Do more optimization for size Some of the size optimizations from the first stage bootstrap leak into the second stage itself. This means the distribution can be made slighly smaller by optimizing for size in certain parts of the first stage. --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad834d1..71a8355 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,7 +86,10 @@ RUN /gcc-$GCC_VERSION/configure \ --enable-version-specific-runtime-libs \ --disable-dependency-tracking \ --disable-nls \ - --disable-multilib + --disable-multilib \ + CFLAGS="-Os" \ + CXXFLAGS="-Os" \ + LDFLAGS="-s" RUN make -j$(nproc) all-gcc RUN make install-gcc @@ -106,7 +109,9 @@ RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-libraries/winpthreads/configure \ --with-sysroot=/bootstrap/x86_64-w64-mingw32 \ --host=x86_64-w64-mingw32 \ --enable-static \ - --disable-shared + --disable-shared \ + CFLAGS="-Os" \ + LDFLAGS="-s" RUN make -j$(nproc) RUN make install @@ -231,7 +236,9 @@ RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-libraries/winpthreads/configure \ --with-sysroot=$PREFIX/x86_64-w64-mingw32 \ --host=x86_64-w64-mingw32 \ --enable-static \ - --disable-shared + --disable-shared \ + CFLAGS="-Os" \ + LDFLAGS="-s" RUN make -j$(nproc) RUN make install