From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750885AbWFFSOk (ORCPT ); Tue, 6 Jun 2006 14:14:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750894AbWFFSOk (ORCPT ); Tue, 6 Jun 2006 14:14:40 -0400 Received: from pasmtp.tele.dk ([193.162.159.95]:43012 "EHLO pasmtp.tele.dk") by vger.kernel.org with ESMTP id S1750890AbWFFSOj (ORCPT ); Tue, 6 Jun 2006 14:14:39 -0400 Date: Tue, 6 Jun 2006 20:14:37 +0200 From: Sam Ravnborg To: Thomas Glanzmann , LKML Subject: Re: kbuild patch (20a468b51325b3636785a8ca0047ae514b39cbd5) breaks parallels-config Message-ID: <20060606181437.GA17977@mars.ravnborg.org> References: <20060605164950.GB4552@cip.informatik.uni-erlangen.de> <20060605213111.GA15346@mars.ravnborg.org> <20060605222735.GG4552@cip.informatik.uni-erlangen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060605222735.GG4552@cip.informatik.uni-erlangen.de> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 Sam