Re: kbuild patch (20a468b51325b3636785a8ca0047ae514b39cbd5) breaks parallels-config

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

 



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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux