2005-10-11 22:28:57

by Adam Litke

[permalink] [raw]
Subject: 2.6.14-rc4 ACPI/PCI compile problem

Ok I'll admit I've known about this since at least 2.6.14-rc2-git5 but
it may have been around longer. Long enough for me to speak up.

I am getting the following compile errors when building 2.6.14-rc4 for
i386:

> LD .tmp_vmlinux1
> drivers/built-in.o(.text+0x235f9): In function `acpi_pci_root_add':
> /home/aglitke/views/acpi-compile-fix-2.6.14-rc4/current/drivers/acpi/pci_root.c:274: undefined reference to `pci_acpi_scan_root'
> make[1]: *** [.tmp_vmlinux1] Error 1
> make: *** [_all] Error 2

gcc version 3.3.5 (Debian 1:3.3.5-13)
GNU ld version 2.15
.config attached

--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


Attachments:
config-broken-acpi (21.94 kB)

2005-10-11 23:17:12

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [ACPI] 2.6.14-rc4 ACPI/PCI compile problem

On Tuesday 11 October 2005 4:28 pm, Adam Litke wrote:
> Ok I'll admit I've known about this since at least 2.6.14-rc2-git5 but
> it may have been around longer. Long enough for me to speak up.
>
> I am getting the following compile errors when building 2.6.14-rc4 for
> i386:
>
> > LD .tmp_vmlinux1
> > drivers/built-in.o(.text+0x235f9): In function `acpi_pci_root_add':
> > /home/aglitke/views/acpi-compile-fix-2.6.14-rc4/current/drivers/acpi/pci_root.c:274: undefined reference to `pci_acpi_scan_root'
> > make[1]: *** [.tmp_vmlinux1] Error 1
> > make: *** [_all] Error 2

Please try the following patch and confirm whether it works.


[i386 kbuild] Don't clobber pci-y when X86_VISWS or X86_NUMAQ

Previously, enabling CONFIG_X86_VISWS or CONFIG_X86_NUMAQ
clobbered any previous contents of pci-y, because they used
":=" instead of "+=".

Signed-off-by: Bjorn Helgaas <[email protected]>

diff -r ed3231e577f5 arch/i386/pci/Makefile
--- a/arch/i386/pci/Makefile Tue Oct 11 19:03:47 2005
+++ b/arch/i386/pci/Makefile Tue Oct 11 15:47:09 2005
@@ -8,7 +8,7 @@
pci-$(CONFIG_ACPI) += acpi.o
pci-y += legacy.o irq.o

-pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
-pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o
+pci-$(CONFIG_X86_VISWS) += visws.o fixup.o
+pci-$(CONFIG_X86_NUMAQ) += numa.o irq.o

obj-y += $(pci-y) common.o

2005-10-12 14:34:36

by Adam Litke

[permalink] [raw]
Subject: Re: [ACPI] 2.6.14-rc4 ACPI/PCI compile problem

On Tue, 2005-10-11 at 17:17 -0600, Bjorn Helgaas wrote:
> On Tuesday 11 October 2005 4:28 pm, Adam Litke wrote:
> > Ok I'll admit I've known about this since at least 2.6.14-rc2-git5 but
> > it may have been around longer. Long enough for me to speak up.
> >
> > I am getting the following compile errors when building 2.6.14-rc4 for
> > i386:
> >
> > > LD .tmp_vmlinux1
> > > drivers/built-in.o(.text+0x235f9): In function `acpi_pci_root_add':
> > > /home/aglitke/views/acpi-compile-fix-2.6.14-rc4/current/drivers/acpi/pci_root.c:274: undefined reference to `pci_acpi_scan_root'
> > > make[1]: *** [.tmp_vmlinux1] Error 1
> > > make: *** [_all] Error 2
>
> Please try the following patch and confirm whether it works.

Yep, that fixes it, thanks.

--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

2005-10-12 18:00:54

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [ACPI] 2.6.14-rc4 ACPI/PCI compile problem

On Tue, Oct 11, 2005 at 05:17:01PM -0600, Bjorn Helgaas wrote:
> Please try the following patch and confirm whether it works.
>
> [i386 kbuild] Don't clobber pci-y when X86_VISWS or X86_NUMAQ
>
> Previously, enabling CONFIG_X86_VISWS or CONFIG_X86_NUMAQ
> clobbered any previous contents of pci-y, because they used
> ":=" instead of "+=".

This isn't correct. We want to get rid of some of the current contents
of pci-y when NUMAQ or VISWS are enabled. I'm not quite sure what the
right fix is here. Maybe something like ...

--- arch/i386/pci/Makefile 14 Sep 2005 12:54:20 -0000 1.3
+++ arch/i386/pci/Makefile 12 Oct 2005 17:51:19 -0000
@@ -4,11 +4,11 @@ obj-$(CONFIG_PCI_BIOS) += pcbios.o
obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o
obj-$(CONFIG_PCI_DIRECT) += direct.o

-pci-y := fixup.o
-pci-$(CONFIG_ACPI) += acpi.o
-pci-y += legacy.o irq.o
+acpi-$(CONFIG_ACPI) := acpi.o
+
+pci-y := fixup.o $(acpi-y) legacy.o irq.o

pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
-pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o
+pci-$(CONFIG_X86_NUMAQ) := numa.o $(acpi-y) irq.o

obj-y += $(pci-y) common.o

This mess really needs some more eyes on it. For example, should fixups.o
really be enabled on visws but disabled on numaq? I suspect both want
legacy.o disabled. Does it make sense to enable ACPI on a NUMAQ system?
I don't know enough about them.

And it /really/ needs some commentary. Here's my first cut at it, based
on my memories of editing it several years ago:

# A little more complex than most Makefiles.
# Neither the VISWS nor the NUMAQ configs want to see legacy.o compiled in.
# VISWS doesn't have ACPI to worry about, but NUMAQ might
# Order is important -- don't rearrange the order of files here.

Help most gratefully received from people who really understand these boxes!