Commit 28f7e66fc1da53997a545684b21b91fb3ca3f321
1 parent
43789e2163
x86: prevent binutils from being "smart" and generating NOPLs for us
binutils, contrary to documented behaviour, will generate long NOPs (a P6-or-higher instruction which is broken on at least some VIA chips, Virtual PC/Virtual Server, and some versions of Qemu) depending on the -mtune= option, which is not supposed to change architectural behaviour. Pass an explicit override to the assembler, in case ends up passing the -mtune= parameter to gas (gcc 4.3.0 does not appear to.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
arch/x86/Makefile_32.cpu
... | ... | @@ -44,4 +44,10 @@ |
44 | 44 | # add at the end to overwrite eventual tuning options from earlier |
45 | 45 | # cpu entries |
46 | 46 | cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686)) |
47 | + | |
48 | +# Bug fix for binutils: this option is required in order to keep | |
49 | +# binutils from generating NOPL instructions against our will. | |
50 | +ifneq ($(CONFIG_X86_P6_NOP),y) | |
51 | +cflags-y += $(call cc-option,-Wa$(comma)-mtune=generic32,) | |
52 | +endif |