Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 424499 - sys-boot/grub-2.00[custom-cflags] fails to build efi-64 on x86
Summary: sys-boot/grub-2.00[custom-cflags] fails to build efi-64 on x86
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-02 14:00 UTC by Maxim Kammerer
Modified: 2012-07-02 17:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kammerer 2012-07-02 14:00:06 UTC
The ebuild prepends "-march=x86-64" to TARGET_C(PP)FLAGS, so an -march=xxx in CFLAGS overrides -march=x86-64, and fails if xxx is incompatible with -m64.

I suggest filtering -march from user-supplied C(PP)FLAGS for platform=efi-64 in grub_src_configure() (hopefully this can be done while leaving other platforms unaffected). It's a bootloader, so even if the user has another m64-compatible -march in CFLAGS, the difference is bound to be miniscule (especially with -mtune).


i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00/grub-core -I..  -march=x86-64  -Wall -W -I/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00/include -I../include  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=X86_64_EFI -DGRUB_TARGET_CPU_X86_64=1 -m64 -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.5.3/include -DGRUB_FILE=\"trigtables.c\" -I. -I/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00/grub-core -I.. -I/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00 -I/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00/include -I../include     -Os -march=x86-64  -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m64 -mcmodel=large -mno-red-zone -fno-PIE -fno-PIC -fno-stack-protector -mno-stack-arg-probe -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1         -ffreestanding  -Os -march=pentium3 -mtune=core2 -mfpmath=sse -fomit-frame-pointer -pipe -c -o trig_module-trigtables.o `test -f 'trigtables.c' || echo '/var/tmp/portage/sys-boot/grub-2.00/work/grub-2.00/grub-core/'`trigtables.c
trigtables.c:1:0: error: CPU you selected does not support x86-64 instruction set
Comment 1 Mike Gilbert gentoo-dev 2012-07-02 15:58:50 UTC
You can probably resolve this by un-setting CFLAGS and using HOST_CFLAGS instead.

I don't want to insert workarounds for custom-cflags.
Comment 2 Maxim Kammerer 2012-07-02 16:07:51 UTC
Well, -march=x86-64 is already a workaround. I understand that custom-cflags is a "you are on your own" territory, but I think that the USE flag itself should be well-supported.
Comment 3 Rafał Mużyło 2012-07-02 17:11:48 UTC
Actually, IIRC (bug 360513), '-march' might be plain broken for grub - it was in grub1 case.