
Hi Andy,
On Sun, Jul 23, 2017 at 6:01 PM, Andy Shevchenko andy.shevchenko@gmail.com wrote:
On Sun, Jul 23, 2017 at 12:37 PM, Bin Meng bmeng.cn@gmail.com wrote:
Attempting to use a 32-bit toolchain (eg: kernel.org 4.9 i386-linux-gcc) to compile 64-bit U-Boot (qemu-x86_64_defconfig) fails with the following errors:
arch/x86/cpu/intel_common/microcode.c:79:2: error: PIC register clobbered by 'ebx' in 'asm'
The issue is with 32-bit toolchain compiling sources for 64-bit. Using a 64-bit toolchain (eg: kernel.org 4.9 x86_64-linux-gcc) works out of the box. When compiling sources for 32-bit, '-m32' is passed to the toolchain (no matter it's 32-bit or 64-bit).
Now do the same thing, passing '-m64' to the toolchain for 64-bit sources build.
The subject is a bit cofusing. As I read (and as I understand) we need to have 64-bit toolchain available (multilib package and so on). Basically what you do is "enforcing 64-bit toolchain to be used". Right?
Yes, multilib package is required for 64-bit toolchain to build 32-bit U-Boot. Maybe the confusion comes from what we call 32-bit/64-bit toolchains. Or maybe we should call it pre-configured toolchain for building 32-bit/64-bit codes? The issue is when using kernel.org i386-linux-gcc to build qemu-x86_64_defconfig (64-bit U-Boot), the issue is seen. It's because the i386-linux-gcc is pre-configured with '-m32' which is for building 32-bit codes.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
arch/x86/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Regards, Bin