x86: Drop _X86EMU_env definition when CONFIG_BIOSEMU is used
PATCH 1/1 x86: Drop _X86EMU_env definition when CONFIG_BIOSEMU is used
With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with CONFIG_BIOSEMU). Both of these share the _X86EMU_env variable, with the native code using it to hold register state during interrupt processing.
At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with CONFIG_BIOSEMU.
With GCC 11 this causes a 'multiple definitions' error on boards with CONFIG_BIOSEMU.
Drop the emulator definition when CONFIG_BIOSEMU is used.
---
arch/x86/lib/bios.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/lib/bios.c +2 -0
@@ -23,7 +23,9 @@static int (*int_handler[256 ])(void );/* to have a common register file for interrupt handlers */ +#ifndef CONFIG_BIOSEMU X86EMU_sysEnv _X86EMU_env; +#endif asmlinkage void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,u32 esi,u32 edi);
Signature · 1 line
2.25.1
Quoted 8 lines · Bin Meng
With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with
CONFIG_BIOSEMU). Both of these share the_X86EMU_envvariable, with the native code using it to hold register state during interrupt processing.At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with
CONFIG_BIOSEMU.
Quoted 6 lines
With GCC 11 this causes a 'multiple definitions' error on boards with
CONFIG_BIOSEMU.Drop the emulator definition when
CONFIG_BIOSEMUis used.Signed-off-by Bin Meng <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Hi Bin,
Quoted 12 lines · Bin Meng
With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with
CONFIG_BIOSEMU). Both of these share the_X86EMU_envvariable, with the native code using it to hold register state during interrupt processing.At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with
CONFIG_BIOSEMU.With GCC 11 this causes a 'multiple definitions' error on boards with
CONFIG_BIOSEMU.
Quoted 7 lines
Drop the emulator definition when
CONFIG_BIOSEMUis used.Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/bios.c | 2 ++ 1 file changed, 2 insertions(+)
This seems a bit hacky. Should we define a new Kconfig that both use, then put this declaration in a common file?
Quoted 16 lines
arch/x86/lib/bios.c +2
-1@@ -23,7 +23,9 @@static int (*int_handler[256 ])(void );/* to have a common register file for interrupt handlers */ +#ifndef CONFIG_BIOSEMU X86EMU_sysEnv _X86EMU_env; +#endif asmlinkage void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,u32 esi,u32 edi); --
Quoted 2 lines
2.25.1
Regards,
Simon
Hi Simon,
Quoted 18 lines · Simon Glass
Hi Bin,
Quoted 14 lines · Bin Meng
With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with
CONFIG_BIOSEMU). Both of these share the_X86EMU_envvariable, with the native code using it to hold register state during interrupt processing.At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with
CONFIG_BIOSEMU.With GCC 11 this causes a 'multiple definitions' error on boards with
CONFIG_BIOSEMU.Drop the emulator definition when
CONFIG_BIOSEMUis used.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/bios.c | 2 ++ 1 file changed, 2 insertions(+)This seems a bit hacky. Should we define a new
Kconfigthat both use, then put this declaration in a common file?
Yes, that's what I thought so. We can do this later. Currently this is to unblock the GCC 11 CI testing.
Regards,
Bin