powerpc: Fix build failure for PPC_32
PATCH 1/1 powerpc: Fix build failure for PPC_32
Fix ppc 32 build failure as reported here:
http://kisskb.ellerman.id.au/kisskb/buildresult/11663513/
The error is that pci_32.o was not being built for PPC_32. Fix error by adding it in the Makefile. Tested using the ppc cross compiler.
--- arch/powerpc/kernel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/Makefile +1 -1
@@ -89,7 +89,7 @@ extra-y += vmlinux.lds obj-$(CONFIG_RELOCATABLE_PPC32) += reloc_32.o -obj-$(CONFIG_PPC32) += entry_32.o setup_32.o +obj-$(CONFIG_PPC32) += entry_32.o setup_32.o pci_32.o obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_MODULES) += ppc_ksyms.o
Signature · 1 line
1.9.1
Hi Pranith,
Quoted 3 lines · Pranith Kumar
Fix ppc 32 build failure as reported here:
| arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev' undeclared (first use in this function)
| make[3]: *** [drivers/block/floppy.o] Error 1
The definition of isa_bridge_pcidev is only available if CONFIG_PCI=y...
Quoted 2 lines
The error is that pci_32.o was not being built for
PPC_32. Fix error by adding it in theMakefile. Tested using the ppc cross compiler.
... so how can adding this make the floppy.h error go away?
Note that arch/powerpc/kernel/Makefile does add pci_$(CONFIG_WORD_SIZE).o, but only if CONFIG_PCI=y.
So, thanks for your patch, but I don't think your fix is the right solution.
However, drivers/block/floppy.o is enabled by BLK_DEV_FD, which depends on ARCH_MAY_HAVE_PC_FDC.
arch/powerpc/Kconfig has:
config ARCH_MAY_HAVE_PC_FDC
bool
default !PPC_PSERIES || PCIPCI is not set, and PPC_PSERIES is also not set, so this defaults to y, which is obviously not correct, as floppy.h needs PCI.
As this symbol doesn't enable floppy support in-se, probably it should just be:
config ARCH_MAY_HAVE_PC_FDC
bool
depends on PCI
This config line was last touched by
commit bed59275810a55500e885cbdc5c2a0507f13c00e
Author: Stephen Rothwell <[email protected]> Date: Sun Mar 4 17:04:44 2007 +1100
[POWERPC] Allow pSeries to build without CONFIG_PCI
Quoted 12 lines
Signed-off-by Pranith Kumar <[email protected]>Reported-by Geert Uytterhoeven <[email protected]>CC Andrew Morton <[email protected]>--- arch/powerpc/kernel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/kernel/Makefile +0
-0
arch/powerpc/kernel/Makefile extra-y += vmlinux.lds · line 95
Quoted 8 lines
arch/powerpc/kernel/Makefile +1
-1@@ -89,7 +89,7 @@ extra-y += vmlinux.lds obj-$(CONFIG_RELOCATABLE_PPC32) += reloc_32.o -obj-$(CONFIG_PPC32) += entry_32.o setup_32.o +obj-$(CONFIG_PPC32) += entry_32.o setup_32.o pci_32.o obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_MODULES) += ppc_ksyms.o
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 12 lines · Geert Uytterhoeven
Hi Pranith,
Quoted 3 lines · Pranith Kumar
Fix ppc 32 build failure as reported here:
|
arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev' undeclared (first use in this function)
| make[3]: *** [drivers/block/floppy.o] Error 1
Quoted 8 lines
The definition of
isa_bridge_pcidevis only available ifCONFIG_PCI=y...Quoted 1 line
The error is that pci_32.o was not being built for
PPC_32. Fix error byadding
Quoted 1 line
it in the
Makefile. Tested using the ppc cross compiler.... so how can adding this make the
floppy.herror go away?
So the definition which you are talking about within CONFIG_PCI=y is an extern definition
arch/powerpc/include/asm/ppc-pci.h:28:extern struct pci_dev *isa_bridge_pcidev;
If you build pci_32.o unconditionally, there is an
EXPORT_SYMBOL(isa_bridge_pcidev);
which supplies the required symbol.
But yes, you are right in that we should not unconditionally compile pci_32.o. Making floppy depend on PCI is the right thing to do. However,
Quoted 19 lines
Note that
arch/powerpc/kernel/Makefiledoes add pci_$(CONFIG_WORD_SIZE).o, but only ifCONFIG_PCI=y.So, thanks for your patch, but I don't think your fix is the right solution.
However,
drivers/block/floppy.ois enabled byBLK_DEV_FD, which depends onARCH_MAY_HAVE_PC_FDC.
arch/powerpc/Kconfighas:config
ARCH_MAY_HAVE_PC_FDCbool default !PPC_PSERIES || PCIPCI is not set, and
PPC_PSERIESis also not set, so this defaults to y, which is obviously not correct, asfloppy.hneeds PCI.
Quoted 7 lines
As this symbol doesn't enable floppy support in-se, probably it should just be:
config
ARCH_MAY_HAVE_PC_FDC
bool
depends on PCI
the right thing I guess here is to depend on !PPC_PSERIES && PCI since I guess pSeries does not support floppy.h (hence the original condition check?).
Note that there are other unrelated errors which do not let me complete the PPC 32 build with the config there yet. I just verified this symbol error.
Quoted 10 lines
This config line was last touched by
commitbed59275810a55500e885cbdc5c2a0507f13c00eAuthor: Stephen Rothwell <[email protected]> Date: Sun Mar 4 17:04:44 2007 +1100[POWERPC] Allow pSeries to build without
CONFIG_PCISigned-off-by Stephen Rothwell <[email protected]>Signed-off-by Paul Mackerras <[email protected]>
Signature · 1 line
Pranith
Hi Pranith,
Quoted 23 lines · Pranith Kumar
Quoted 10 lines · Geert Uytterhoeven
Quoted 3 lines · Pranith Kumar
Fix ppc 32 build failure as reported here:
|
arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev' undeclared (first use in this function)
| make[3]: *** [drivers/block/floppy.o] Error 1Quoted 7 lines
The definition of
isa_bridge_pcidevis only available ifCONFIG_PCI=y...Quoted 3 lines
The error is that pci_32.o was not being built for
PPC_32. Fix error by adding
it in theMakefile. Tested using the ppc cross compiler.... so how can adding this make the
floppy.herror go away?So the definition which you are talking about within
CONFIG_PCI=yis an extern definition
Quoted 8 lines
arch/powerpc/include/asm/ppc-pci.h:28:extern struct
pci_dev*isa_bridge_pcidev;If you build pci_32.o unconditionally, there is an
EXPORT_SYMBOL(isa_bridge_pcidev);which supplies the required symbol.
Yes, but the error in floppy.h is from the compiler, not from the linker. Supplying the symbol for the linker doesn't help the compiler when building floppy.c.
Quoted 25 lines
But yes, you are right in that we should not unconditionally compile pci_32.o. Making floppy depend on PCI is the right thing to do. However,
Quoted 23 lines
Note that
arch/powerpc/kernel/Makefiledoes add pci_$(CONFIG_WORD_SIZE).o, but only ifCONFIG_PCI=y.So, thanks for your patch, but I don't think your fix is the right solution.
However,
drivers/block/floppy.ois enabled byBLK_DEV_FD, which depends onARCH_MAY_HAVE_PC_FDC.
arch/powerpc/Kconfighas:config
ARCH_MAY_HAVE_PC_FDCbool default !PPC_PSERIES || PCIPCI is not set, and
PPC_PSERIESis also not set, so this defaults to y, which is obviously not correct, asfloppy.hneeds PCI.As this symbol doesn't enable floppy support in-se, probably it should just
be:
Quoted 7 lines
Quoted 3 lines
config
ARCH_MAY_HAVE_PC_FDC
bool
depends on PCIthe right thing I guess here is to depend on !PPC_PSERIES && PCI since I guess pSeries does not support
floppy.h(hence the original condition check?).
Note that PowerPC supports multi-platform kernels.
A kernel with PPC_PSERIES and something else with PCI may still want to have floppy support.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 4 lines · Geert Uytterhoeven
Note that PowerPC supports multi-platform kernels.
A kernel withPPC_PSERIESand something else with PCI may still want to have floppy support.
OK, I tested with your change and it works. I needed to make one more change for it compile all the way through though.
I will send both of the patches shortly.
Signature · 1 line
Pranith