Commit e6d86761 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-sam.bkbits.net/kbuild

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 2bd1c1e2 0e6affc5
......@@ -18,7 +18,7 @@ MAKEFLAGS += --no-print-directory
#
# Most importantly: sub-Makefiles should only ever modify files in
# their own directory. If in some directory we have a dependency on
# a file in another dir (which doesn't happen often, but it's of
# a file in another dir (which doesn't happen often, but it's often
# unavoidable when linking the built-in.o targets which finally
# turn into vmlinux), we will call a sub make in that other dir, and
# after that we are sure that everything which is in that other dir
......@@ -67,7 +67,7 @@ endif
# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntax'es are supported.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
......@@ -78,7 +78,8 @@ endif
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assigment takes precedence over the KBUILD_OUTPUT environment variable.
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.
# KBUILD_SRC is set on invocation of make in OBJ directory
......@@ -539,16 +540,14 @@ CFLAGS += $(call cc-option,-Wno-pointer-sign,)
# Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the commandline or
# set in the environment
# Also any assingments in arch/$(ARCH)/Makefiel take precedence over
# Also any assignments in arch/$(ARCH)/Makefile take precedence over
# this default value
export KBUILD_IMAGE ?= vmlinux
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
#
#export INSTALL_PATH=/boot
# images. Default is /boot, but you can set it to other values
export INSTALL_PATH ?= /boot
#
# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
......@@ -898,7 +897,7 @@ depmod_opts := -b $(INSTALL_MOD_PATH) -r
endif
.PHONY: _modinst_post
_modinst_post: _modinst_
if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
else # CONFIG_MODULES
......@@ -1096,9 +1095,17 @@ KBUILD_MODULES := 1
crmodverdir:
$(Q)mkdir -p $(MODVERDIR)
.PHONY: $(objtree)/Module.symvers
$(objtree)/Module.symvers:
@test -e $(objtree)/Module.symvers || ( \
echo; \
echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \
echo " is missing; modules will have no dependencies and modversions."; \
echo )
module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
.PHONY: $(module-dirs) modules
$(module-dirs): crmodverdir
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
modules: $(module-dirs)
......@@ -1136,20 +1143,30 @@ endif # KBUILD_EXTMOD
# Generate tags for editors
# ---------------------------------------------------------------------------
#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set
#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file.
#Adding $(srctree) adds about 20M on i386 to the size of the output file!
ifeq ($(KBUILD_OUTPUT),)
__srctree =
else
__srctree = $(srctree)/
endif
define all-sources
( find $(srctree) $(RCS_FIND_IGNORE) \
( find $(__srctree) $(RCS_FIND_IGNORE) \
\( -name include -o -name arch \) -prune -o \
-name '*.[chS]' -print; \
find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)/include $(RCS_FIND_IGNORE) \
find $(__srctree)include $(RCS_FIND_IGNORE) \
\( -name config -o -name 'asm-*' \) -prune \
-o -name '*.[chS]' -print; \
find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print )
endef
......@@ -1172,7 +1189,7 @@ quiet_cmd_tags = MAKE $@
define cmd_tags
rm -f $@; \
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL"`; \
$(all-sources) | xargs ctags $$CTAGSF -a
$(all-sources) | xargs ctags $$CTAGSF -a --extra=+f
endef
TAGS: FORCE
......
......@@ -142,7 +142,10 @@ zlilo bzlilo: vmlinux
zdisk bzdisk: vmlinux
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
install fdimage fdimage144 fdimage288: vmlinux
fdimage fdimage144 fdimage288: vmlinux
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
install:
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
prepare: include/asm-$(ARCH)/asm_offsets.h
......
......@@ -46,7 +46,7 @@ targets += vsyscall.lds
# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \
cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
-Wl,-T,$(filter-out FORCE,$^) -o $@
export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
......
......@@ -6,5 +6,3 @@ prism54-objs := islpci_eth.o islpci_mgt.o \
obj-$(CONFIG_PRISM54) += prism54.o
EXTRA_CFLAGS = -I$(PWD) #-DCONFIG_PRISM54_WDS
......@@ -39,5 +39,5 @@ quiet_cmd_conmakehash = CNMKHSH $@
sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
$(obj)/promcon_tbl.c: $(src)/prom.uni FORCE
$(call if_changed,conmakehash)
$(obj)/promcon_tbl.c: $(src)/prom.uni
$(call cmd,conmakehash)
......@@ -77,24 +77,14 @@ void sort_main_extable(void);
extern struct subsystem module_subsys;
#ifdef MODULE
#define ___module_cat(a,b) __mod_ ## a ## b
#define __module_cat(a,b) ___module_cat(a,b)
#define __MODULE_INFO(tag, name, info) \
static const char __module_cat(name,__LINE__)[] \
__attribute_used__ \
__attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
#define MODULE_GENERIC_TABLE(gtype,name) \
extern const struct gtype##_id __mod_##gtype##_table \
__attribute__ ((unused, alias(__stringify(name))))
extern struct module __this_module;
#define THIS_MODULE (&__this_module)
#else /* !MODULE */
#define MODULE_GENERIC_TABLE(gtype,name)
#define __MODULE_INFO(tag, name, info)
#define THIS_MODULE ((struct module *)0)
#endif
......@@ -560,7 +550,8 @@ static inline void MODULE_PARM_(void) { }
/* DEPRECATED: Do not use. */
#define MODULE_PARM(var,type) \
struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
{ __stringify(var), type, &MODULE_PARM_ };
{ __stringify(var), type, &MODULE_PARM_ }; \
__MODULE_PARM_TYPE(var, type);
#else
#define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_;
#endif
......
......@@ -13,6 +13,19 @@
#define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "."
#endif
#ifdef MODULE
#define ___module_cat(a,b) __mod_ ## a ## b
#define __module_cat(a,b) ___module_cat(a,b)
#define __MODULE_INFO(tag, name, info) \
static const char __module_cat(name,__LINE__)[] \
__attribute_used__ \
__attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
#else /* !MODULE */
#define __MODULE_INFO(tag, name, info)
#endif
#define __MODULE_PARM_TYPE(name, _type) \
__MODULE_INFO(parmtype, name##type, #name ":" _type)
struct kernel_param;
/* Returns 0, or -errno. arg is in kp->arg. */
......@@ -65,7 +78,7 @@ struct kparam_array
#define module_param_named(name, value, type, perm) \
param_check_##type(name, &(value)); \
module_param_call(name, param_set_##type, param_get_##type, &value, perm); \
__MODULE_INFO(parmtype, name##type, #name ":" #type)
__MODULE_PARM_TYPE(name, #type)
#define module_param(name, type, perm) \
module_param_named(name, name, type, perm)
......@@ -76,7 +89,7 @@ struct kparam_array
= { len, string }; \
module_param_call(name, param_set_copystring, param_get_string, \
&__param_string_##name, perm); \
__MODULE_INFO(parmtype, name##type, #name ":string")
__MODULE_PARM_TYPE(name, "string")
/* Called on module insert or kernel boot */
extern int parse_args(const char *name,
......@@ -138,7 +151,7 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp);
sizeof(array[0]), array }; \
module_param_call(name, param_array_set, param_array_get, \
&__param_arr_##name, perm); \
__MODULE_INFO(parmtype, name##type, #name ":array of " #type)
__MODULE_PARM_TYPE(name, "array of " #type)
#define module_param_array(name, type, nump, perm) \
module_param_array_named(name, name, type, nump, perm)
......
......@@ -47,7 +47,7 @@ $(obj)/config_data.gz: .config FORCE
$(call if_changed,gzip)
quiet_cmd_ikconfiggz = IKCFG $@
cmd_ikconfiggz = (echo "const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
cmd_ikconfiggz = (echo "static const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
targets += config_data.h
$(obj)/config_data.h: $(obj)/config_data.gz FORCE
$(call if_changed,ikconfiggz)
......@@ -355,7 +355,7 @@ static int s_show(struct seq_file *m, void *p)
return 0;
}
struct seq_operations kallsyms_op = {
static struct seq_operations kallsyms_op = {
.start = s_start,
.next = s_next,
.stop = s_stop,
......@@ -397,7 +397,7 @@ static struct file_operations kallsyms_operations = {
.release = kallsyms_release,
};
int __init kallsyms_init(void)
static int __init kallsyms_init(void)
{
struct proc_dir_entry *entry;
......
......@@ -183,15 +183,24 @@ cmd_gzip = gzip -f -9 < $< > $@
# Generic stuff
# ===========================================================================
ifneq ($(KBUILD_NOCMDDEP),1)
# Check if both arguments has same arguments. Result in empty string if equal
# User may override this check using make KBUILD_NOCMDDEP=1
arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) )
endif
# echo command. Short version is $(quiet) equals quiet, otherwise full command
echo-cmd = $(if $($(quiet)cmd_$(1)), \
echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';)
# function to only execute the passed command if necessary
# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
if_changed = $(if $(strip $? \
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
#
if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(echo-cmd) \
$(cmd_$(1)); \
echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)
......@@ -200,10 +209,9 @@ if_changed = $(if $(strip $? \
# file
if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(echo-cmd) \
$(cmd_$(1)); \
scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \
......@@ -213,9 +221,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
# will check if $(cmd_foo) changed, or any of the prequisites changed,
# and if so will execute $(rule_foo)
if_changed_rule = $(if $(strip $? \
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
@set -e; \
$(rule_$(1)))
......
......@@ -21,8 +21,9 @@ quiet_cmd_modules_install = INSTALL $@
# Modules built outside the kernel source tree go into extra by default
INSTALL_MOD_DIR ?= extra
ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D))
modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D))
modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
$(modules):
$(call cmd,modules_install,$(modinst_dir))
$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
......@@ -25,7 +25,6 @@
#define MODUTILS_GENKSYMS_H 1
#include <stdio.h>
#include <assert.h>
enum symbol_type
......@@ -89,8 +88,17 @@ void error_with_pos(const char *, ...);
#define MODUTILS_VERSION "<in-kernel>"
#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; })
#define xstrdup(str) ({ char *__str = strdup(str); assert(__str); __str; })
#define xmalloc(size) ({ void *__ptr = malloc(size); \
if(!__ptr && size != 0) { \
fprintf(stderr, "out of memory\n"); \
exit(1); \
} \
__ptr; })
#define xstrdup(str) ({ char *__str = strdup(str); \
if (!__str) { \
fprintf(stderr, "out of memory\n"); \
exit(1); \
} \
__str; })
#endif /* genksyms.h */
......@@ -50,10 +50,12 @@ endif
# Help text used by make help
help:
@echo ' oldconfig - Update current config utilising a line-oriented program'
@echo ' config - Update current config utilising a line-oriented program'
@echo ' menuconfig - Update current config utilising a menu based program'
@echo ' xconfig - Update current config utilising a QT based front-end'
@echo ' gconfig - Update current config utilising a GTK based front-end'
@echo ' oldconfig - Update current config utilising a provided .config as base'
@echo ' randconfig - New config with random answer to all options'
@echo ' defconfig - New config with default answer to all options'
@echo ' allmodconfig - New config selecting modules when possible'
@echo ' allyesconfig - New config where all options are accepted with yes'
......@@ -107,6 +109,10 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
$(obj)/qconf.o: $(obj)/.tmp_qtcheck
ifeq ($(qconf-target),1)
......
......@@ -47,11 +47,10 @@ warn(const char *fmt, ...)
va_end(arglist);
}
void *do_nofail(void *ptr, const char *file, int line, const char *expr)
void *do_nofail(void *ptr, const char *expr)
{
if (!ptr) {
fatal("Memory allocation failure %s line %d: %s.\n",
file, line, expr);
fatal("modpost: Memory allocation failure: %s.\n", expr);
}
return ptr;
}
......
......@@ -53,8 +53,8 @@ static inline void __endian(const void *src, void *dest, unsigned int size)
#endif
#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr)
void *do_nofail(void *ptr, const char *file, int line, const char *expr);
#define NOFAIL(ptr) do_nofail((ptr), #ptr)
void *do_nofail(void *ptr, const char *expr);
struct buffer {
char *p;
......
......@@ -406,6 +406,11 @@ sub resolve_external_references
&& $name !~ /^__.*per_cpu_end/
&& $name !~ /^__alt_instructions/
&& $name !~ /^__setup_/
&& $name !~ /^jiffies/
&& $name !~ /^__mod_timer/
&& $name !~ /^__mod_page_state/
&& $name !~ /^init_module/
&& $name !~ /^cleanup_module/
) {
printf "Cannot resolve ";
printf "weak " if ($type eq "w");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment