Commit Graph

130 Commits

Author SHA1 Message Date
David Woodhouse
8d730cfb50 Basic implementation of 'make headers_install'
This adds a make target which exports a subset of headers which contain
definitions which are useful for system libraries and tools. It uses the
BSD 'unifdef' tool to remove instances of #ifdef __KERNEL__, and uses
sed to remove markers like __user.

Based on an original implementation by Arnd Bergmann <arnd@arndb.de>
Hacked about by David Woodhouse <dwmw2@infradead.org>
Reviewed and cleaned up by Sam Ravnborg <sam@ravnborg.org>

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-06-18 11:58:39 +01:00
Linus Torvalds
d8c3291c73 Linux v2.6.17-rc4 2006-05-11 16:31:53 -07:00
Jan Beulich
fd5f0cd6b0 kbuild: Do not overwrite makefile as anohter user
Change the conditional of the outputmakefile rule to be evaluated entirely
in make, and add a conditional to not touch the generated makefile when e.g.
running 'make install' as root while the build was done as non-root. Also
adjust the comment describing this, and move the message printing and
redirection to mkmakefile.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-05-08 06:55:32 +02:00
Pavel Roskin
fca1dff218 kbuild: removing .tmp_versions considered harmful
Remove *.mod files but not .tmp_versions for external builds

When "make install" is run as root, .tmp_versions is re-created and
becomes owned by root.  Subsequent "make" run by user fails because
.tmp_versions cannot be removed.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-04-30 23:48:03 +02:00
Linus Torvalds
2be4d50295 Linux v2.6.17-rc3 2006-04-26 19:19:25 -07:00
Linus Torvalds
8bbde0e6d5 Linux v2.6.17-rc2 2006-04-18 20:00:49 -07:00
Andreas Gruenbacher
7d2d8fe0cb kbuild: modules_install for external modules must not remove existing modules
When installing external modules with `make modules_install', the
first thing that happens is a rm -rf of the target directory. This
works only once, and breaks when installing more than one (set of)
external module(s).
With following fix we have the functionality:
- for a in-kernel modules_install the $(MODLIB)/kernel directory will be
  deleted before module installation
- for external modules the existing modules will be left as is assuming
  one may be building and installign several external modules

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-04-06 08:42:17 +02:00
Sam Ravnborg
aa360879ed kbuild: fix make dir/
kbuild added an extra '/' after the directory - resulting in all
files being rebuild in a subdirectory.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-04-06 08:25:31 +02:00
Sam Ravnborg
bc2546a679 kbuild: fix building single targets with make O=.. single-target
This fixes single targets build so it now works relaiably in
following cases:
- build with mixed kernel source and output files (make single-target)
- build with separate output directory (make O=.. single-target)
- external module with mixed kernel source and output files
  (make M='pwd' single-target)
- external module with separate kernel source and output files
  (make O=.. M='pwd' single-target)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-04-05 12:57:21 +02:00
Linus Torvalds
6246b6128b Linux v2.6.17-rc1
Close of the merge window..
2006-04-02 20:22:10 -07:00
Andi Kleen
6edfba1b33 [PATCH] x86_64: Don't define string functions to builtin
gcc should handle this anyways, and it causes problems when
sprintf is turned into strcpy by gcc behind our backs and
the C fallback version of strcpy is actually defining __builtin_strcpy

Then drop -ffreestanding from the main Makefile because it isn't
needed anymore and implies -fno-builtin, which is wrong now.
(it was only added for x86-64, so dropping it should be safe)

Noticed by Roman Zippel

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 09:10:53 -08:00
Linus Torvalds
2e1ca21d46 Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
* master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild: (46 commits)
  kbuild: remove obsoleted scripts/reference_* files
  kbuild: fix make help & make *pkg
  kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
  Kconfig: remove the CONFIG_CC_ALIGN_* options
  kbuild: add -fverbose-asm to i386 Makefile
  kbuild: clean-up genksyms
  kbuild: Lindent genksyms.c
  kbuild: fix genksyms build error
  kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
  kbuild: replace PHONY with FORCE
  kbuild: Fix bug in crc symbol generating of kernel and modules
  kbuild: change kbuild to not rely on incorrect GNU make behavior
  kbuild: when warning symbols exported twice now tell user this is the problem
  kbuild: fix make dir/file.xx when asm symlink is missing
  kbuild: in the section mismatch check try harder to find symbols
  kbuild: fix section mismatch check for unwind on IA64
  kbuild: kill false positives from section mismatch warnings for powerpc
  kbuild: kill trailing whitespace in modpost & friends
  kbuild: small update of allnoconfig description
  kbuild: make namespace.pl CROSS_COMPILE happy
  ...

Trivial conflict in arch/ppc/boot/Makefile manually fixed up
2006-03-25 08:48:48 -08:00
Jan Beulich
604bf5a216 [PATCH] CONFIG_UNWIND_INFO
As a foundation for reliable stack unwinding, this adds a config option
(available to all architectures except IA64 and those where the module
loader might have problems with the resulting relocations) to enable the
generation of frame unwind information.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>,
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-24 07:33:25 -08:00
Sam Ravnborg
eae0f536f6 kbuild: remove obsoleted scripts/reference_* files
The checks performed by scripts/reference_* has been moved to modpost.
Remove the files and their reference in top-level Makefile.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-21 07:28:24 +01:00
Sam Ravnborg
6c2133e11b kbuild: fix make help & make *pkg
FORCE was not defined => error.
Use kbuild infrastructure to call down to the relevant
Makefile. This enables us to use the FORCE definition from kbuild.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-21 07:22:35 +01:00
Linus Torvalds
7705a8792b Linux 2.6.16 2006-03-19 21:53:29 -08:00
Adrian Bunk
8cab77a2f8 Kconfig: remove the CONFIG_CC_ALIGN_* options
I don't see any use case for the CONFIG_CC_ALIGN_* options:
- they are only available if EMBEDDED
- people using EMBEDDED will most likely also enable
  CC_OPTIMIZE_FOR_SIZE
- the default for -Os is to disable alignment

In case someone is doing performance comparisons and discovers that the
default settings gcc chooses aren't good, the only sane thing is to discuss
whether it makes sense to change this, not through offering options to change
this locally.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-12 23:35:17 +01:00
Linus Torvalds
535744878e Linux 2.6.16-rc6
Gaah. Delayed. But all the better for it!
2006-03-11 14:12:55 -08:00
Jan Beulich
44f329ab69 [PATCH] kbuild: version.h should depend on .kernelrelease
Rebuilding a previously built tree while using make's -j option from
time to time results in the version.h check running at the same time as
the updating of .kernelrelease, resulting in UTS_RELEASE remaining an
empty string (and as a side effect causing the entire kernel to be
rebuilt).

Signed-Off-By: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-10 15:59:34 -08:00
Sam Ravnborg
0131705d58 kbuild: replace PHONY with FORCE
.PHONY: does not take patterns so use FORCE to achive same effect.
Thanks to "Paul D. Smith" <psmith@gnu.org> for noticing this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-08 18:39:05 +01:00
Paul Smith
4f1933620f kbuild: change kbuild to not rely on incorrect GNU make behavior
The kbuild system takes advantage of an incorrect behavior in GNU make.
Once this behavior is fixed, all files in the kernel rebuild every time,
even if nothing has changed.  This patch ensures kbuild works with both
the incorrect and correct behaviors of GNU make.

For more details on the incorrect behavior, see:

http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html

Changes in this patch:
  - Keep all targets that are to be marked .PHONY in a variable, PHONY.
  - Add .PHONY: $(PHONY) to mark them properly.
  - Remove any $(PHONY) files from the $? list when determining whether
    targets are up-to-date or not.

Signed-off-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-06 00:09:51 +01:00
Sam Ravnborg
f6ecebd659 kbuild: fix make dir/file.xx when asm symlink is missing
Added a dependency so we do full preparation before trying to build single
file targets. This fixes a case where Andrew Morton did:
	make kernel/sched.o
        rm include/asm
	make kernel/sched.o     -> splat

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-05 12:10:58 +01:00
Linus Torvalds
b9a33cebac Linux v2.6.16-rc5 2006-02-26 21:09:35 -08:00
Jan Beulich
c3f9da90b6 kbuild: version.h should depend on .kernelrelease
Rebuilding a previously built tree while using make's -j options from time to
time results in the version.h check running at the same time as the updating
of .kernelrelease, resulting in UTS_RELEASE remaining an empty string (and as
a side effect causing the entire kernel to be rebuilt).

Signed-Off-By: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-22 21:29:27 +01:00
Mattia Dongili
0f558c3334 kbuild: fix a cscope bug (make cscope segfaults)
Workaround a cscope bug where a trailing ':' in VPATH makes it segfault
and let it build the cross-reference succesfully.

VPATH=/home/mattia/devel/kernel/git/linux-2.6: cscope -b
[1]    17555 segmentation fault VPATH=/home/mattia/devel/kernel/git/linux-2.6: cscope -b

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 14:27:57 +01:00
Adrian Bunk
e63046630c kbuild: remove a tab from an empty line
Emacs warns if an otherwise empty line starts with a tab.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:21 +01:00
Sam Ravnborg
20a468b513 kbuild: make cc-version available in kbuild files
Move $(CC) support functions to Kbuild.include so they are available
in the kbuild files.
In addition the following was done:
	o as-option documented in Documentation/kbuild/makefiles.txt
	o Moved documentation to new section to match
	  new scope of functions
	o added cc-ifversion used to conditionally select a text string
	  dependent on actual $(CC) version
	o documented cc-ifversion
	o change so Kbuild.include is read before the kbuild file

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:20 +01:00
Sam Ravnborg
a67dc21a38 kbuild: run depmod when installing external modules
Following patch enables depmod support when installing external modules.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:20 +01:00
Sam Ravnborg
fb3cbd2e57 kbuild: avoid stale modules in $(MODVERDIR) for external modules
To avoid stale modules located in $(MODVERDIR) aka .tmp_versions/
always delete the directory when building an external module.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:19 +01:00
Martin Michlmayr
8999257c29 kbuild: Accept various mips sub-types in SUBARCH
uname -m on MIPS can give a number of results, such as mips64.  We
need to add another substitution to the sed call for SUBARCH in the
main Makefile.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:19 +01:00
Sam Ravnborg
06300b21f4 kbuild: support building individual files for external modules
Support building individual files when dealing with separate modules.
So say you have a module named "foo" which consist of two .o files bar.o
and fun.o.

You can then do:
make -C $KERNELSRC M=`pwd` bar.o
make -C $KERNELSRC M=`pwd` bar.lst
make -C $KERNELSRC M=`pwd` bar.i
make -C $KERNELSRC M=`pwd` /            <= will build all .o files
                                           and link foo.o
make -C $KERNELSRC M=`pwd` foo.ko       <= will build the module
                                           and do the modpost step
					   to create foo.ko

The above will also work if the external module is placed in a
subdirectory using a hirachy of kbuild files.
Thanks to Andreas Gruenbacher <agruen@suse.de> for initial feature
request / bug report.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:17 +01:00
Linus Torvalds
bd71c2b174 Linux v2.6.16-rc4 2006-02-17 14:23:45 -08:00
Benjamin LaHaise
36cbbe5eb9 [PATCH] kbuild: revert "fix make -jN with multiple targets with O=..."
Commit 296e0855b0:

    "kbuild: fix make -jN with multiple targets with O=..."

causes a ~95% increase in build time for the kernel.  Before: 4m21s
after: 8m1.403s.  Can we revert this until another approach is found?

Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-15 15:32:21 -08:00
Linus Torvalds
e9bb4c9929 Linux v2.6.16-rc3 2006-02-12 16:27:25 -08:00
Linus Torvalds
eeb059e0a6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-bugfix 2006-02-07 10:01:43 -08:00
Linus Torvalds
826eeb53a6 Linux v2.6.16-rc2 2006-02-02 22:03:08 -08:00
Sam Ravnborg
8c7f75d325 kbuild: fix build with O=..
.kernelrelease was saved in same directory as kernel source also
with make O=...
Make sure we kick in the normal logic to shift to the output directory
when we build .kernelrelease after executing *config.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
2006-01-21 12:07:56 +01:00
Linus Torvalds
2664b25051 Linux v2.6.16-rc1 2006-01-16 23:44:47 -08:00
Paul Mundt
cad8244840 [PATCH] sh: Move CPU subtype configuration to its own Kconfig
Currently the CPU subtype options are cluttering up arch/sh/Kconfig somewhat.

Given that, this moves all of that in to its own arch/sh/mm/Kconfig.  Things
like cache configuration are also moved to this new location.

This also adds support for strict CPU tuning on newer cores, which requires
the addition of as-option.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-16 23:15:28 -08:00
Linus Torvalds
9d8d5a284e Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2006-01-16 11:19:04 -08:00
Sam Ravnborg
df9df036d3 kbuild: fix 'make all install_modules install'
The command 'make all modules_install install' would fail
in a virgin tree - pointing at a non-existing directory under
/lib/modules/xxx

KERNELRELEASE is part of MODLIB and we need to create .kernelrelease
before we can properly evaluate KERNELRELEASE,
Changing MODLIB to the recursively expanded flavor let it pick up
the correct KERNELRELEASE value.

Reported by: "Hemmann, Volker Armin" <volker.armin.hemmann@tu-clausthal.de>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-16 12:46:07 +01:00
Sam Ravnborg
2244cbd8a9 kbuild: create .kernelrelease at *config step
To enable 'make kernelrelease' earlier now create .kernelrelease when
one of the *config targets are used.
Also introduce KERNELVERSION - only user is kconfig.
KERNELVERSION was needed to display kernel version in menuconfig -
KERNELRELEASE is not valid until configuration has completed.
kconfig files modified to use KERNELVERSION.
Bug reported by: Rene Rebe <rene@exactcode.de>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-16 12:12:12 +01:00
Sam Ravnborg
296e0855b0 kbuild: fix make -jN with multiple targets with O=...
The way multiple targets was handled with make O=...
broke because for each high-level target make spawned
a parallel make resulting in a broken build.
Reported by Keith Owens <kaos@ocs.com.au>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-15 20:02:31 +01:00
Paul Mackerras
820a8ce793 powerpc: Make ARCH=powerpc the default for 32-bit ppc
This makes ARCH=powerpc the default on 32-bit powerpc machines,
where uname -m returns ppc, as well as on 64-bit powerpc machines.
Most people who would be likely to build their own kernels on
32-bit powerpc machines would be using powermacs or CHRP machines,
both of which are supported with ARCH=powerpc now.  Embedded ppc
developers whose ports haven't been moved over to arch/powerpc
yet will have to explicitly set ARCH=ppc now.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-15 17:33:52 +11:00
Linus Torvalds
ab396e91bf Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Fix up some trivial conflicts in {i386|ia64}/Makefile
2006-01-10 08:21:33 -08:00
Adrian Bunk
a58a414fd5 spelling: s/usefull/useful/
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-01-10 00:08:17 +01:00
Sam Ravnborg
4f0210b9c4 kbuild: re-export VERSION, PATCHLEVEL, SUBLEVEL
Eric Sandeen <sandeen@sgi.com> pointed out that it is usefull to have
access to VERSION, PATCHLEVEL, SUBLEVEL in external modules, and gooling
a litte confirmed this.
So re-export them.
Usage within the kernel is still discouraged but possible.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-09 22:48:34 +01:00
Sam Ravnborg
cb58455c48 kbuild: KERNELRELEASE is only re-defined when buiding the kernel
To avoid running setlocalversion as root no longer (re-)define
KERNELRELEASE for each run. With this patch KERNELRELEASE is
only re-read when we do an actual kernel build.
Rationale behind this is "do as little as possible" when executing
make install - as root!

A new file named .kernelrelease is strored in the root of the kernel
tree containing the actual version string.
So when we use do a kernel build the .kernelrelease file will be updated.
But in all other situations it is left as-is.

To make it more visible the kernel now prints out the version being build.
Sample:
Building kernel 2.6.15-g63b794bf-dirty
...
...

The patch also un-exports VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION
since all users of these are anyway broken - and none is left in the
tree.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-09 21:20:34 +01:00
Tore Anderson
50aa88e287 kbuild: ensure mrproper removes .old_version
If the final linking of vmlinux fails, the file .old_version are left
behind.  This patch ensures the mrproper target will remove it if
present.

Signed-off-by: Tore Anderson <tore@fud.no>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-08 18:46:49 +01:00
Linus Torvalds
25c862cc9e Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2006-01-04 16:36:52 -08:00