[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Error compiling 2.6.8 kernel for amd64 - cannot find pci.h



On Wed, Jul 20, 2005 at 12:39:23PM +0200, Erik Mouw wrote:
> On Wed, Jul 20, 2005 at 03:31:13AM -0700, Gregory Margo wrote:
> > I'm trying to compile the Sarge kernel for amd64.
> > I have a dual Xeon system running Debian Stable for amd64, with the kernel
> >     kernel-image-2.6.8-11-em64t-p4-smp   2.6.8-14 
> > 
> > I have installed the source package 
> >     kernel-source-2.6.8     2.6.8-16  
> > 
> > As a first test I just attempted to duplicate the compile to make
> > sure all the tools are installed, so I extracted the kernel source
> > and created a build directory, did a "make O=... menuconfig" and "make O=... "
> > (Using the O= option to point to the build directory)
> > 
> > I made no changes in the menuconfig, and it picked up the config
> > file from /boot for defaults (/boot/config-2.6.8-11-em64t-p4-smp)
> 
> When using a config from a different kernel, you should use "make
> oldconfig" before running "make {menu|x|g|k}config".

I didn't do anything special, the "make menuconfig" step grabbed
the config file to use as defaults.  Just to verify, I did
"make menuconfig" again (on a clean build dir) followed by a
"make oldconfig".  The resulting .config file (from both steps)
is identical to /boot/config-2.6.8-11-em64t-p4-smp.


> 
> > But the compile fails because it can't find pci.h.
> > I only see a pci.h in the i386 arch directory, not for x86_64.
> > 
> > Am I doing something wrong?
> 
> I don't know, you didn't supply enough information for us to figure
> out. What's the output from "gcc -v"? Could you c


gmargo@nut 523$ gcc -v
Reading specs from /usr/lib/gcc-lib/x86_64-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib x86_64-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)


> 
> > Is there a secret step or missing link for amd64 that's not documented?
> 
> There is no secret.
> 
> > Here is the error:
> > 
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:10:17: pci.h: No such file or directory
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c: In function `pci_mmcfg_init':
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:79: error: `pci_probe' undeclared (first use in this function)
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:79: error: (Each undeclared identifier is reported only once
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:79: error: for each function it appears in.)
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:79: error: `PCI_PROBE_MMCONF' undeclared (first use in this function)
> > /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c:93: error: `PCI_PROBE_MASK' undeclared (first use in this function)
> 
> Not enough information. Please run "make V=1 O=..." and post the
> complete error including the gcc command that was used to compile
> mmconfig.c.
> 


Now compiling with the V=1 option ...
I think I see the problem ...

Here is the gcc command line.  Note that the extra include path
added by the Makefile in arch/x86_64/pci has a space between the
-I and the arch/i386/pci.


  gcc -Wp,-MD,arch/x86_64/pci/.mmconfig.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Iinclude2 -I/usr/src/gm/kernel-source-2.6.8.work/include -I/usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci -Iarch/x86_64/pci -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -march=nocona -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -fomit-frame-pointer -I/usr/src/gm/kernel-source-2.6.8.work/ -I arch/i386/pci  -DKBUILD_BASENAME=mmconfig -DKBUILD_MODNAME=mmconfig -c -o arch/x86_64/pci/.tmp_mmconfig.o /usr/src/gm/kernel-source-2.6.8.work/arch/x86_64/pci/mmconfig.c


I'll try changing arch/x86_64/pci/Makefile to remove that space ... Works!

Here is the patch I applied to the Makefile:

--- arch/x86_64/pci/Makefile.00 2004-08-13 22:36:17.000000000 -0700
+++ arch/x86_64/pci/Makefile    2005-07-20 04:15:13.147922899 -0700
@@ -3,7 +3,7 @@
 #
 # Reuse the i386 PCI subsystem
 #
-CFLAGS += -I arch/i386/pci
+CFLAGS += -Iarch/i386/pci
 
 obj-y          := i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o


How can it be that the shipped kernel source is not compilable?
Makes me wonder what else is different.
Now I will go on to the make-kpkg step and then try booting on
this kernel.


-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gregory H. Margo



Reply to: