Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

kbuild patch (20a468b51325b3636785a8ca0047ae514b39cbd5) breaks parallels-config

4 views
Skip to first unread message

Thomas Glanzmann

unread,
Jun 5, 2006, 12:50:14 PM6/5/06
to Sam Ravnborg, LKML
Hello Sam,
I use parallels, a hypervisor based virtual machine, for Linux which
ships with binary kernel modules and a bit of gluecode. After your
commit 20a468b51325b3636785a8ca0047ae514b39cbd5 in the linux kernel the
compilation of this kernel modules ends up in an endless-loop. I don't
think that this is a problem of the kernel build system but the way
paralles does abuse the kernel build system (they use autoconf to
generate a makefile which looks obvious broken). However I tracked the
offending delta down to the following:

(mini) [~/work/linux-2.6] git diff -R
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index acd3b96..e48e60d 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -10,11 +10,12 @@ __build:
# Read .config if it exist, otherwise ignore
-include .config

+include scripts/Kbuild.include
+
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)

-include scripts/Kbuild.include
include scripts/Makefile.lib

ifdef host-progs

If you reverse apply this delta of your patch, it works again. I don't
get what is going wrong here, but maybe you want to have a look at it.

To reproduce:

* Go to http://www.parallels.com/en/download/ and download the packages for your distribution

cd /usr/lib/parallels
./configure
make

if you do this with a recent kernel version (newer than
20a468b51325b3636785a8ca0047ae514b39cbd5) it ends in an endless-loop
otherwise it works.

The broken parallels makefiles are in:

/usr/lib/parallels/drivers/drv_net/linux/Makefile
/usr/lib/parallels/drivers/drv_net/Makefile
/usr/lib/parallels/drivers/drv_virtualnic/Makefile
/usr/lib/parallels/drivers/drv_main/Makefile
/usr/lib/parallels/drivers/hypervisor/Makefile <<<<< This is the first one which breaks. The other follow.
/usr/lib/parallels/drivers/Makefile

I also created a website for my findings: http://thomas.glanzmann.de/parallels/

Thomas [who thanks Linus for git bisect]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Sam Ravnborg

unread,
Jun 5, 2006, 5:31:38 PM6/5/06
to Thomas Glanzmann, LKML
On Mon, Jun 05, 2006 at 06:49:50PM +0200, Thomas Glanzmann wrote:
> Hello Sam,

> To reproduce:
>
> * Go to http://www.parallels.com/en/download/ and download the packages for your distribution
>
> cd /usr/lib/parallels
> ./configure
> make
x86 not supported - and I do not want to dig up my sparc...

>
> The broken parallels makefiles are in:
>
> /usr/lib/parallels/drivers/drv_net/linux/Makefile
> /usr/lib/parallels/drivers/drv_net/Makefile
> /usr/lib/parallels/drivers/drv_virtualnic/Makefile
> /usr/lib/parallels/drivers/drv_main/Makefile
> /usr/lib/parallels/drivers/hypervisor/Makefile <<<<< This is the first one which breaks. The other follow.
> /usr/lib/parallels/drivers/Makefile

Can you please provide a copy of:
-> The offending Makfile
-> The exact command executed to build the module

Sam

Thomas Glanzmann

unread,
Jun 5, 2006, 6:28:44 PM6/5/06
to Sam Ravnborg, LKML
Hello Sam,

> x86 not supported - and I do not want to dig up my sparc...

this are all x86:

http://download.parallels.com/GA/Parallels-2.1.1670-lin.i386.rpm
http://download.parallels.com/GA/Parallels-2.1.1670-lin.deb
http://download.parallels.com/GA/Parallels-2.1.1670-lin.tgz
http://download.parallels.com/GA/Parallels-workstation.ebuild.tar.gz

> Can you please provide a copy of:
> -> The offending Makfile
> -> The exact command executed to build the module

a tgz of my /usr/lib/parallels is at
http://wwwcip.informatik.uni-erlangen.de/~sithglan/parallels/parallels.tgz (14M)

one offending Makefile attached.

this happens when I use the vanilla linux kernel without the patch:

(mini) [/usr/lib/parallels] ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets ${MAKE}... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether make sets ${MAKE}... (cached) yes
checking build system type... i686-pc-linux
checking host system type... i686-pc-linux
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... pass_all
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking for gcc option to accept ANSI C... none needed
checking for inline... inline
checking Check for primary OS type... Linux
checking Linux kernel version... 2.6.x
checking kernel sources... ok (/lib/modules/2.6.17-rc5/build)
checking abnormal 2.4.20 remap_page_range... remap_page_range not need vma struct
checking freezing kthreads patch... no
checking scheduling problems... schedule has sleep calculations
checking mmu_cr4_features address... cat: /proc/ksyms: No such file or directory
0x7858e670
checking for x86 platform... not a x86 platform
checking for Fedora Core stock kernel... not stock kernel used
configure: creating ./config.status
config.status: creating Makefile
config.status: creating drivers/Makefile
config.status: creating drivers/hypervisor/Makefile
config.status: creating drivers/drv_main/Makefile
config.status: creating drivers/drv_net/Makefile
config.status: creating drivers/drv_net/linux/Makefile
config.status: creating drivers/drv_virtualnic/Makefile
config.status: executing depfiles commands
(mini) [/usr/lib/parallels] make
Making all in drivers
make[1]: Entering directory `/usr/lib/parallels/drivers'
Making all in .
make[2]: Entering directory `/usr/lib/parallels/drivers'
=> Patching modules makefiles for 2.6.x kernel ...
for i in hypervisor/Makefile drv_main/Makefile drv_net/linux/Makefile drv_virtualnic/Makefile; do \
sed s/CFLAGS\ =/CFLAGS\ :=\ \$\(CFLAGS\)/ $i | \
sed s/obj_m/obj-m/ | \
sed s/hypervisor_objs/hypervisor-objs/ | \
sed s/vm_main_objs/vm-main-objs/ | \
sed s/vm_bridge_objs/vm-bridge-objs/ | \
sed s/vmvirtualnic_objs/vmvirtualnic-objs/ | \
sed s/_extra_ldflags\ =/EXTRA_LDFLAGS+=/ | \
sed s/_extra_cflags\ =/EXTRA_CFLAGS+=/ | \
sed s/include\ .\\/\$\(DEPDIR\)/#/ > $i.t; mv -f $i.t $i;\
done
cp -f drv_main/common/md5.c hypervisor/;
cp -f drv_main/common/utils.c hypervisor/;
make[2]: Leaving directory `/usr/lib/parallels/drivers'
Making all in hypervisor
make[2]: Entering directory `/usr/lib/parallels/drivers/hypervisor'
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/usr/lib/parallels/drivers/hypervisor SRCROOT=/usr/lib/parallels/drivers/hypervisor modules && mv -f hypervisor.ko hypervisor.o
make[3]: Entering directory `/home/sithglan/work/linux-2.6'
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/home/sithglan/work/linux-2.6 SRCROOT=/home/sithglan/work/linux-2.6 modules && mv -f hypervisor.ko hypervisor.o

### I press ctrl-c here ####

make[16]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[15]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[14]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[13]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[12]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[11]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[10]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[9]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[8]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[7]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[6]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[5]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[4]: *** [/usr/lib/parallels/drivers/hypervisor/hypmain.o] Interrupt
make[3]: *** [_module_/usr/lib/parallels/drivers/hypervisor] Interrupt
make[2]: *** [hypervisor] Interrupt
make[1]: *** [all-recursive] Interrupt
make: *** [all-recursive] Interrupt

and it works when I have the patch (http://thomas.glanzmann.de/parallels/patch) applied:

(mini) [/usr/lib/parallels] make
Making all in drivers
make[1]: Entering directory `/usr/lib/parallels/drivers'
Making all in .
make[2]: Entering directory `/usr/lib/parallels/drivers'
=> Patching modules makefiles for 2.6.x kernel ...
for i in hypervisor/Makefile drv_main/Makefile drv_net/linux/Makefile drv_virtualnic/Makefile; do \
sed s/CFLAGS\ =/CFLAGS\ :=\ \$\(CFLAGS\)/ $i | \
sed s/obj_m/obj-m/ | \
sed s/hypervisor_objs/hypervisor-objs/ | \
sed s/vm_main_objs/vm-main-objs/ | \
sed s/vm_bridge_objs/vm-bridge-objs/ | \
sed s/vmvirtualnic_objs/vmvirtualnic-objs/ | \
sed s/_extra_ldflags\ =/EXTRA_LDFLAGS+=/ | \
sed s/_extra_cflags\ =/EXTRA_CFLAGS+=/ | \
sed s/include\ .\\/\$\(DEPDIR\)/#/ > $i.t; mv -f $i.t $i;\
done
cp -f drv_main/common/md5.c hypervisor/;
cp -f drv_main/common/utils.c hypervisor/;
make[2]: Leaving directory `/usr/lib/parallels/drivers'
Making all in hypervisor
make[2]: Entering directory `/usr/lib/parallels/drivers/hypervisor'
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/usr/lib/parallels/drivers/hypervisor SRCROOT=/usr/lib/parallels/drivers/hypervisor modules && mv -f hypervisor.ko hypervisor.o
make[3]: Entering directory `/home/sithglan/work/linux-2.6'
CC [M] /usr/lib/parallels/drivers/hypervisor/logging.o
CC [M] /usr/lib/parallels/drivers/hypervisor/pages.o
CC [M] /usr/lib/parallels/drivers/hypervisor/utils.o
CC [M] /usr/lib/parallels/drivers/hypervisor/md5.o
LD [M] /usr/lib/parallels/drivers/hypervisor/hypervisor.o
Building modules, stage 2.
MODPOST
LD [M] /usr/lib/parallels/drivers/hypervisor/hypervisor.ko
make[3]: Leaving directory `/home/sithglan/work/linux-2.6'
make[2]: Leaving directory `/usr/lib/parallels/drivers/hypervisor'
Making all in drv_main
make[2]: Entering directory `/usr/lib/parallels/drivers/drv_main'
mkdir -p .deps/mm .deps/common
for i in vmmain.o vmproc.o device.o dwrap.o intgate.o ioctls.o monexport.o mm/manager.o mm/pages.o mm/collector.o mm/monmem.o mm/wset.o common/bma.o common/logging.o common/timer.o common/idata.o common/utils.o common/md5.o; do \
if test -e `basename $i`; then \
cp -f `basename $i` mm/`basename $i` > /dev/null 2>&1; \
cp -f `basename $i` common/`basename $i` > /dev/null 2>&1; \
fi; done
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/usr/lib/parallels/drivers/drv_main SRCROOT=/usr/lib/parallels/drivers/drv_main modules && mv -f vm-main.ko vm-main.o
make[3]: Entering directory `/home/sithglan/work/linux-2.6'
Building modules, stage 2.
MODPOST
WARNING: "hypervisorPresentInSystem" [/usr/lib/parallels/drivers/drv_main/vm-main.ko] undefined!
WARNING: "appDecCounter" [/usr/lib/parallels/drivers/drv_main/vm-main.ko] undefined!
WARNING: "appIncCounter" [/usr/lib/parallels/drivers/drv_main/vm-main.ko] undefined!
LD [M] /usr/lib/parallels/drivers/drv_main/vm-main.ko
make[3]: Leaving directory `/home/sithglan/work/linux-2.6'
make[2]: Leaving directory `/usr/lib/parallels/drivers/drv_main'
Making all in drv_net
make[2]: Entering directory `/usr/lib/parallels/drivers/drv_net'
Making all in linux
make[3]: Entering directory `/usr/lib/parallels/drivers/drv_net/linux'
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/usr/lib/parallels/drivers/drv_net/linux modules && mv -f vm-bridge.ko vm-bridge.o
make[4]: Entering directory `/home/sithglan/work/linux-2.6'
Building modules, stage 2.
MODPOST
WARNING: /usr/lib/parallels/drivers/drv_net/linux/vm-bridge.o - Section mismatch: reference to .init.text:init_module from .gnu.linkonce.this_module after '__this_module' (at offset 0xcc)
WARNING: /usr/lib/parallels/drivers/drv_net/linux/vm-bridge.o - Section mismatch: reference to .exit.text:cleanup_module from .gnu.linkonce.this_module after '__this_module' (at offset 0x30c)
LD [M] /usr/lib/parallels/drivers/drv_net/linux/vm-bridge.ko
make[4]: Leaving directory `/home/sithglan/work/linux-2.6'
make[3]: Leaving directory `/usr/lib/parallels/drivers/drv_net/linux'
make[3]: Entering directory `/usr/lib/parallels/drivers/drv_net'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/usr/lib/parallels/drivers/drv_net'
make[2]: Leaving directory `/usr/lib/parallels/drivers/drv_net'
Making all in drv_virtualnic
make[2]: Entering directory `/usr/lib/parallels/drivers/drv_virtualnic'
make -C /lib/modules/2.6.17-rc5/build SUBDIRS=/usr/lib/parallels/drivers/drv_virtualnic modules && mv -f vmvirtualnic.ko vmvirtualnic.o
make[3]: Entering directory `/home/sithglan/work/linux-2.6'
Building modules, stage 2.
MODPOST
WARNING: /usr/lib/parallels/drivers/drv_virtualnic/vmvirtualnic.o - Section mismatch: reference to .init.text:init_module from .gnu.linkonce.this_module after '__this_module' (at offset 0xcc)
WARNING: /usr/lib/parallels/drivers/drv_virtualnic/vmvirtualnic.o - Section mismatch: reference to .exit.text:cleanup_module from .gnu.linkonce.this_module after '__this_module' (at offset 0x30c)
LD [M] /usr/lib/parallels/drivers/drv_virtualnic/vmvirtualnic.ko
make[3]: Leaving directory `/home/sithglan/work/linux-2.6'
make[2]: Leaving directory `/usr/lib/parallels/drivers/drv_virtualnic'
make[1]: Leaving directory `/usr/lib/parallels/drivers'
make[1]: Entering directory `/usr/lib/parallels'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/lib/parallels'

Thomas

Makefile

Sam Ravnborg

unread,
Jun 6, 2006, 2:15:13 PM6/6/06
to Thomas Glanzmann, LKML
On Tue, Jun 06, 2006 at 12:27:35AM +0200, Thomas Glanzmann wrote:

> one offending Makefile attached.
>
..
First off - the below does not even remotely resemble a Kbuild file.
There are a shitload of deinitions not used by kbuild etc etc.
Parallels should ship a Kbuild file instead with the kernel specific
things included and be done with it.
This works for others and they do not need to generate their
Makefile using autotools.

>
> # Makefile.in generated by automake 1.6.3 from Makefile.am.
> # drivers/hypervisor/Makefile. Generated from Makefile.in by configure.
>
> # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
> # Free Software Foundation, Inc.
> # This Makefile.in is free software; the Free Software Foundation
> # gives unlimited permission to copy and/or distribute it,
> # with or without modifications, as long as this notice is preserved.
>
> # This program is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
> # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
> # PARTICULAR PURPOSE.
>
>
>
> #############################################################
> # Copyright (C) 2004 Parallels Inc. All Rights Reserved.
> #############################################################
> SHELL = /bin/sh
>
> srcdir = .
> top_srcdir = ../..
>
> prefix = /usr/local
> exec_prefix = ${prefix}
>
> bindir = ${exec_prefix}/bin
> sbindir = ${exec_prefix}/sbin
> libexecdir = ${exec_prefix}/libexec
> datadir = ${prefix}/share
> sysconfdir = ${prefix}/etc
> sharedstatedir = ${prefix}/com
> localstatedir = ${prefix}/var
> libdir = ${exec_prefix}/lib
> infodir = ${prefix}/info
> mandir = ${prefix}/man
> includedir = ${prefix}/include
> oldincludedir = /usr/include
> pkgdatadir = $(datadir)/pvs
> pkglibdir = $(libdir)/pvs
> pkgincludedir = $(includedir)/pvs
> top_builddir = ../..
>
> ACLOCAL = ${SHELL} /usr/lib/parallels/missing --run aclocal-1.6
> AUTOCONF = ${SHELL} /usr/lib/parallels/missing --run autoconf
> AUTOMAKE = ${SHELL} /usr/lib/parallels/missing --run automake-1.6
> AUTOHEADER = ${SHELL} /usr/lib/parallels/missing --run autoheader
>
> am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
> INSTALL = /usr/bin/install -c
> INSTALL_PROGRAM = ${INSTALL}
> INSTALL_DATA = ${INSTALL} -m 644
> install_sh_DATA = $(install_sh) -c -m 644
> install_sh_PROGRAM = $(install_sh) -c
> install_sh_SCRIPT = $(install_sh) -c
> INSTALL_SCRIPT = ${INSTALL}
> INSTALL_HEADER = $(INSTALL_DATA)
> transform = s,x,x,
> NORMAL_INSTALL = :
> PRE_INSTALL = :
> POST_INSTALL = :
> NORMAL_UNINSTALL = :
> PRE_UNINSTALL = :
> POST_UNINSTALL = :
> host_alias = i686-pc-linux
> host_triplet = i686-pc-linux
>
> EXEEXT =
> OBJEXT = o
> PATH_SEPARATOR = :
> AMTAR = ${SHELL} /usr/lib/parallels/missing --run tar
> ARCH_F = -march=pentium2
> AS = @AS@
> AWK = mawk
> CC = gcc
> CC_WARN =
> CXX = g++
> DEPDIR = .deps
> DLLTOOL = @DLLTOOL@
> ECHO = echo
> INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
> KERNEL_VER = 26
> LIBTOOL = $(SHELL) $(top_builddir)/libtool
> LN_S = ln -s
> MAINT = #
> MAKE_CLEAN = clean-linux
> MAKE_FILE = make
> MAKE_TARGET = make-linux
> MISCFLAGS := $(CFLAGS)
> MOD_EXT = ko
> OBJDUMP = @OBJDUMP@
> OS_BASEDIR = /lib/modules/2.6.17-rc5/build
> OS_SRC = /lib/modules/2.6.17-rc5/build
> PACKAGE = pvs
> PREFX = f
> RANLIB = ranlib
> STRIP = strip
> TARGET_OS = LINUX
> VERSION = 2.1.0
> am__include = include
> am__quote =
> install_sh = /usr/lib/parallels/install-sh
> topdir = /usr/lib/parallels
>
> INCLUDES = -I$(top_srcdir)/Include -I. -I$(OS_SRC)/include \
> -I$(topdir)/Private/Include/ -I/usr/src/linux -I$(topdir)/include \
> -I$(topdir)/drivers/hypervisor/ \
> -I$(topdir)/drivers/drv_main/ \
> -I$(topdir)/drivers/drv_main/common/ \
> -I$(topdir)/drivers/drv_main/compat/ \
> -I$(topdir)/drivers/drv_main/mm/
>
>
> COMPILE = $(CC) $(INCLUDES) $(AM_CFLAGS)
>
> bin_PROGRAMS = hypervisor
> SRCROOT = .
>
> OBJECTS = hypmain.o \
> hdevice.o \
> hioctls.o \
> hypvmstate.o \
> interrupt.o \
> hypercall.o \
> hypcalls.o \
> decode.o \
> posidt.o \
> hypidtemul.o \
> logging.o \
> pages.o \
> utils.o \
> md5.o \
> vtx_init.o \
> HyperSwitch.obj
>
>
> AM_CFLAGS := $(CFLAGS) -D__KERNEL__ -DMODULE -D_FILE_OFFSET_BITS=64 -fno-exceptions \
> -fno-strength-reduce -pipe $(ARCH_F) \
> -$(PREFX)align-loops=2 -$(PREFX)align-jumps=2 -$(PREFX)align-functions=2 \
> -fno-exceptions -DCPU=686 -D_LINUX_ $(ABNORMAL_REMAP) $(CFLAGS) \
> -D_HYPERVISOR_
>
>
> AM_LDFLAGS =
>
>
> # 26 kernel
> EXTRA_LDFLAGS+= $(AM_LDFLAGS)
> EXTRA_CFLAGS+= $(ABNORMAL_REMAP) $(INCLUDES) -I$(topdir)/Include -I$(topdir)/Private/Include \
> -I$(SRCROOT)/ $(AM_CFLAGS)
This is all wrong. Several of these flags are either kernel specific or
impacts the ABI of the compiler.
Provide only defines and no more.

>
>
> hypervisor-objs := $(OBJECTS)
> obj-m := hypervisor.o
>
> cmd = $(MAKE) -C $(OS_BASEDIR) SUBDIRS=$(shell pwd) SRCROOT=$(shell pwd) modules && \
> mv -f hypervisor.ko hypervisor.o

Overriding the kbuild defined variable "cmd" is most probarly what is
causing the visible problems - but the real problem is that sutotools
are used for something they should not be used for.
What your patch did was to remove a fundamental part of the build system
- and I'm suprised that you actually managed to build something.


I suggest that you ask the Parallels people to create a clean solution
for the 2.6 kernel - seeking inspiration in Documentation/kbuild/*
and when this works tweak it minimally to support the 2.4 kernel.

Doing it the other way around is no good and will most often result in a
worse soluiton.

Parallels can pas Parallels specific options to kbuild using a dedicated
variable like this:
make -C dir PARALLELS_DEFS="Bla Bla" SUBDIRS=... modules

Thomas Glanzmann

unread,
Jun 6, 2006, 2:36:13 PM6/6/06
to Sam Ravnborg, LKML
Hello,

> First off - the below does not even remotely resemble a Kbuild file.
> There are a shitload of deinitions not used by kbuild etc etc.
> Parallels should ship a Kbuild file instead with the kernel specific
> things included and be done with it. This works for others and they
> do not need to generate their Makefile using autotools.

agreed.

> What your patch did was to remove a fundamental part of the build system
> - and I'm suprised that you actually managed to build something.

my patch does not removes anything it just moves one line a few lines
down (as it was before your commit 20a468b51325b...:

--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -10,12 +10,11 @@ __build:


# Read .config if it exist, otherwise ignore
-include .config

| -include scripts/Kbuild.include
| -
/ # The filename Kbuild has precedence over Makefile
/ kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))


| include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)

\
`-> +include scripts/Kbuild.include
include scripts/Makefile.lib

ifdef host-progs

> I suggest that you ask the Parallels people to create a clean solution


> for the 2.6 kernel - seeking inspiration in Documentation/kbuild/*
> and when this works tweak it minimally to support the 2.4 kernel.

I will.

Thomas

0 new messages