preprocessor/10022: Preprocessor failure when using '-MMD' flag with gcc 3.1 on Mac OSX
willic3@rpi.edu
willic3@rpi.edu
Mon Mar 10 20:39:00 GMT 2003
>Number: 10022
>Category: preprocessor
>Synopsis: Preprocessor failure when using '-MMD' flag with gcc 3.1 on Mac OSX
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 10 19:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Charles Williams
>Release: Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 20020420 (prerelease)
>Organization:
>Environment:
Mac OSX 10.2.4, 350 MHz G3, 896 MB RAM, 12 GB HD
>Description:
When attempting to compile a simple example using the '-MMD' flag for gcc 3.1, no output is produced and the preprocessor exits with an error. This does not happen with either g77 (installed via fink), g++, or gcc2 (2.95.2) on my Mac, or with gcc 3.0.3 on Sparc Solaris 2.8, or with gcc 3.2.1 on an Athlon 2000+ running RedHat 7.3. The similar '-MD' flag works correctly using gcc 3.1 on the Mac. It appears that the preprocessor is attempting to read the object file (which does not yet exist). It does not matter whether the source file has non-system include files (which would be listed in the '.d' file). I have the same problem on my Pismo PowerBook as on the machine described here. Please let me know if this bug should be filed with Apple rather than GNU. Pasted below are the compiler messages when attempting to compile a simple example:
gcc -v -save-temps -MMD -fPIC -c -o c_hello.o c_hello.c
Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
Thread model: posix
Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 20020420 (prerelease)
/usr/libexec/gcc/darwin/ppc/cpp-precomp -smart -arch ppc -lang-c -v -MMD c_hello.d -MQ c_hello.o -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__APPLE_CC__=1175 -D__ppc__ -D__POWERPC__ -D__NATURAL_ALIGNMENT__ -D__MACH__ -D__BIG_ENDIAN__ -D__APPLE__ -D__ppc__ -D__POWERPC__ -D__NATURAL_ALIGNMENT__ -D__MACH__ -D__BIG_ENDIAN__ -D__APPLE__ -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__DYNAMIC__ c_hello.c -isystem /usr/include/gcc/darwin/3.1 -ispecs=/usr/libexec/gcc/darwin/ppc/3.1/specs -D__SIZE_TYPE__=long unsigned int -D__PTRDIFF_TYPE__=int -D__WCHAR_TYPE__=int -D__WINT_TYPE__=unsigned int c_hello.i
Apple cpp-precomp 6.14 (devkit-213/devkit_tools-214)
cpp-precomp: could not open 'c_hello.o'
>How-To-Repeat:
Compile a simple sample code using the '-MMD' flag.
>Fix:
Use the older compiler (2.95.2) or, in some cases, use g++.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list