@@ -167,8 +167,6 @@ RUN --mount=source=configure.sh,target=/usr/bin/configure.sh configure.sh \
167167 --with-headers=/var/install/kernel/usr/include \
168168 --with-tls \
169169 libc_cv_slibdir=/lib \
170- CFLAGS="-O2 -falign-functions=32" \
171- LDFLAGS="-Wl,-z,max-page-size=0x1000" \
172170 || (cat config.log && exit 1)
173171RUN make all --jobs $(nproc)
174172RUN make DESTDIR=/var/install/glibc install
@@ -179,6 +177,7 @@ WORKDIR /build/gcc/build
179177COPY --from=kernel /var/install/kernel /var/install/gcc/sysroot
180178COPY --from=glibc /var/install/glibc /var/install/gcc/sysroot
181179RUN --mount=source=configure.sh,target=/usr/bin/configure.sh IS_GCC_BUILD=1 configure.sh \
180+ --disable-bootstrap \
182181 --enable-default-pie \
183182 --enable-languages=c,c++,fortran,lto \
184183 --disable-multilib \
@@ -187,14 +186,10 @@ RUN --mount=source=configure.sh,target=/usr/bin/configure.sh IS_GCC_BUILD=1 conf
187186 --with-linker-hash-style=gnu \
188187 --with-build-sysroot=/var/install/gcc/sysroot \
189188 --with-sysroot=/RELOCATABLE_SYSROOT \
190- CFLAGS="-O2 -falign-functions=32" \
191- CXXFLAGS="-O2 -falign-functions=32" \
192- LDFLAGS="-Wl,-z,max-page-size=0x1000" \
193189 || (cat config.log && exit 1)
194190RUN grep -rl '/RELOCATABLE_SYSROOT' . | xargs sed -i 's|/RELOCATABLE_SYSROOT|$(exec_prefix)/sysroot|g'
195191RUN make --jobs $(nproc) all-gcc
196192RUN make install-gcc
197- RUN rm -v "/opt/gcc/${ARCH}/bin/" *{gcc,g++,cpp}
198193ENV PATH="/var/install/gcc/bin:${PATH}"
199194RUN make --jobs $(nproc)
200195RUN make install
@@ -216,8 +211,6 @@ RUN --mount=source=configure.sh,target=/usr/bin/configure.sh IS_GCC_BUILD=1 conf
216211 --prefix=/var/install/binutils \
217212 --with-build-sysroot=/var/install/gcc/sysroot \
218213 --with-lib-path=/var/install/glibc/usr/lib \
219- CFLAGS="-O2 -falign-functions=32" \
220- LDFLAGS="-Wl,-z,max-page-size=0x1000" \
221214 || (cat config.log && exit 1)
222215RUN make --jobs $(nproc)
223216RUN make install
@@ -344,6 +337,15 @@ RUN --mount=source=dedup,target=/usr/bin/dedup dedup /var/builds/toolchain
344337# We patch the shared libraries to set the rpath to $ORIGIN, so that during runtime the
345338# libraries are found in the same directory as the executable.
346339COPY --from=patchelf_download /downloads/patchelf /var/install/patchelf
347- RUN find /var \
340+ RUN find /var/builds/toolchain \
348341 -name '*.so*' \
349342 -exec /var/install/patchelf/bin/patchelf --set-rpath '$ORIGIN/' {} \;
343+
344+ RUN find /var/builds/toolchain/bin -type f \
345+ -exec strip \
346+ --strip-all \
347+ --remove-section=.comment \
348+ --remove-section=.note \
349+ --remove-section=.eh_frame \
350+ --remove-section=.eh_frame_hdr \
351+ {} \;
0 commit comments