Skip to content

Commit 1bc2767

Browse files
committed
Merge tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada: - add build_{menu,n,g,x}config targets for compile-testing Kconfig - fix and improve recursive dependency detection in Kconfig - fix parallel building of menuconfig/nconfig - fix syntax error in clang-version.sh - suppress distracting log from syncconfig - remove obsolete "rpm" target - remove VMLINUX_SYMBOL(_STR) macro entirely - fix microblaze build with CONFIG_DYNAMIC_FTRACE - move compiler test for dead code/data elimination to Kconfig - rename well-known LDFLAGS variable to KBUILD_LDFLAGS - misc fixes and cleanups * tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: rename LDFLAGS to KBUILD_LDFLAGS kbuild: pass LDFLAGS to recordmcount.pl kbuild: test dead code/data elimination support in Kconfig initramfs: move gen_initramfs_list.sh from scripts/ to usr/ vmlinux.lds.h: remove stale <linux/export.h> include export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci kbuild: make sorting initramfs contents independent of locale kbuild: remove "rpm" target, which is alias of "rpm-pkg" kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt kconfig: suppress "configuration written to .config" for syncconfig kconfig: fix "Can't open ..." in parallel build kbuild: Add a space after `!` to prevent parsing as file pattern scripts: modpost: check memory allocation results kconfig: improve the recursive dependency report kconfig: report recursive dependency involving 'imply' kconfig: error out when seeing recursive dependency kconfig: add build-only configurator targets scripts/dtc: consolidate include path options in Makefile
2 parents b8dcdab + d503ac5 commit 1bc2767

52 files changed

Lines changed: 188 additions & 209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/early-userspace/README‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ early userspace image can be built by an unprivileged user.
6666

6767
As a technical note, when directories and files are specified, the
6868
entire CONFIG_INITRAMFS_SOURCE is passed to
69-
scripts/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE
69+
usr/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE
7070
can really be interpreted as any legal argument to
7171
gen_initramfs_list.sh. If a directory is specified as an argument then
7272
the contents are scanned, uid/gid translation is performed, and
7373
usr/gen_init_cpio file directives are output. If a directory is
74-
specified as an argument to scripts/gen_initramfs_list.sh then the
74+
specified as an argument to usr/gen_initramfs_list.sh then the
7575
contents of the file are simply copied to the output. All of the output
7676
directives from directory scanning and file contents copying are
7777
processed by usr/gen_init_cpio.
7878

79-
See also 'scripts/gen_initramfs_list.sh -h'.
79+
See also 'usr/gen_initramfs_list.sh -h'.
8080

8181
Where's this all leading?
8282
=========================

‎Documentation/filesystems/ramfs-rootfs-initramfs.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Documentation/early-userspace/README for more details.)
164164
The kernel does not depend on external cpio tools. If you specify a
165165
directory instead of a configuration file, the kernel's build infrastructure
166166
creates a configuration file from that directory (usr/Makefile calls
167-
scripts/gen_initramfs_list.sh), and proceeds to package up that directory
167+
usr/gen_initramfs_list.sh), and proceeds to package up that directory
168168
using the config file (by feeding it to usr/gen_init_cpio, which is created
169169
from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is
170170
entirely self-contained, and the kernel's boot-time extractor is also

‎Documentation/kbuild/kconfig-language.txt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,15 +545,14 @@ make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
545545
Practical solutions to kconfig recursive issue
546546
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
547547

548-
Developers who run into the recursive Kconfig issue have three options
548+
Developers who run into the recursive Kconfig issue have two options
549549
at their disposal. We document them below and also provide a list of
550550
historical issues resolved through these different solutions.
551551

552552
a) Remove any superfluous "select FOO" or "depends on FOO"
553553
b) Match dependency semantics:
554554
b1) Swap all "select FOO" to "depends on FOO" or,
555555
b2) Swap all "depends on FOO" to "select FOO"
556-
c) Consider the use of "imply" instead of "select"
557556

558557
The resolution to a) can be tested with the sample Kconfig file
559558
Documentation/kbuild/Kconfig.recursion-issue-01 through the removal

‎Documentation/kbuild/makefiles.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ Both possibilities are described in the following.
680680

681681
Example:
682682
#scripts/kconfig/Makefile
683-
HOSTLOADLIBES_qconf := -L$(QTDIR)/lib
683+
HOSTLDLIBS_qconf := -L$(QTDIR)/lib
684684

685685
When linking qconf, it will be passed the extra option
686686
"-L$(QTDIR)/lib".

‎Makefile‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,15 @@ KBUILD_CFLAGS_KERNEL :=
440440
KBUILD_AFLAGS_MODULE := -DMODULE
441441
KBUILD_CFLAGS_MODULE := -DMODULE
442442
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
443-
LDFLAGS :=
443+
KBUILD_LDFLAGS :=
444444
GCC_PLUGINS_CFLAGS :=
445445

446446
export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
447447
export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
448448
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
449449
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
450450

451-
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
451+
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
452452
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
453453
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
454454
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -790,8 +790,8 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
790790
endif
791791

792792
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
793-
KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,)
794-
KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,)
793+
KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
794+
LDFLAGS_vmlinux += --gc-sections
795795
endif
796796

797797
# arch Makefile may override CC so keep this after arch Makefile is included
@@ -857,10 +857,6 @@ LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
857857
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
858858
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
859859

860-
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
861-
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
862-
endif
863-
864860
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
865861
LDFLAGS_vmlinux += $(call ld-option, -X,)
866862
endif
@@ -1024,7 +1020,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
10241020

10251021
# Final link of vmlinux with optional arch pass after final link
10261022
cmd_link-vmlinux = \
1027-
$(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
1023+
$(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
10281024
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
10291025

10301026
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
@@ -1354,16 +1350,12 @@ distclean: mrproper
13541350

13551351
# Packaging of the kernel to various formats
13561352
# ---------------------------------------------------------------------------
1357-
# rpm target kept for backward compatibility
13581353
package-dir := scripts/package
13591354

13601355
%src-pkg: FORCE
13611356
$(Q)$(MAKE) $(build)=$(package-dir) $@
13621357
%pkg: include/config/kernel.release FORCE
13631358
$(Q)$(MAKE) $(build)=$(package-dir) $@
1364-
rpm: rpm-pkg
1365-
@echo " WARNING: \"rpm\" target will be removed after Linux 4.18"
1366-
@echo " Please use \"rpm-pkg\" instead."
13671359

13681360

13691361
# Brief documentation of the typical targets used

‎arch/arc/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
9595
# Finally dump eveything into kernel build system
9696
KBUILD_CFLAGS += $(cflags-y)
9797
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
98-
LDFLAGS += $(ldflags-y)
98+
KBUILD_LDFLAGS += $(ldflags-y)
9999

100100
head-y := arch/arc/kernel/head.o
101101

‎arch/arm/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
4343
KBUILD_CPPFLAGS += -mbig-endian
4444
CHECKFLAGS += -D__ARMEB__
4545
AS += -EB
46-
LDFLAGS += -EB
46+
KBUILD_LDFLAGS += -EB
4747
else
4848
KBUILD_CPPFLAGS += -mlittle-endian
4949
CHECKFLAGS += -D__ARMEL__
5050
AS += -EL
51-
LDFLAGS += -EL
51+
KBUILD_LDFLAGS += -EL
5252
endif
5353

5454
#

‎arch/arm64/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ CHECKFLAGS += -D__AARCH64EB__
6262
AS += -EB
6363
# Prefer the baremetal ELF build target, but not all toolchains include
6464
# it so fall back to the standard linux version if needed.
65-
LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
65+
KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
6666
UTS_MACHINE := aarch64_be
6767
else
6868
KBUILD_CPPFLAGS += -mlittle-endian
6969
CHECKFLAGS += -D__AARCH64EL__
7070
AS += -EL
7171
# Same as above, prefer ELF but fall back to linux target if needed.
72-
LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
72+
KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
7373
UTS_MACHINE := aarch64
7474
endif
7575

‎arch/c6x/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
2323
KBUILD_CFLAGS += -mbig-endian
2424
KBUILD_AFLAGS += -mbig-endian
2525
LINKFLAGS += -mbig-endian
26-
KBUILD_LDFLAGS += -mbig-endian
27-
LDFLAGS += -EB
26+
KBUILD_LDFLAGS += -mbig-endian -EB
2827
CHECKFLAGS += -D_BIG_ENDIAN
2928
endif
3029

‎arch/h8300/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
2222
KBUILD_CFLAGS += -D__linux__
2323
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
2424
KBUILD_AFLAGS += $(aflags-y)
25-
LDFLAGS += $(ldflags-y)
25+
KBUILD_LDFLAGS += $(ldflags-y)
2626

2727
CHECKFLAGS += -msize-long
2828

0 commit comments

Comments
 (0)