https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70519
Bug ID: 70519 Summary: genmatch fails to compile under gcc-5.2.0 - missing '-lstdc++' . Product: gcc Version: 5.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: jason.vas.dias at gmail dot com Target Milestone: --- I am trying to build gcc-5.3.0 with gcc-5.2.0 , on an x86-64 (Haswell) Linux box, and am getting this unexpected compilation failure building the unmodified gcc-5.3.0 source after configuration, with 'make' : <quote><pre> /usr/build/linux/gcc-5.3.0/./prev-gcc/xg++ -B/usr/build/linux/gcc-5.3.0/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/usr/os_src/gcc-5.3.0/libstdc++-v3/libsupc++ -L/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/usr/build/linux/gcc-5.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a build/genmatch.o: In function `lower_cond(operand*) [clone .constprop.91]': genmatch.c:(.text+0xc7a): undefined reference to `operator new(unsigned long)' genmatch.c:(.text+0xe2e): undefined reference to `operator new(unsigned long)' genmatch.c:(.text+0x125d): undefined reference to `operator new(unsigned long)' genmatch.c:(.text+0x146b): undefined reference to `operator new(unsigned long)' genmatch.c:(.text+0x15ef): undefined reference to `operator new(unsigned long)' build/genmatch.o:genmatch.c:(.text+0x17b5): more undefined references to `operator new(unsigned long)' follow build/genmatch.o: In function `main': genmatch.c:(.text.startup+0x6015): undefined reference to `operator delete(void*)' genmatch.c:(.text.startup+0x60d6): undefined reference to `operator new(unsigned long)' genmatch.c:(.text.startup+0x6148): undefined reference to `operator new(unsigned long)' collect2: error: ld returned 1 exit status Makefile:2613: recipe for target 'build/genmatch' failed </pre></quote> Adding '-lstdc++' to the xg++ command above enables it to succeed . Why the missing '-lstdc++' ? Intentional ? An error ? Only when compiling under 5.2.0 ? I can check in a Makefile.in patch if it would help ...