Most recent kernel where this bug did not occur: 2.6.16 Distribution: Fedora Hardware Environment: i386 Software Environment: Problem Description: When building with CONFIG_X86_GENERIC the kernel fails with the following message, arch/i386/kernel/asm-offsets.c:1: error: bad value (generic) for -mtune= switch With gcc version 4.1.2. If I compile anything else with -mtune=generic it won't have this error. I narrowed it down to gcc failing with -mtune=generic and the -S option. for instance, if foo.c is "void main(void) { }" and you compile with "gcc -S -mtune=generic foo.c -o foo" It fails. Removing -S and it compile fine ..
Gad, 2.6.17. Is current mainline busted too?
(In reply to comment #1) > Gad, 2.6.17. Is current mainline busted too? > yeah .. I noticed that -S combined with -mtune=core2 also fails ..
It looks more and more like a compiler problem.. gcc should work with -S and any -mtune options but doens't for -mtune=core2 or -mtune=generic .. However, -S does work with -mtune=pentium3 and -mtune .. According to the gcc man page -mtune=generic is the same as -mtune=i686 , the later works fine (at least on my gcc)..
I'm not an expect on the build system , but I think Linux build scripts check for -mtune=generic support using the following command line, gcc -mtune=generic -S -xc /dev/null -o tmpfile from scripts/Kbuild.include "try-run" , and "cc-option-yn" .. The above command returns that -mtune=generic works as a gcc command line option .. If I change the commandline slightly, creating an actual C source file called foo.c . gcc -mtune=generic -S -xc foo.c -o foo This command line has no errors either .. Then remove "-xc" gcc -mtune=generic -S foo.c -o foo And your get failure ..
This is getting so weird, I'm wondering if it's related to my system ..
The good news is that this appears to be a distcc issue on my system.. Boils down to different compilers (even tho they all the same version) .. Appears that distcc across distro's is a no-no (even with equal gcc versions).. So I'll close this, and figure it out myself .. Sorry for the noise ..
> If I change the commandline slightly, creating an actual C source file called > foo.c . > > gcc -mtune=generic -S -xc foo.c -o foo > > This command line has no errors either .. Then remove "-xc" > > gcc -mtune=generic -S foo.c -o foo > > And your get failure .. Very strange. -xc just tell gcc that it is dealing with a .c file no matter the extension of the file. It is often used when reading from standard input. Sam