Bug 1434

Summary: grub: host compiler used during configure task
Product: [Build System, Metadata & Runtime] BSPs Reporter: Darren Hart <dvhart>
Component: bsps-meta-intelAssignee: Edwin Zhai <edwin.zhai>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Undecided CC: shane.wang, tom.zanussi
Version: 1.0   
Target Milestone: 1.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Darren Hart 2011-08-31 15:57:14 UTC
The meta-intel grub recipe's log.do_configure contains the following. It appears that some of the configure tests are just using the host gcc:

configure:8739: checking for __bswapsi2
configure:8739: gcc -o conftest -O2 -pipe -g -feliminate-unused-debug-types -DGRUB_MACHINE_PCBIOS=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100 -Wl,--defsym,abort=main -Wno-error  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -m32 conftest.c -lgcc >&5
In file included from /usr/include/features.h:387,
                 from /usr/include/limits.h:27,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h:122,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h:11,
                 from conftest.c:62:
/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory compilation terminated.
configure:8739: $? = 1
Comment 1 Edwin Zhai 2011-09-02 01:44:37 UTC
I found this may be generic issue that exist also for grub_0.97 under meta. It's common that configure just create a .c file that include some headers to detect some configuration like instruction support of CPU. It's not reasonable for cross-compile environment, as configure runs on build platform, while instructions running from target system.

So I'm not sure how to handing this? Make some hacks inside the c file to use sysroots headers here, or disable such checks?
Comment 2 Darren Hart 2011-09-06 09:14:25 UTC
Edwin, have you been able to make any further progress? Are you still targeting 1.1?
Comment 3 Edwin Zhai 2011-09-06 17:28:04 UTC
patch already out.
Comment 4 Edwin Zhai 2011-09-07 18:22:53 UTC
Merged into master @ 93ca6d36a525c5d8e6c99f53bb1d03b5d862cbf7