To: | krb5-bugs@MIT.EDU |
Subject: | gcc -fworking-directory breaks make depend |
From: | Tom Yu <tlyu@MIT.EDU> |
Date: | Tue, 18 Sep 2007 00:40:49 -0400 |
I just had "make depend" fail spectacularly.
At some point recently (3.4.0?), gcc grew the option to output the
working directory in cpp output ("-fworking-directory"). This outputs
cpp line markers containing the working directory, and for some reason
occurs even while runing "make depend" using "gcc -M", causing broken
makefiles. I think it's because passing "-g" to gcc may turn on
"-fworking-directory" due to the specfile.
Workaround is to set CFLAGS=-P or CFLAGS=-fno-working-directory when
running "make depend", but we might want to make the depfix script
deal with the spurious line markers if they get output.
Alternatively, or additionally, add to ALL_CFLAGS a variable named
DEP_CFLAGS or something like that which will get configured to contain
gcc-version-specific flags to suppress line markers. Stripping line
markers in depfix sounds easier though.
At some point recently (3.4.0?), gcc grew the option to output the
working directory in cpp output ("-fworking-directory"). This outputs
cpp line markers containing the working directory, and for some reason
occurs even while runing "make depend" using "gcc -M", causing broken
makefiles. I think it's because passing "-g" to gcc may turn on
"-fworking-directory" due to the specfile.
Workaround is to set CFLAGS=-P or CFLAGS=-fno-working-directory when
running "make depend", but we might want to make the depfix script
deal with the spurious line markers if they get output.
Alternatively, or additionally, add to ALL_CFLAGS a variable named
DEP_CFLAGS or something like that which will get configured to contain
gcc-version-specific flags to suppress line markers. Stripping line
markers in depfix sounds easier though.