Opened 6 weeks ago

Last modified 6 weeks ago

#18974 new bug

legacy toolchain builds fail under gcc 14

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/beta4
Keywords: gcc14 Cc:
Blocked By: Blocking:
Platform: All

Description

gcc 14 host toolchains (Arch) fail to build the legacy binutils / gcc due to changes to the default warning levels.

A workaround is doing the build in a debian container with gcc 12.

Change History (2)

comment:1 by kallisti5, 6 weeks ago

Here's an incomplete workaround. It kept growing, so I bailed for just using gcc 12. (release stuff)

diff --git a/build/scripts/build_cross_tools b/build/scripts/build_cross_tools
index bbbb04605e..290958bcad 100755
--- a/build/scripts/build_cross_tools
+++ b/build/scripts/build_cross_tools
@@ -115,10 +115,12 @@ if [ ! -z "$MAKEFLAGS" ]; then
        export MAKEFLAGS=$(echo $MAKEFLAGS | sed -e 's/-j\s*[0-9][0-9]*//g')
 fi
 
+# change in gcc 14 behaviour breaks config
+export WARNFIX="-Wno-error=implicit-int"
 
 # build binutils
 cd $binutilsObjDir
-CFLAGS="-O2 -fcommon" CXXFLAGS="-O2 -fcommon" $buildToolsDir/binutils/configure \
+CFLAGS="-O2 -fcommon $WARNFIX" CXXFLAGS="-O2 -fcommon $WARNFIX" $buildToolsDir/binutils/configure \
        --prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
        --disable-nls --enable-shared=yes --disable-werror || exit 1
 $MAKE $additionalMakeArgs || exit 1
@@ -159,7 +161,7 @@ copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
 cd $gccObjDir
 # GCC 2 compiled for x86_64 on most systems is broken, compile for 32-bit.
 export CC="gcc -m32"
-CFLAGS="-O2 -U_FORTIFY_SOURCE -fcommon" CXXFLAGS="-O2 -fcommon" $buildToolsDir/gcc/configure \
+CFLAGS="-O2 -U_FORTIFY_SOURCE -fcommon $WARNFIX" CXXFLAGS="-O2 -fcommon $WARNFIX" $buildToolsDir/gcc/configure \
        --prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
        --disable-nls --enable-shared=yes --enable-languages=c,c++ \
        --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir $gccConfigureArgs \

comment:2 by kallisti5, 6 weeks ago

See https://gcc.gnu.org/gcc-14/porting_to.html for relevant information and changes.

Note: See TracTickets for help on using tickets.