gcc-3.4 introduced a syntax for compilation with inter-module analysis: $ gcc -c foo1.c foo2.c -o foo.o gcc-4.0 performs the same with the command-line option -combine: $ gcc -combine -c foo1.c foo2.c -o foo.o But Makefiles that have already switched to using the gcc-3.4 invocation convention are trapped: gcc-4.0, when invoked without -combine, ignores all input files except the last one. $ cat foo1.c int foo1 (int x) { return 17 * x; } $ cat foo2.c int foo2 (int x) { return 42 * x; } $ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.0.0/configure --prefix=/home/haible/gnu/arch/linuxgcc40 --enable-shared --enable-threads --enable-__cxa_atexit --enable-languages=c,c++,java,objc --enable-nls Thread model: posix gcc version 4.0.0 $ gcc -c foo1.c foo2.c -o foo.o && nm foo.o 00000000 T foo2 Expected result: An error, as with gcc-3.3: $ gcc -c foo1.c foo2.c -o foo.o && nm foo.o gcc: cannot specify -o with -c or -S and multiple compilations
-- Summary: gcc ignores input file given on the command line Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bruno at clisp dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22544