https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111756
Bug ID: 111756 Summary: Re-building all-gcc after source changes fails to link Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- When having modula-2 enabled in a development tree and there are any changes that trigger rebuilds in m2/ doing a 'make all-gcc' in the build directory will end up with make[1]: Entering directory '/spc/abuild/rguenther/gcc13-g/gcc' test -d m2/stage1 || /bin/sh /space/rguenther/src/gcc-13-branch/gcc/../mkinstalldirs m2/stage1 g++ -no-pie -g -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o m2/stage1/cc1gm2 m2/gm2-lang.o m2/m2pp.o m2/gm2-gcc/m2assert.o m2/gm2-gcc/m2block.o m2/gm2-gcc/m2builtins.o m2/gm2-gcc/m2except.o m2/gm2-gcc/m2color.o m2/gm2-gcc/m2configure.o m2/gm2-gcc/m2convert.o m2/gm2-gcc/m2decl.o m2/gm2-gcc/m2expr.o m2/gm2-gcc/m2linemap.o m2/gm2-gcc/m2statement.o m2/gm2-gcc/m2type.o m2/gm2-gcc/m2tree.o m2/gm2-gcc/m2treelib.o m2/gm2-gcc/m2top.o m2/gm2-gcc/m2misc.o m2/gm2-gcc/init.o m2/gm2-compiler-boot/m2flex.o \ attribs.o \ m2/gm2-compiler-boot/gm2.a m2/gm2-libs-boot/libgm2.a m2/mc-boot-ch/Glibc.o m2/mc-boot-ch/Gmcrts.o \ m2/gm2-gcc/rtegraph.o \ libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lisl -lmpc -lmpfr -lgmp -rdynamic -ldl -L./../zlib -lz -lzstd /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: m2/gm2-compiler-boot/gm2.a(P3Build.o): in function `AsmStatement(unsigned int, unsigned int, unsigned int)': /abuild/rguenther/gcc13-g/gcc/m2/gm2-compiler-boot/P3Build.c:8848:(.text+0xa387): undefined reference to `M2Quads_BuildInline' collect2: error: ld returned 1 exit status make[1]: *** [/space/rguenther/src/gcc-13-branch/gcc/m2/Make-lang.in:554: m2/stage1/cc1gm2] Error 1 make[1]: Leaving directory '/spc/abuild/rguenther/gcc13-g/gcc' make: *** [Makefile:4629: all-gcc] Error 2 this looks like a dependency issue, maybe triggered by the change renaming BuildInline to BuildAsm. When I remove P3Build.[co] it seems to work. How's dependency tracking (not) working here?