https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107032
Bug ID: 107032 Summary: ARM: libgcc2.c:2174:1: error: r7 cannot be used in 'asm' here Product: gcc Version: 11.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: thomas.petazz...@free-electrons.com Target Milestone: --- When building gcc 10.4.0 or 11.3.0 for Cortex-M3 or M7, the build fails with: ../../../libgcc/libgcc2.c: In function '__clear_cache': ../../../libgcc/libgcc2.c:2174:1: error: r7 cannot be used in 'asm' here 2174 | } | ^ Makefile:501: recipe for target '_clear_cache.o' failed GCC was configured like this: (cd /home/buildroot/autobuild/instance-0/output-1/build/host-gcc-initial-10.4.0/build && rm -rf config.cache; PATH="/home/buildroot/autobuild/instance-0/output-1/host/bin:/home/buildroot/autobuild/instance-0/output-1/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PKG_CONFIG="/home/buildroot/autobuild/instance-0/output-1/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/buildroot/autobuild/instance-0/output-1/host/lib/pkgconfig:/home/buildroot/autobuild/instance-0/output-1/host/share/pkgconfig" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/buildroot/autobuild/instance-0/output-1/host/include" CFLAGS="-O2 -I/home/buildroot/autobuild/instance-0/output-1/host/include" CXXFLAGS="-O2 -I/home/buildroot/autobuild/instance-0/output-1/host/include" LDFLAGS="-L/home/buildroot/autobuild/instance-0/output-1/host/lib -Wl,-rpath,/home/buildroot/autobuild/instance-0/output-1/host/lib" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-O2 -I/home/buildroot/autobuild/instance-0/output-1/host/include" LDFLAGS="-L/home/buildroot/autobuild/instance-0/output-1/host/lib -Wl,-rpath,/home/buildroot/autobuild/instance-0/output-1/host/lib" MAKEINFO=missing CFLAGS_FOR_TARGET="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -Wl,-elf2flt=-r -static" CXXFLAGS_FOR_TARGET="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -Wl,-elf2flt=-r -static -Wl,-elf2flt=-r -static" AR_FOR_TARGET=gcc-ar NM_FOR_TARGET=gcc-nm RANLIB_FOR_TARGET=gcc-ranlib CONFIG_SITE=/dev/null ./configure --prefix="/home/buildroot/autobuild/instance-0/output-1/host" --sysconfdir="/home/buildroot/autobuild/instance-0/output-1/host/etc" --localstatedir="/home/buildroot/autobuild/instance-0/output-1/host/var" --enable-shared --disable-static --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --disable-debug --with-xmlto=no --with-fop=no --disable-nls --disable-dependency-tracking --target=arm-buildroot-uclinux-uclibcgnueabi --with-sysroot=/home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/home/buildroot/autobuild/instance-0/output-1/host --with-mpc=/home/buildroot/autobuild/instance-0/output-1/host --with-mpfr=/home/buildroot/autobuild/instance-0/output-1/host --with-pkgversion="Buildroot 2022.05-439-g18f6e4bf70" --with-bugurl="http://bugs.buildroot.net/" --without-zstd --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --disable-tls --enable-threads --without-isl --without-cloog --with-float=soft --with-abi="aapcs-linux" --with-cpu=cortex-m3 --with-float=soft --with-mode=thumb --enable-languages=c --disable-shared --without-headers --disable-threads --with-newlib --disable-largefile ) Full build log of GCC 10.4.0 for Cortex-M3: http://autobuild.buildroot.net/results/e91/e91fa76142cf50e514d5fe4791a06f3c3c014b5a/build-end.log Full build log of GCC 11.3.0 for Cortex-M7: http://autobuild.buildroot.net/results/9f7/9f7a43a375d476f47702cd7848eba53b76fcd386/build-end.log