diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 17:10:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-05 17:10:07 -0400 |
| commit | da9e82b3b8989fc09e2a4c45b9da604ba2b4c46d (patch) | |
| tree | 7355d2afe95be27fddb8fa4baa46476c76aeb8ee | |
| parent | 90d3417a3a4e810d67081dd106f0e603a856978f (diff) | |
| parent | 772320e84588dcbe1600ffb83e5f328f2209ac2a (diff) | |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
modpost: support objects with more than 64k sections
trivial: fix a typo in a filename
frv: clean up arch/frv/Makefile
kbuild: allow assignment to {A,C}FLAGS_KERNEL on the command line
kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line
Kbuild: Add option to set -femit-struct-debug-baseonly
Makefile: "make kernelrelease" should show the correct full kernel version
Makefile.build: make KBUILD_SYMTYPES work again
| -rw-r--r-- | Documentation/kbuild/kbuild.txt | 26 | ||||
| -rw-r--r-- | Documentation/kbuild/makefiles.txt | 27 | ||||
| -rw-r--r-- | Makefile | 29 | ||||
| -rw-r--r-- | arch/avr32/Makefile | 2 | ||||
| -rw-r--r-- | arch/blackfin/Makefile | 4 | ||||
| -rw-r--r-- | arch/frv/Makefile | 22 | ||||
| -rw-r--r-- | arch/ia64/Makefile | 6 | ||||
| -rw-r--r-- | arch/m32r/Makefile | 4 | ||||
| -rw-r--r-- | arch/m68k/Makefile | 2 | ||||
| -rw-r--r-- | arch/mips/Makefile | 6 | ||||
| -rw-r--r-- | arch/powerpc/Makefile | 2 | ||||
| -rw-r--r-- | arch/s390/Makefile | 3 | ||||
| -rw-r--r-- | arch/score/Makefile | 3 | ||||
| -rw-r--r-- | lib/Kconfig.debug | 13 | ||||
| -rw-r--r-- | scripts/Makefile.build | 37 | ||||
| -rw-r--r-- | scripts/Makefile.modpost | 9 | ||||
| -rw-r--r-- | scripts/mod/file2alias.c | 6 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 102 | ||||
| -rw-r--r-- | scripts/mod/modpost.h | 43 |
19 files changed, 246 insertions, 100 deletions
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 0d8addbb0fa..1e5165aa9e4 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
| @@ -22,11 +22,33 @@ building C files and assembler files. | |||
| 22 | 22 | ||
| 23 | KAFLAGS | 23 | KAFLAGS |
| 24 | -------------------------------------------------- | 24 | -------------------------------------------------- |
| 25 | Additional options to the assembler. | 25 | Additional options to the assembler (for built-in and modules). |
| 26 | |||
| 27 | AFLAGS_MODULE | ||
| 28 | -------------------------------------------------- | ||
| 29 | Addtional module specific options to use for $(AS). | ||
| 30 | |||
| 31 | AFLAGS_KERNEL | ||
| 32 | -------------------------------------------------- | ||
| 33 | Addtional options for $(AS) when used for assembler | ||
| 34 | code for code that is compiled as built-in. | ||
| 26 | 35 | ||
| 27 | KCFLAGS | 36 | KCFLAGS |
| 28 | -------------------------------------------------- | 37 | -------------------------------------------------- |
| 29 | Additional options to the C compiler. | 38 | Additional options to the C compiler (for built-in and modules). |
| 39 | |||
| 40 | CFLAGS_KERNEL | ||
| 41 | -------------------------------------------------- | ||
| 42 | Addtional options for $(CC) when used to compile | ||
| 43 | code that is compiled as built-in. | ||
| 44 | |||
| 45 | CFLAGS_MODULE | ||
| 46 | -------------------------------------------------- | ||
| 47 | Addtional module specific options to use for $(CC). | ||
| 48 | |||
| 49 | LDFLAGS_MODULE | ||
| 50 | -------------------------------------------------- | ||
| 51 | Additional options used for $(LD) when linking modules. | ||
| 30 | 52 | ||
| 31 | KBUILD_VERBOSE | 53 | KBUILD_VERBOSE |
| 32 | -------------------------------------------------- | 54 | -------------------------------------------------- |
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 8abd041b605..c375313cb12 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
| @@ -921,16 +921,33 @@ When kbuild executes, the following steps are followed (roughly): | |||
| 921 | The first example utilises the trick that a config option expands | 921 | The first example utilises the trick that a config option expands |
| 922 | to 'y' when selected. | 922 | to 'y' when selected. |
| 923 | 923 | ||
| 924 | CFLAGS_KERNEL $(CC) options specific for built-in | 924 | KBUILD_AFLAGS_KERNEL $(AS) options specific for built-in |
| 925 | 925 | ||
| 926 | $(CFLAGS_KERNEL) contains extra C compiler flags used to compile | 926 | $(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile |
| 927 | resident kernel code. | 927 | resident kernel code. |
| 928 | 928 | ||
| 929 | CFLAGS_MODULE $(CC) options specific for modules | 929 | KBUILD_AFLAGS_MODULE Options for $(AS) when building modules |
| 930 | 930 | ||
| 931 | $(CFLAGS_MODULE) contains extra C compiler flags used to compile code | 931 | $(KBUILD_AFLAGS_MODULE) is used to add arch specific options that |
| 932 | for loadable kernel modules. | 932 | are used for $(AS). |
| 933 | From commandline AFLAGS_MODULE shall be used (see kbuild.txt). | ||
| 933 | 934 | ||
| 935 | KBUILD_CFLAGS_KERNEL $(CC) options specific for built-in | ||
| 936 | |||
| 937 | $(KBUILD_CFLAGS_KERNEL) contains extra C compiler flags used to compile | ||
| 938 | resident kernel code. | ||
| 939 | |||
| 940 | KBUILD_CFLAGS_MODULE Options for $(CC) when building modules | ||
| 941 | |||
| 942 | $(KBUILD_CFLAGS_MODULE) is used to add arch specific options that | ||
| 943 | are used for $(CC). | ||
| 944 | From commandline CFLAGS_MODULE shall be used (see kbuild.txt). | ||
| 945 | |||
| 946 | KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules | ||
| 947 | |||
| 948 | $(KBUILD_LDFLAGS_MODULE) is used to add arch specific options | ||
| 949 | used when linking modules. This is often a linker script. | ||
| 950 | From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). | ||
| 934 | 951 | ||
| 935 | --- 6.2 Add prerequisites to archprepare: | 952 | --- 6.2 Add prerequisites to archprepare: |
| 936 | 953 | ||
| @@ -332,10 +332,9 @@ CHECK = sparse | |||
| 332 | 332 | ||
| 333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ | 333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
| 334 | -Wbitwise -Wno-return-void $(CF) | 334 | -Wbitwise -Wno-return-void $(CF) |
| 335 | MODFLAGS = -DMODULE | 335 | CFLAGS_MODULE = |
| 336 | CFLAGS_MODULE = $(MODFLAGS) | 336 | AFLAGS_MODULE = |
| 337 | AFLAGS_MODULE = $(MODFLAGS) | 337 | LDFLAGS_MODULE = |
| 338 | LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds | ||
| 339 | CFLAGS_KERNEL = | 338 | CFLAGS_KERNEL = |
| 340 | AFLAGS_KERNEL = | 339 | AFLAGS_KERNEL = |
| 341 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 340 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage |
| @@ -354,7 +353,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | |||
| 354 | -Werror-implicit-function-declaration \ | 353 | -Werror-implicit-function-declaration \ |
| 355 | -Wno-format-security \ | 354 | -Wno-format-security \ |
| 356 | -fno-delete-null-pointer-checks | 355 | -fno-delete-null-pointer-checks |
| 356 | KBUILD_AFLAGS_KERNEL := | ||
| 357 | KBUILD_CFLAGS_KERNEL := | ||
| 357 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 358 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
| 359 | KBUILD_AFLAGS_MODULE := -DMODULE | ||
| 360 | KBUILD_CFLAGS_MODULE := -DMODULE | ||
| 361 | KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | ||
| 358 | 362 | ||
| 359 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 363 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
| 360 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 364 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
| @@ -369,6 +373,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | |||
| 369 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 373 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
| 370 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 374 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
| 371 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 375 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
| 376 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | ||
| 377 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | ||
| 372 | 378 | ||
| 373 | # When compiling out-of-tree modules, put MODVERDIR in the module | 379 | # When compiling out-of-tree modules, put MODVERDIR in the module |
| 374 | # tree rather than in the kernel tree. The kernel tree might | 380 | # tree rather than in the kernel tree. The kernel tree might |
| @@ -414,7 +420,7 @@ endif | |||
| 414 | no-dot-config-targets := clean mrproper distclean \ | 420 | no-dot-config-targets := clean mrproper distclean \ |
| 415 | cscope TAGS tags help %docs check% \ | 421 | cscope TAGS tags help %docs check% \ |
| 416 | include/linux/version.h headers_% \ | 422 | include/linux/version.h headers_% \ |
| 417 | kernelrelease kernelversion | 423 | kernelversion |
| 418 | 424 | ||
| 419 | config-targets := 0 | 425 | config-targets := 0 |
| 420 | mixed-targets := 0 | 426 | mixed-targets := 0 |
| @@ -557,6 +563,10 @@ KBUILD_CFLAGS += -g | |||
| 557 | KBUILD_AFLAGS += -gdwarf-2 | 563 | KBUILD_AFLAGS += -gdwarf-2 |
| 558 | endif | 564 | endif |
| 559 | 565 | ||
| 566 | ifdef CONFIG_DEBUG_INFO_REDUCED | ||
| 567 | KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) | ||
| 568 | endif | ||
| 569 | |||
| 560 | ifdef CONFIG_FUNCTION_TRACER | 570 | ifdef CONFIG_FUNCTION_TRACER |
| 561 | KBUILD_CFLAGS += -pg | 571 | KBUILD_CFLAGS += -pg |
| 562 | endif | 572 | endif |
| @@ -603,7 +613,7 @@ endif | |||
| 603 | # Use --build-id when available. | 613 | # Use --build-id when available. |
| 604 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 614 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
| 605 | $(call cc-ldoption, -Wl$(comma)--build-id,)) | 615 | $(call cc-ldoption, -Wl$(comma)--build-id,)) |
| 606 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 616 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
| 607 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 617 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
| 608 | 618 | ||
| 609 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 619 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) |
| @@ -1393,9 +1403,9 @@ checkstack: | |||
| 1393 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ | 1403 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ |
| 1394 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) | 1404 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) |
| 1395 | 1405 | ||
| 1396 | kernelrelease: | 1406 | kernelrelease: include/config/kernel.release |
| 1397 | $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ | 1407 | @echo $(KERNELRELEASE) |
| 1398 | $(error kernelrelease not valid - run 'make prepare' to update it)) | 1408 | |
| 1399 | kernelversion: | 1409 | kernelversion: |
| 1400 | @echo $(KERNELVERSION) | 1410 | @echo $(KERNELVERSION) |
| 1401 | 1411 | ||
| @@ -1472,6 +1482,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | |||
| 1472 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) | 1482 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) |
