passing -o filename with multiple compile

Christian Iseli chris@ludwig-alpha.unil.ch
Sun Oct 4 06:43:00 GMT 1998


casero@bellsouth.net said:
> I use egcs-1.1b on a RedHat Linux box with kernel 2.0.35 and I have
> some problems when I try to compile software.  Here is an output of
> the errors I get on a recent compile:

> gcc -O6 -ffast-math    -I/usr/local/include -I/usr/X11R6/include -I/
> include  -Dlinux LinuxMachineDefines -D_POSIX_C_SOURCE=199309L
> -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE
> -DFUNCPROTO=15 -DNARROWPROTO     -c ../lib/sound.c -o ../lib/sound.o
> gcc: cannot specify -o with -c or -S and multiple compilations
> make[1]: *** [../lib/sound.o] Error 1 make[1]: Leaving directory `/usr/
> home/tmp/wmsound-0.7.6/src' making all in ./utils... make[1]: Entering
> directory `/usr/home/tmp/wmsound-0.7.6/utils' gcc -O6 -ffast-math
> -I/usr/local/include -I/usr/X11R6/include -I/include  -Dlinux
> LinuxMachineDefines -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE
> -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15
> -DNARROWPROTO     -c nmaker.c -o nmaker.o gcc: cannot specify -o with
> -c or -S and multiple compilations 

I ran into the same problem.  This is not about -o and -s.  If you look
closely, you will notice a lonely LinuxMachineDefines in the command line,
which egcs is taking to be some file to link or something...

The problem can be tracked down to cpp that no longer defines i386 and/or
__alpha, depending on your architecture.

The proper fix is probably to patch the imakedep.h file in the XFree86
distribution somewhat like the following patch, and recompile XFree86:

--- XFree86-3.3.2.3/xc/config/imake/imakemdep.h.dist    Sun Jul 27 04:41:05 1997
+++ XFree86-3.3.2.3/xc/config/imake/imakemdep.h Mon Sep  7 12:15:49 1998
@@ -491,6 +491,15 @@ char *cpp_argv[ARGUMENTS] = {
 #ifdef linux
         "-traditional",
         "-Dlinux",
+# ifdef __alpha
+       "-D__alpha",
+# endif
+# ifdef __alpha__
+       "-D__alpha__",
+# endif
+# ifdef __i386__
+       "-D__i386__",
+# endif
 #endif
 #ifdef __uxp__
        "-D__uxp__",

But you can also get around the problem by hacking the
/usr/X11R6/lib/X11/config/linux.cf file.

HTH.  Cheers,
					Christian





More information about the Gcc mailing list