diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template index 758019a545a..561dc9d6ea3 100644 --- a/srcpkgs/gcc/template +++ b/srcpkgs/gcc/template @@ -61,7 +61,8 @@ pre_configure() { case "$XBPS_TARGET_MACHINE" in *-musl) patch -Np1 -i ${FILESDIR}/gcc-${version}-musl.diff;; esac - + # _FORTIFY_SOURCE needs an optimization level. + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure # As specified in the LFS book, disable installing libiberty. sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in # Do not run fixincludes