Summary: | 'Illegal Instruction' and the AMD K6 CPUs | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jordi Ferrer Plana <jferrerp> |
Component: | [OLD] Core system | Assignee: | Nicholas Jones (RETIRED) <carpaski> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | azarah, a_jay1981, caesarm, evilshenaniganz, lisa |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Jordi Ferrer Plana
2003-07-13 04:09:12 UTC
*** Bug 24396 has been marked as a duplicate of this bug. *** ok, the issues are stemming from the fact that -march=k6-2 was in use ... changing over to -mcpu=k6-2 fixed the problems ... i'd suggest adding to make.conf warnings like we have for the p4 and athlon-4 archs ... that is, 'please do not use the k6* archs as they tend to cause compile errors' ... i'm sure az can come up with a more correct error message The problem here relates solely to AMD's marketing. There are _6_ different cores (that is based on the 'flags' field in /proc/cpuinfo): [all also have 'fpu vme de pse tsc msr mce cx8'] mmx mmx 3dnow syscall k6_mtrr mmx 3dnow pge syscall mtrr mmx 3dnow pge sep mtrr <-K6-2 mmx 3dnow pge syscall 3dnowext k6_mtrr <-K6-3 There are only 4 unique values for the 'model name' field: AMD-K6(tm) 3D processor AMD-K6(tm) 3D+ Processor AMD-K6(tm)-III Processor AMD-K6tm w/ multimedia extensions In AMD's marketing, it is _very_ difficult to determine which chip you actually have. GCC is a lot stricter in what it expects from each of it's K6-N settings, but this isn't documented much at all. The user in this case has a K6 chip, not a K6-2 chip, which is why the -mcpu=K6-2 worked as opposed to -march=k6-2. Nevertheless, I still think a warning to this effect would not hurt at all. I personally have two chips, one labelled (etched/ingraved into the metal of the core) as 'AMD-K6(tm)-III' (400mhz chip) and the other as 'AMD-K6(tm)-3' (500mhz chip). The '-III' chip only works with -march=k6-2 and not -march=k6-3. The '-3' chip works fine with -march=k6-3. IIRC you're not supposed to use -march with a k6, use -mcpu=k6-2 and it will work. I ran into this problem long ago and found some docs somewhere (On Gentoo site?) that instructed me not to use -march with a k6-2. Noted in make.conf for >=2.0.49_pre9 Is this bug about compile errors or correctly matching -march and cpu type? I have a K6-3 and a K6-3+ and both work perfectly fine with -march=k6-3. The model names displayed by /proc/cpuinfo are misleading though. The K6-3 is shown as AMD-K6(tm) 3D+ Processor, and the K6-3+ is shown as AMD-K6(tm)-III Processor, I would say neither are right. Can the model names be fixed, or is that info straight from the bios or cpu? I have a K6-2 CPU (reported by the kernel as AMD-K6(tm) 3D processor), and I'm using "-march=k6-2 -O3 -pipe -fomit-frame-pointer" CFLAGS. I used to the Illigal Instruction a lot, especialy on larger compiles. But I then modded my CPU fan to run on 12V and not 7V. I haven't got a single Illigal Instruction since. I encourge you (who use K6-n and get Illigal Instruction with -march=k6-n) to find an eksternal cooler/fan and point it towards your CPU, in addition to your usual fan. And try compile something big (fx mozilla or the linux kernel), and report your results here. I have done bootstrapping on another K6, where I didn't have any problems using -march=k6 at all. But I wasen't mine, so I didn't get to emerge any ebuilds. *** Bug 30482 has been marked as a duplicate of this bug. *** I have a K6-2 500MHz chip, which has the same flags in /proc/cpuinfo as the original reporter's does (apart from the speed reading of course). Everything on my box is compiled with -march=k6-2 and I have not had any crashes. I have USE="mmx 3dnow" but it never appears in my gcc command line; I was expecting that -march=k6-2 would turn them on anyway but perhaps I'll try a big compile... In any case, while running bootstrap you're running plain i386 binaries without any CPU-specific extensions; the point of running all those compiles from the bootstrap is to generate code optimised for your CPU model! I think this is a problem with cooling or somesuch akin to the good old sig-11 problem. As such I think the remarks in the new /etc/make.conf ought to be removed as they are incorrect. Agreed there are many K6 CPUs (at the very least K6, K6-2, K6-2 3D, K6-III, K6-2+, K6-III+) that aren't totally differentiated but Intel have a lot more revisions and steppings of their CPUs that we don't bother to differentiate. The only odd one I'm aware of is that actually a K6-2+ is a K6-III with less L2 cache (other K6 and K6-2 have no L2 cache) and is derived from K6-III so should be optimised -march=k6-3. *** Bug 73621 has been marked as a duplicate of this bug. *** |