kbuild updates
Subsystems (3)
PATCH 1/1 kbuild updates
Hi Linus.
Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git
It contains a few fixes and enhancements.
With this ia64 now builds cleanly again - and this fix may also help others since arguments specified by CFLAGS_file.o := xxx is now processed correct in all cases. Previously it could cause problems when full path was specified.
It also introduces a nice modpost enhancement so we now warn if a module uses a symbol that is marked UNUSED.
note - the changes in arch/um/ is related to the 'ia64' fix.
There are a few kbuild issues to be sorted out but that will be after -rc1. The list as I recall it atm:
- kconfig is not preperly rebuild when kconfig changes
- A few more section checks needs to be introduced as per akpm request
- a few bugzilla entries needs to be addressed
- initramfs is attempted build when usign an external file as input
- mrproper left-overs in arch/arm (akpm)
- fix __FILE__ gets expanded to absolute pathname
Sam
Sam Ravnborg:
kbuild: fix ia64 breakage after introducing make -rR
kbuild: fix segv in modpost
kbuild: warn when a moduled uses a symbol marked UNUSED
Samuel Thibault:
kconfig: enhancing accessibility of lxdialog
Makefile | 2 - arch/um/scripts/Makefile.rules | 4 + scripts/Kbuild.include | 4 + scripts/Makefile.build | 2 - scripts/Makefile.host | 6 +- scripts/Makefile.lib | 6 +- scripts/Makefile.modpost | 2 - scripts/kconfig/lxdialog/checklist.c | 7 ++- scripts/mod/modpost.c | 94 +++++++++++++++++++++++++--------- scripts/mod/modpost.h | 2 + 10 files changed, 91 insertions(+), 38 deletions(-)
Since all patches has been on lkml before as individual patches here is a combined diff.
Makefile +1 -1
@@ -1352,7 +1352,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(CPPFLAGS) \ - $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) + $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) quiet_cmd_as_o_S = AS $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
arch/um/scripts/Makefile.rules +2 -2
@@ -8,7 +8,7 @@ USER_OBJS += $(filter %_user.o,$(obj-y) USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) $(USER_OBJS:.o=.%): \ - c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o) + c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ -Dunix -D__unix__ -D__$(SUBARCH)__
@@ -17,7 +17,7 @@ # using it directly. UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file)) $(UNPROFILE_OBJS:.o=.%): \ - c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o) + c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ -Dunix -D__unix__ -D__$(SUBARCH)__
scripts/Kbuild.include +4 -0
@@ -13,6 +13,10 @@ # contain a comma depfile = $(subst $(comma),_,$(@D)/.$(@F).d) ### +# filename of target with directory and extension stripped +basetarget = $(basename $(notdir $@)) + +### # Escape single quote for use in echo statements escsq = $(subst $(squote),'\$(squote)',$1)
scripts/Makefile.build +1 -1
@@ -117,7 +117,7 @@ quiet_modtag := $(empty) $(empty) $(obj-m) : quiet_modtag := [M] # Default for not multi-part modules -modname = $(*F) +modname = $(basetarget) $(multi-objs-m) : modname = $(modname-multi) $(multi-objs-m:.o=.i) : modname = $(modname-multi)
scripts/Makefile.host +4 -2
@@ -80,8 +80,10 @@ obj-dirs += $(host-objdirs) ##### # Handle options to gcc. Support building with separate output directory -_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) -_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) +_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ + $(HOSTCFLAGS_$(basetarget).o) +_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ + $(HOSTCXXFLAGS_$(basetarget).o) ifeq ($(KBUILD_SRC),) __hostc_flags = $(_hostc_flags)
scripts/Makefile.lib +3 -3
@@ -82,12 +82,12 @@ # Note: It's possible that one object ge # than one module. In that case KBUILD_MODNAME will be set to foo_bar, # where foo and bar are the name of the modules. name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))" +basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" modname_flags = $(if $(filter 1,$(words $(modname))),\ -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") -_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) +_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) +_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) _cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) # If building the kernel in a separate objtree expand all occurrences
scripts/Makefile.modpost +1 -1
@@ -72,7 +72,7 @@ # Declare generated files as targets for # Step 5), compile all *.mod.c files # modname is set to make c_flags define KBUILD_MODNAME -modname = $(*F) +modname = $(notdir $(@:.mod.o=)) quiet_cmd_cc_o_c = CC $@ cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE) \
scripts/kconfig/lxdialog/checklist.c +5 -2
@@ -187,9 +187,12 @@ int dialog_checklist(const char *title,/* Print the list */ for (i =0 ; i < max_choice; i++) { -print_item (list, items[(scroll + i) *3 +1 ], - status[i + scroll], i, i == choice); +if (i != choice) +print_item (list, items[(scroll + i) *3 +1 ], + status[i + scroll], i,0 ); } +print_item (list, items[(scroll + choice) *3 +1 ], + status[choice + scroll], choice,1 );print_arrows (dialog, choice, item_no, scroll, box_y, box_x + check_x +5 , list_height);
scripts/mod/modpost.c +68 -26
170 lines not on this page · raw message
scripts/mod/modpost.h +2 -0
@@ -117,7 +117,9 @@ struct elf_info {Elf_Sym *symtab_start;Elf_Sym *symtab_stop;Elf_Section export_sec; +Elf_Section export_unused_sec;Elf_Section export_gpl_sec; +Elf_Section export_unused_gpl_sec;Elf_Section export_gpl_future_sec;const char *strtab;char *modinfo;