Patchwork linker problem after menuconfig

login
register
about
Submitter austinro@msu.edu
Date 2010-08-02 01:43:32
Message ID <20100801214332.1668116awrsnqksk@mail.msu.edu>
Download mbox | patch
Permalink /patch/1709/
State New
Headers show

Comments

austinro@msu.edu - 2010-08-02 01:43:32
Okay, I found the problem.  CONFIG_VGA_BRIDGE_SETUP builds vga.c,  
which needs mainboard_interrupt_handlers from devices/oprom/x86.c,  
which wasn't being built unless one of the *_ROM_RUN files were enabled.

Patch is attached.
Signed-off-by: Robert Austin <austinro@msu.edu>

Quoting austinro@msu.edu:

> Quoting Stefan Reinauer <stefan.reinauer@coresystems.de>:
>
>>   On 8/1/10 7:13 AM, austinro@msu.edu wrote:
>>> Hi.
>>> The wiki page for seabios recommends configuring coreboot with
>>> CONFIG_VGA_BRIDGE_SETUP enabled and CONFIG_VGA_ROM_RUN disabled.
>>>
>>> When building for the jetway j7f24 target, setting those two options
>>> in menuconfig results in the following error (after "make"):
>>>
>>>
>>>      CC         cpu/intel/microcode/microcode.o
>>>      AR         coreboot.a
>>>      CC         coreboot_ram.o
>>>      CC         coreboot_ram
>>> build/coreboot_ram.o: In function `vga_init':
>>> vga.c:(.text+0x1968): undefined reference to
>>> `mainboard_interrupt_handlers'
>>> collect2: ld returned 1 exit status
>>> make: *** [build/coreboot_ram] Error 1
>>>
>>> With both options enabled make finishes.  I don't know much about
>>> kconfig, so I haven't been able to figure out where the problem is.
>>>
>>> Here is my .config
>>
>> You also need to disable CONFIG_PCI_ROM_RUN.
>>
>> The behavior here was slightly changed over time, so we probably should
>> fix the documentation. We should also fix the code. Compilation errors
>> are not so nice.
>>
>> Stefan
>
> Yes, the documentation does say to disable CONFIG_PCI_ROM_RUN, which  
> I did, but I didn't mention that because it seemed irrelevant.   
> After trying different combinations, I see make fails when  
> CONFIG_VGA_BRIDGE_SETUP is enabled and both CONFIG_PCI_ROM_RUN and  
> CONFIG_VGA_ROM_RUN are disabled (the recommended combination), but  
> works if either _ROM_RUN option is enable. 
>
> Should be fairly simple to fix, so I guess it's time for me to learn  
> how kconfig works.
>
> Rob Austin
>

Patch

Index: src/devices/oprom/Makefile.inc
===================================================================
--- src/devices/oprom/Makefile.inc	(revision 5678)
+++ src/devices/oprom/Makefile.inc	(working copy)
@@ -21,5 +21,11 @@ 
 obj-$(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) += x86_asm.o
 obj-$(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) += x86_interrupts.o
 
+ifneq ($(CONFIG_PCI_OPTION_ROM_RUN_REALMODE),y)
+obj-$(CONFIG_VGA_BRIDGE_SETUP) += x86.o
+obj-$(CONFIG_VGA_BRIDGE_SETUP) += x86_asm.o
+obj-$(CONFIG_VGA_BRIDGE_SETUP) += x86_interrupts.o
+endif
+
 subdirs-$(CONFIG_PCI_OPTION_ROM_RUN_YABEL) += x86emu
 subdirs-$(CONFIG_PCI_OPTION_ROM_RUN_YABEL) += yabel