| Summary: | Need a proper way to fix mismatched arch generated with bare-bone kernel recipe | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] BSPs | Reporter: | Jianxun Zhang <jianxun.zhang> | ||||||
| Component: | bsps-oe-core | Assignee: | Saul Wold <sgw> | ||||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | Medium | CC: | bruce.ashfield, sgw, tom.zanussi | ||||||
| Version: | 2.0 | ||||||||
| Target Milestone: | 2.3 | ||||||||
| Hardware: | x86 | ||||||||
| OS: | Multiple | ||||||||
| Whiteboard: | |||||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||||
| Attachments: |
|
||||||||
Created attachment 3161 [details]
The latest draft of kernel-lab doc (refer to lab1)
The issue is in the way the kernel config process determines if a 64bit x86 defconfig should be used. As it stands, the kernel Makefile uses uname -m to determine this, this causes a host contamination issue as it returns x86_64 to the make process We need to explicitly unset X86_64 when building for a i386 based platform. This just requires better documentation. We always map i*86 to x86 for the kernel ARCH, while there is a KBUILD_DEFCONFIG setting, that seems to only be used for the "defconfig" target not for the alldefconfig target, we still land with a 64bit config, even when building on a 32bit target! I tested this out on qemux86. This is because ARCH = x86 sets 64BIT and thus X86_64 and we are not using the underlying i386_defconfig which unsets x86_64. |
Created attachment 3160 [details] kenrel-lab 2.0 lab code When we update kernel-lab from 1.6 to 2.0 (lab 1), a change in /arch/x86/Makefile will call uname command to detect kernel arch if "x86" is passed into kbuild. This is no issue with kernel build based on linux-yocto. But for a customized (bare-bone) kernel recipe without linux-yocto support, it will fail the build because a 64 bit kernel arch will be generated (by upstream kernel patch) when you build a 32-bit kernel. My patch c0e9f2d2b6db25f9bca73f8d3e037a0705a60305 was an attempt to fix the issue but cause other problems so it gets reverted on master branch in OE. Please refer to its commit message for background. To reproduce the issue, please use Lab1 layer in attached kernel-lab 2.0 and poky master branch, and refer to the draft doc. (We assume the recipe is still a valid case). You will get a QA check failure of mismatched arch when build.