riscv: Start using ldflags-y for 32/64bit LDFLAGS
PATCH 1/3 riscv: Start using ldflags-y for 32/64bit LDFLAGS
To prepare to update our Kbuild logic, start switching some of our cases of adding different bit/endian linker flags via ldflags-y
--- arch/riscv/config.mk | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/riscv/config.mk +3 -4
@@ -10,16 +10,14 @@ # Rick Chen, Andes Technology Corporation <[email protected]> # -32bit-emul := elf32lriscv -64bit-emul := elf64lriscv +ldflags-$(CONFIG_32BIT) := -m elf32lriscv +ldflags-$(CONFIG_64BIT) := -m elf64lriscv ifdef CONFIG_32BIT -PLATFORM_LDFLAGS += -m $(32bit-emul) EFI_LDS := elf_riscv32_efi.lds endif ifdef CONFIG_64BIT -PLATFORM_LDFLAGS += -m $(64bit-emul) EFI_LDS := elf_riscv64_efi.lds endif
@@ -29,6 +27,7 @@ PLATFORM_CPPFLAGS += -ffixed-gp -fpic PLATFORM_RELFLAGS += -fno-common -gdwarf-2 -ffunction-sections \ -fdata-sections LDFLAGS_u-boot += --gc-sections -static -pie +PLATFORM_LDFLAGS += $(ldflags-y) EFI_CRT0 := crt0_riscv_efi.o EFI_RELOC := reloc_riscv_efi.o
Signature · 1 line
2.17.1
PATCH 2/3 mips: Start using ldflags-y for 32/64bit LDFLAGS
To prepare to update our Kbuild logic, start switching some of our cases of adding different bit/endian linker flags via ldflags-y
--- arch/mips/config.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/mips/config.mk +6 -6
@@ -4,8 +4,8 @@ # Wolfgang Denk, DENX Software Engineering, wd at denx.de. ifdef CONFIG_SYS_BIG_ENDIAN -32bit-emul := elf32btsmip -64bit-emul := elf64btsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradbigmips 64bit-bfd := elf64-tradbigmips PLATFORM_CPPFLAGS += -EB
@@ -13,8 +13,8 @@ PLATFORM_LDFLAGS += -EB endif ifdef CONFIG_SYS_LITTLE_ENDIAN -32bit-emul := elf32ltsmip -64bit-emul := elf64ltsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradlittlemips 64bit-bfd := elf64-tradlittlemips PLATFORM_CPPFLAGS += -EL
@@ -23,18 +23,18 @@ endif ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 -PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 -PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif +PLATFORM_LDFLAGS += $(ldflags-y) + PLATFORM_CPPFLAGS += -D__MIPS__ PLATFORM_ELFENTRY = "__start" PLATFORM_ELFFLAGS += -B mips $(OBJCOPYFLAGS)
Signature · 1 line
2.17.1
PATCH 2/3 mips: Start using ldflags-y for 32/64bit LDFLAGS
Hi Tom,
Am 27.03.20 um 14:52 schrieb Tom Rini:
Quoted 42 lines
To prepare to update our
Kbuildlogic, start switching some of our cases of adding different bit/endian linker flags via ldflags-yCc Daniel Schwierzeck <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/mips/config.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/mips/config.mk +4
-5@@ -4,8 +4,8 @@ # Wolfgang Denk, DENX Software Engineering, wd at denx.de. ifdef CONFIG_SYS_BIG_ENDIAN -32bit-emul := elf32btsmip -64bit-emul := elf64btsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradbigmips 64bit-bfd := elf64-tradbigmips PLATFORM_CPPFLAGS += -EB@@ -13,8 +13,8 @@ PLATFORM_LDFLAGS += -EB endif ifdef CONFIG_SYS_LITTLE_ENDIAN -32bit-emul := elf32ltsmip -64bit-emul := elf64ltsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradlittlemips 64bit-bfd := elf64-tradlittlemips PLATFORM_CPPFLAGS += -EL@@ -23,18 +23,18 @@ endif ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 -PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
arch/mips/config.mk endif · line 36
Quoted 10 lines
arch/mips/config.mk +1
-1endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 -PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif +PLATFORM_LDFLAGS += $(ldflags-y)
is this change really necessary? I'd like to keep that in sync with MIPS Linux. And MIPS Linux simply changed to
KBUILD_LDFLAGS += -m $(ld-emul)
Quoted 5 lines
arch/mips/config.mk +1
-0+ PLATFORM_CPPFLAGS += -D__MIPS__ PLATFORM_ELFENTRY = "__start" PLATFORM_ELFFLAGS += -B mips $(OBJCOPYFLAGS)
Signature · 1 line
- Daniel
PATCH 2/3 mips: Start using ldflags-y for 32/64bit LDFLAGS
Quoted 54 lines · Daniel Schwierzeck
Hi Tom,
Am 27.03.20 um 14:52 schrieb Tom Rini:
Quoted 51 lines
To prepare to update our
Kbuildlogic, start switching some of our cases of adding different bit/endian linker flags via ldflags-yCc Daniel Schwierzeck <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/mips/config.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/mips/config.mk +4
-6@@ -4,8 +4,8 @@ # Wolfgang Denk, DENX Software Engineering, wd at denx.de. ifdef CONFIG_SYS_BIG_ENDIAN -32bit-emul := elf32btsmip -64bit-emul := elf64btsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradbigmips 64bit-bfd := elf64-tradbigmips PLATFORM_CPPFLAGS += -EB@@ -13,8 +13,8 @@ PLATFORM_LDFLAGS += -EB endif ifdef CONFIG_SYS_LITTLE_ENDIAN -32bit-emul := elf32ltsmip -64bit-emul := elf64ltsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradlittlemips 64bit-bfd := elf64-tradlittlemips PLATFORM_CPPFLAGS += -EL@@ -23,18 +23,18 @@ endif ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 -PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 -PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif
Quoted 6 lines
arch/mips/config.mk endif · line 36
Quoted 1 line
arch/mips/config.mk +1
-0+PLATFORM_LDFLAGS += $(ldflags-y)is this change really necessary? I'd like to keep that in sync with MIPS Linux. And MIPS Linux simply changed to
KBUILD_LDFLAGS+= -m $(ld-emul)
Pretty sure it was the only way I got ci20 to continue to build. I'll go try a one-off local branch and re-confirm now that I have other issues resolved too. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200327/d81f2cbd/attachment.sig>
PATCH 2/3 mips: Start using ldflags-y for 32/64bit LDFLAGS
In reply to Daniel SchwierzeckQuoted 54 lines · Daniel Schwierzeck
Hi Tom,
Am 27.03.20 um 14:52 schrieb Tom Rini:
Quoted 51 lines
To prepare to update our
Kbuildlogic, start switching some of our cases of adding different bit/endian linker flags via ldflags-yCc Daniel Schwierzeck <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/mips/config.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/mips/config.mk +4
-6@@ -4,8 +4,8 @@ # Wolfgang Denk, DENX Software Engineering, wd at denx.de. ifdef CONFIG_SYS_BIG_ENDIAN -32bit-emul := elf32btsmip -64bit-emul := elf64btsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradbigmips 64bit-bfd := elf64-tradbigmips PLATFORM_CPPFLAGS += -EB@@ -13,8 +13,8 @@ PLATFORM_LDFLAGS += -EB endif ifdef CONFIG_SYS_LITTLE_ENDIAN -32bit-emul := elf32ltsmip -64bit-emul := elf64ltsmip +ldflags-$(CONFIG_32BIT) += -m elf32btsmip +ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradlittlemips 64bit-bfd := elf64-tradlittlemips PLATFORM_CPPFLAGS += -EL@@ -23,18 +23,18 @@ endif ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 -PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 -PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif
Quoted 6 lines
arch/mips/config.mk endif · line 36
Quoted 1 line
arch/mips/config.mk +1
-0+PLATFORM_LDFLAGS += $(ldflags-y)is this change really necessary? I'd like to keep that in sync with MIPS Linux. And MIPS Linux simply changed to
KBUILD_LDFLAGS+= -m $(ld-emul)
OK, looks like this was a side-effect of when I was still debugging other link problems, please disregard this and 1/3 as well. I'll post v2 once I've done a world build of mips/riscv. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200327/a4ebdc80/attachment.sig>
PATCH 3/3 kconfig / kbuild: Re-sync with Linux 4.19
In reply to Tom RiniAlign Kconfig and Kbuild logic to Linux 4.19 release with minimal impact on files outside of this scope.
Our previous Kconfig sync was done by commit 5972ff077e0f ("kconfig /
kbuild: re-sync with Linux 4.18").
In this particular re-sync in order to keep clang support working a number of related changes needed to be pulled in that had been missed previously. Not all of these changes we easily traceable and so have been omitted from the list below.
The imported Linux commits are:
[From prior to v4.18]9f3f1fd29976 kbuild: Add __cc-option macrod7f14c66c273 kbuild: Enable Large File Support for hostprogs 6d79a7b424a5 kbuild: suppress warnings from 'getconf LFS_*' 24403874316a Shared library support86a9df597cdd kbuild: fix linker feature test macros when cross compiling with Clang 0294e6f4a000 kbuild: simplify ld-option implementation
[From v4.18 to v4.19]96f14fe738b6 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS10844aebf448 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS b90a368000ab kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS 8377bd2b9ee1 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS f92d19e0ef9b kbuild: Use HOST*FLAGS options from the command line 4ab3b80159d4 kconfig: check for pkg-config on make {menu,n,g,x}config 693359f7ac90 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITEf60b992e30ff kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags) 2fb9279f2c3e kbuild: change ld_flags to contain LDFLAGS_$(@F) c931d34ea085 arm64: build with baremetal linker target instead of Linux when available 5accd7f3360e kconfig: handle format string before calling conf_message_callback() a2ff4040151a kconfig: rename file_write_dep and move it to confdata.c 0608182ad542 kconfig: split out useful helpers in confdata.c adc18acf42a1 kconfig: remove unneeded directory generation from local*config 79123b1389cc kconfig: create directories needed for syncconfig by itself 16952b77d8b5 kconfig: make syncconfig update .config regardless of sym_change_count d6c6ab93e17f kbuild: remove deprecated host-progs variable56869d45e364 kconfig: fix the rule of mainmenu_stmt symbolc151272d1687 kconfig: remove unused sym_get_env_prop() function 1880861226c1 kconfig: remove P_ENV property typee3fd9b5384f3 scripts/dtc: consolidate include path options in Makefile 4bf6a9af0e91 kconfig: add build-only configurator targetsf1575595d156 kconfig: error out when seeing recursive dependency 5e8c5299d315 kconfig: report recursive dependency involving 'imply' f498926c47aa kconfig: improve the recursive dependency report 98a4afbfafd2 kconfig: fix "Can't open ..." in parallel build 9a9ddcf47831 kconfig: suppress "configuration written to .config" for syncconfig 87a32e624037 kbuild: pass LDFLAGS to recordmcount.pld503ac531a52 kbuild: rename LDFLAGS to KBUILD_LDFLAGS217c3e019675 disable stringop truncation warnings for nowbc8d2e20a3eb kconfig: remove a spurious self-assignmentfd65465b7016 kconfig: do not require pkg-config on make {menu,n}config 5a4630aadb9a ftrace: Build with CPPFLAGS to get -Qunused-arguments
Note that this adds new cleanup work to do in that we should adapt the shared library support we have to what is now upstream.
---
Makefile | 66 ++++++--
arch/arc/config.mk | 4 +-
arch/m68k/Makefile | 2 +-
arch/m68k/config.mk | 2 +-
arch/mips/config.mk | 8 +-
arch/powerpc/config.mk | 2 +-
arch/riscv/config.mk | 2 +-
arch/x86/config.mk | 8 +-
config.mk | 4 +-
examples/standalone/Makefile | 2 +-
scripts/Kbuild.include | 22 ++-
scripts/Makefile.build | 15 +-
scripts/Makefile.clean | 5 +-
scripts/Makefile.host | 64 +++++++-
scripts/Makefile.lib | 5 +-
scripts/Makefile.spl | 2 +-
scripts/dtc/Makefile | 18 +--
scripts/kconfig/Makefile | 36 +++--
scripts/kconfig/conf.c | 15 +-
scripts/kconfig/confdata.c | 147 ++++++++++++++----
scripts/kconfig/expr.h | 3 +-
scripts/kconfig/gconf-cfg.sh | 7 +
scripts/kconfig/gconf.c | 4 +-
scripts/kconfig/lkc.h | 2 -
scripts/kconfig/lkc_proto.h | 2 +-
scripts/kconfig/mconf-cfg.sh | 25 +--
scripts/kconfig/mconf.c | 10 +-
scripts/kconfig/menu.c | 2 +-
scripts/kconfig/nconf-cfg.sh | 25 +--
scripts/kconfig/nconf.c | 7 +-
scripts/kconfig/qconf-cfg.sh | 7 +
scripts/kconfig/qconf.cc | 1 -
scripts/kconfig/symbol.c | 71 +++++----
.../Kconfig | 3 +-
.../tests/err_recursive_dep/__init__.py | 10 ++
.../tests/err_recursive_dep/expected_stderr | 38 +++++
.../tests/warn_recursive_dep/__init__.py | 9 --
.../tests/warn_recursive_dep/expected_stderr | 30 ----
scripts/kconfig/util.c | 30 ----
scripts/kconfig/zconf.y | 6 +-
tools/Makefile | 8 +-
41 files changed, 456 insertions(+), 273 deletions(-)
rename scripts/kconfig/tests/{warn_recursive_dep => err_recursive_dep}/Kconfig (93%)
create mode 100644 scripts/kconfig/tests/err_recursive_dep/__init__.py
create mode 100644 scripts/kconfig/tests/err_recursive_dep/expected_stderr
delete mode 100644 scripts/kconfig/tests/warn_recursive_dep/__init__.py
delete mode 100644 scripts/kconfig/tests/warn_recursive_dep/expected_stderrMakefile +52 -14
@@ -271,11 +271,17 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi) +HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null) +HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null) +HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) + HOSTCC = cc HOSTCXX = c++ -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ - $(if $(CONFIG_TOOLS_DEBUG),-g) -HOSTCXXFLAGS = -O2 +KBUILD_HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ + $(if $(CONFIG_TOOLS_DEBUG),-g) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) +KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) +KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) +KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) # With the move to GCC 6, we have implicitly upgraded our language # standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html).
@@ -284,11 +290,11 @@ HOSTCXXFLAGS = -O2 # these that our host tools are GNU11 (i.e. C11 w/ GNU extensions). CSTD_FLAG := -std=gnu11 ifeq ($(HOSTOS),linux) -HOSTCFLAGS += $(CSTD_FLAG) +KBUILD_HOSTCFLAGS += $(CSTD_FLAG) endif ifeq ($(HOSTOS),cygwin) -HOSTCFLAGS += -ansi +KBUILD_HOSTCFLAGS += -ansi endif # Mac OS X / Darwin's C preprocessor is Apple specific. It
@@ -315,17 +321,17 @@ os_x_after = $(shell if [ $(DARWIN_MAJOR_VERSION) -ge $(1) -a \ # Snow Leopards build environment has no longer restrictions as described above HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") -HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") -HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") +KBUILD_HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") +KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") # since Lion (10.7) ASLR is on by default, but we use linker generated lists # in some host tools which is a problem then ... so disable ASLR for these # tools -HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie") +KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie") # macOS Mojave (10.14.X) # Undefined symbols for architecture x86_64: "_PyArg_ParseTuple" -HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "") +KBUILD_HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "") endif # Decide whether to build built-in, modular, or both.
@@ -417,6 +423,23 @@ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ -fno-builtin -ffreestanding $(CSTD_FLAG) KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing KBUILD_AFLAGS := -D__ASSEMBLY__ +KBUILD_LDFLAGS := + +ifeq ($(cc-name),clang) +ifneq ($(CROSS_COMPILE),) +CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) +GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) +CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) +GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) +endif +ifneq ($(GCC_TOOLCHAIN),) +CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) +endif +KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) +KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) +KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) +KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +endif # Don't generate position independent code KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
@@ -428,12 +451,12 @@ UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SU export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR -export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC -export CPP AR NM LDR STRIP OBJCOPY OBJDUMP +export CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC +export CPP AR NM LDR STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3 -export HOSTCXX HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS +export HOSTCXX KBUILD_HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS -export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS LDFLAGS +export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS export KBUILD_CFLAGS KBUILD_AFLAGS export CC_VERSION_TEXT := $(shell $(CC) --version | head -n 1)
@@ -656,6 +679,9 @@ endif KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks) +# disable stringop warnings in gcc 8+ +KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) + # change __FILE__ to the relative path from the srctree KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
@@ -680,7 +706,19 @@ ifeq ($(cc-name),clang) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) +KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) +# Quiet clang warning: comparison of unsigned expression < 0 is always false +KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) +# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the +# source of a reference will be _MergedGlobals and not on of the whitelisted names. +# See modpost pattern 2 +KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) +else + +# These warnings generated too much noise in a regular build. +# Use make W=1 to enable them (see scripts/Makefile.extrawarn) +KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) endif # turn jbsr into jsr for m68k
@@ -1691,7 +1729,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink) # Rule to link u-boot # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot__ ?= LD $@ - cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \ + cmd_u-boot__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_u-boot) -o $@ \ -T u-boot.lds $(u-boot-init) \ --start-group $(u-boot-main) --end-group \ $(PLATFORM_LIBS) -Map u-boot.map; \
arch/arc/config.mk +2 -2
@@ -9,12 +9,12 @@ CONFIG_SYS_BIG_ENDIAN = 1 endif ifdef CONFIG_SYS_LITTLE_ENDIAN -PLATFORM_LDFLAGS += -EL +KBUILD_LDFLAGS += -EL PLATFORM_CPPFLAGS += -mlittle-endian endif ifdef CONFIG_SYS_BIG_ENDIAN -PLATFORM_LDFLAGS += -EB +KBUILD_LDFLAGS += -EB PLATFORM_CPPFLAGS += -mbig-endian endif
arch/m68k/Makefile +1 -1
@@ -30,6 +30,6 @@ ldflags-$(CONFIG_MCF547x_8x) := --got=single ifneq (,$(findstring -linux-,$(shell $(CC) --version))) ifneq (,$(findstring GOT,$(shell $(LD) --help))) -PLATFORM_LDFLAGS += $(ldflags-y) +KBUILD_LDFLAGS += $(ldflags-y) endif endif
arch/m68k/config.mk +1 -1
@@ -10,7 +10,7 @@ endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 PLATFORM_CPPFLAGS += -D__M68K__ -PLATFORM_LDFLAGS += -n +KBUILD_LDFLAGS += -n PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_RELFLAGS += -ffixed-d7 -msep-data LDFLAGS_FINAL += --gc-sections
arch/mips/config.mk +4 -4
@@ -9,7 +9,7 @@ ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradbigmips 64bit-bfd := elf64-tradbigmips PLATFORM_CPPFLAGS += -EB -PLATFORM_LDFLAGS += -EB +KBUILD_LDFLAGS += -EB endif ifdef CONFIG_SYS_LITTLE_ENDIAN
@@ -18,7 +18,7 @@ ldflags-$(CONFIG_64BIT) += -m elf64btsmip 32bit-bfd := elf32-tradlittlemips 64bit-bfd := elf64-tradlittlemips PLATFORM_CPPFLAGS += -EL -PLATFORM_LDFLAGS += -EL +KBUILD_LDFLAGS += -EL endif ifdef CONFIG_32BIT
@@ -33,7 +33,7 @@ OBJCOPYFLAGS += -O $(64bit-bfd) CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif -PLATFORM_LDFLAGS += $(ldflags-y) +KBUILD_LDFLAGS += $(ldflags-y) PLATFORM_CPPFLAGS += -D__MIPS__ PLATFORM_ELFENTRY = "__start"
@@ -63,7 +63,7 @@ endif PLATFORM_CPPFLAGS += -G 0 -mno-abicalls -fno-pic PLATFORM_CPPFLAGS += -msoft-float -PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib +KBUILD_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list
arch/powerpc/config.mk +1 -1
@@ -15,7 +15,7 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \ PF_CPPFLAGS_POWERPC := $(call cc-option,-fno-ira-hoist-pressure,) PLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2 -m32 $(PF_CPPFLAGS_POWERPC) -PLATFORM_LDFLAGS += -m32 -melf32ppclinux +KBUILD_LDFLAGS += -m32 -melf32ppclinux # # When cross-compiling on NetBSD, we have to define __PPC__ or else we
arch/riscv/config.mk +1 -1
@@ -27,7 +27,7 @@ PLATFORM_CPPFLAGS += -ffixed-gp -fpic PLATFORM_RELFLAGS += -fno-common -gdwarf-2 -ffunction-sections \ -fdata-sections LDFLAGS_u-boot += --gc-sections -static -pie -PLATFORM_LDFLAGS += $(ldflags-y) +KBUILD_LDFLAGS += $(ldflags-y) EFI_CRT0 := crt0_riscv_efi.o EFI_RELOC := reloc_riscv_efi.o
arch/x86/config.mk +4 -4
@@ -29,11 +29,11 @@ endif PLATFORM_RELFLAGS += -fdata-sections -ffunction-sections -fvisibility=hidden -PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) +KBUILD_LDFLAGS += -Bsymbolic -Bsymbolic-functions +KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) # This is used in the top-level Makefile which does not include -# PLATFORM_LDFLAGS +# KBUILD_LDFLAGS LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -s OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
@@ -71,7 +71,7 @@ LDSCRIPT := $(LDSCRIPT_EFI) else PLATFORM_CPPFLAGS += $(CFLAGS_NON_EFI) -PLATFORM_LDFLAGS += --emit-relocs +KBUILD_LDFLAGS += --emit-relocs LDFLAGS_FINAL += --gc-sections $(if $(CONFIG_SPL_BUILD),,-pie) endif
config.mk +1 -3
@@ -12,8 +12,7 @@ # If we did not have Tegra SoCs, build system would be much simpler...) PLATFORM_RELFLAGS := PLATFORM_CPPFLAGS := -PLATFORM_LDFLAGS := -LDFLAGS := +KBUILD_LDFLAGS := LDFLAGS_FINAL := LDFLAGS_STANDALONE := OBJCOPYFLAGS :=
@@ -70,7 +69,6 @@ RELFLAGS := $(PLATFORM_RELFLAGS) PLATFORM_CPPFLAGS += $(RELFLAGS) PLATFORM_CPPFLAGS += -pipe -LDFLAGS += $(PLATFORM_LDFLAGS) LDFLAGS_FINAL += -Bstatic export PLATFORM_CPPFLAGS
examples/standalone/Makefile +1 -1
@@ -55,7 +55,7 @@ $(LIB): $(LIBOBJS) FORCE $(call if_changed,link_lib) quiet_cmd_link_elf = LD $@ - cmd_link_elf = $(LD) $(LDFLAGS) $(LDFLAGS_STANDALONE) -g \ + cmd_link_elf = $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_STANDALONE) -g \ -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC) $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
scripts/Kbuild.include +15 -7
@@ -109,11 +109,20 @@ as-option = $(call try-run,\ as-instr = $(call try-run,\ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) +# __cc-option +# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) +__cc-option = $(call try-run,\ + $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) + # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) +cc-option = $(call __cc-option, $(CC),\ + $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2)) -cc-option = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) +# hostcc-option +# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) +hostcc-option = $(call __cc-option, $(HOSTCC),\ + $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
@@ -123,7 +132,7 @@ cc-option-yn = $(call try-run,\ # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-disable-warning = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) + $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) # cc-name # Expands to either gcc or clang
@@ -146,12 +155,11 @@ binutils-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/binutils-version.s # cc-ldoption # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) cc-ldoption = $(call try-run,\ - $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) + $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) # ld-option -# Usage: LDFLAGS += $(call ld-option, -X) -ld-option = $(call try-run,\ - $(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) +# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) +ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) # ar-option # Usage: KBUILD_ARFLAGS := $(call ar-option,D)
scripts/Makefile.build +4 -11
@@ -70,15 +70,8 @@ endif include scripts/Makefile.lib -ifdef host-progs -ifneq ($(hostprogs-y),$(host-progs)) -$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!) -hostprogs-y += $(host-progs) -endif -endif - # Do not include host rules unless needed -ifneq ($(hostprogs-y)$(hostprogs-m),) +ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) include scripts/Makefile.host endif
@@ -221,7 +214,7 @@ cmd_modversions = \ $(call cmd_gensymtypes,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ > $(@D)/.tmp_$(@F:.o=.ver); \ \ - $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ + $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ -T $(@D)/.tmp_$(@F:.o=.ver); \ rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ else \
@@ -253,8 +246,8 @@ else sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ "$(if $(CONFIG_64BIT),64,32)" \ - "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ - "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ + "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)" \ + "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ "$(if $(part-of-module),1,0)" "$(@)"; recordmcount_source := $(srctree)/scripts/recordmcount.pl endif
scripts/Makefile.clean +3 -2
@@ -43,8 +43,9 @@ subdir-ymn := $(foreach f, $(subdir-ymn), \ __clean-files := $(extra-y) $(extra-m) $(extra-) \ $(always) $(targets) $(clean-files) \ - $(host-progs) \ - $(hostprogs-y) $(hostprogs-m) $(hostprogs-) + $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ + $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ + $(hostcxxlibs-y) $(hostcxxlibs-m) __clean-files := $(filter-out $(no-clean-files), $(__clean-files))
scripts/Makefile.host +56 -8
114 lines not on this page · raw message
scripts/Makefile.lib +2 -3
@@ -161,7 +161,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \ $(__cpp_flags) -ld_flags = $(LDFLAGS) $(ldflags-y) +ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) # Try these files in order to find the U-Boot-specific .dtsi include file u_boot_dtsi_options = $(strip $(wildcard $(dir $<)$(basename $(notdir $<))-u-boot.dtsi) \
@@ -256,8 +256,7 @@ $(obj)/%: $(src)/%_shipped # --------------------------------------------------------------------------- quiet_cmd_ld = LD $@ -cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ - $(filter-out FORCE,$^) -o $@ +cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@ # Objcopy # ---------------------------------------------------------------------------
scripts/Makefile.spl +1 -1
@@ -407,7 +407,7 @@ $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE # Rule to link u-boot-spl # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot-spl ?= LD $@ - cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \ + cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_$(@F)) \ $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \ $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \ $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \
scripts/dtc/Makefile +4 -14
@@ -9,21 +9,11 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o # Source files need to get@the userspace version of libfdt_env.h to compile +HOST_EXTRACFLAGS := -I$(src)/libfdt -HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt - -HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC) - -HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) +# Generated files need one more search path to include headers in source tree +HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) +HOSTCFLAGS_dtc-parser.tab.o := -I$(src) # dependencies on generated files need to be listed explicitly $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
scripts/kconfig/Makefile +21 -15
@@ -3,8 +3,8 @@ # Kernel configuration targets # These targets are used from top-level makefile -PHONY += xconfig gconfig menuconfig config syncconfig \ - localmodconfig localyesconfig +PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \ + build_menuconfig build_nconfig build_gconfig build_xconfig # Added for U-Boot # Linux has defconfig files in arch/$(SRCARCH)/configs/,
@@ -40,14 +40,15 @@ config: $(obj)/conf nconfig: $(obj)/nconf $< $(silent) $(Kconfig) -# This has become an internal implementation detail and is now deprecated -# for external use. -syncconfig: $(obj)/conf - $(Q)mkdir -p include/config include/generated - $< $(silent) --$@ $(Kconfig) +build_menuconfig: $(obj)/mconf + +build_nconfig: $(obj)/nconf + +build_gconfig: $(obj)/gconf + +build_xconfig: $(obj)/qconf localyesconfig localmodconfig: $(obj)/conf - $(Q)mkdir -p include/config include/generated $(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config $(Q)if [ -f .config ]; then \ cmp -s .tmp.config .config || \
@@ -62,8 +63,12 @@ localyesconfig localmodconfig: $(obj)/conf $(Q)rm -f .tmp.config # These targets map 1:1 to the commandline options of 'conf' +# +# Note: +# syncconfig has become an internal implementation detail and is now +# deprecated for external use simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ - alldefconfig randconfig listnewconfig olddefconfig + alldefconfig randconfig listnewconfig olddefconfig syncconfig PHONY += $(simple-targets) $(simple-targets): $(obj)/conf
@@ -179,29 +184,30 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) hostprogs-y += nconf nconf-objs := nconf.o zconf.tab.o nconf.gui.o -HOSTLOADLIBES_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) +HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) -$(obj)/nconf.o: $(obj)/.nconf-cfg +$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg # mconf: Used for the menuconfig target based on lxdialog hostprogs-y += mconf lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) -HOSTLOADLIBES_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) +HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) $(foreach f, mconf.o $(lxdialog), \ $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags))) -$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg +$(obj)/mconf.o: $(obj)/.mconf-cfg +$(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg # qconf: Used for the xconfig target based on Qt hostprogs-y += qconf qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o -HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) +HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) $(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc
@@ -216,7 +222,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg hostprogs-y += gconf gconf-objs := gconf.o zconf.tab.o -HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) +HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) $(obj)/gconf.o: $(obj)/.gconf-cfg
scripts/kconfig/conf.c +11 -4
@@ -496,6 +496,7 @@ int main(int ac, char **av)int opt;const char *name, *defconfig_file =NULL /* gcc uninit */ ;struct stat tmpstat; +int no_conf_write =0 ; tty_stdio =isatty (0 ) &&isatty (1 );
@@ -507,6 +508,11 @@ int main(int ac, char **av) input_mode = (enum input_mode )opt;switch (opt) {case syncconfig: +/* +* syncconfig is invoked during the build stage. +* Suppress distracting "configuration written to ..." +*/ +conf_set_message_callback (NULL ); sync_kconfig =1 ;break ;case defconfig:
@@ -633,13 +639,14 @@ int main(int ac, char **av) }if (sync_kconfig) { -if (conf_get_changed ()) { - name =getenv ("KCONFIG_NOSILENTUPDATE" ); -if (name && *name) { + name =getenv ("KCONFIG_NOSILENTUPDATE" ); +if (name && *name) { +if (conf_get_changed ()) {fprintf (stderr,"\n*** The configuration requires explicit update.\n\n" );return 1 ; } + no_conf_write =1 ; } }
@@ -688,7 +695,7 @@ int main(int ac, char **av)/* syncconfig is used during the build so we shall update autoconf. * All other commands are only used to generate a config. */ -if (conf_get_changed () &&conf_write (NULL )) { +if (!no_conf_write &&conf_write (NULL )) {fprintf (stderr,"\n*** Error during writing of the configuration.\n\n" );exit (1 ); }
scripts/kconfig/confdata.c +121 -26
250 lines not on this page · raw message
scripts/kconfig/expr.h +1 -2
@@ -141,7 +141,7 @@ struct symbol {#define SYMBOL_OPTIONAL 0x0100/* choice is optional - values can be 'n' */ #define SYMBOL_WRITE 0x0200/* write symbol to file (KCONFIG_CONFIG) */ #define SYMBOL_CHANGED 0x0400/* ? */ -#define SYMBOL_AUTO 0x1000/* value from environment variable */ +#define SYMBOL_NO_WRITE 0x1000/* Symbol for internal use only; it will not be written */ #define SYMBOL_CHECKED 0x2000/* used during dependency checking */ #define SYMBOL_WARNED 0x8000/* warning has been issued */
@@ -185,7 +185,6 @@ enum prop_type {P_SELECT ,/* select BAR */ P_IMPLY ,/* imply BAR */ P_RANGE ,/* range 7..100 (for a symbol) */ -P_ENV ,/* value from environment variable */ P_SYMBOL, /* where a symbol is defined */ };
scripts/kconfig/gconf-cfg.sh +7 -0
@@ -3,6 +3,13 @@ PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" +if [ -z "$(command -v pkg-config)" ]; then + echo >&2 "*" + echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it." + echo >&2 "*" + exit 1 +fi + if ! pkg-config --exists $PKG; then echo >&2 "*" echo >&2 "* Unable to find the GTK+ installation. Please make sure that"
scripts/kconfig/gconf.c +2 -2
@@ -101,8 +101,8 @@ const char *dbg_sym_flags(int val)strcat (buf,"write/" );if (val &SYMBOL_CHANGED )strcat (buf,"changed/" ); -if (val &SYMBOL_AUTO ) -strcat (buf,"auto/" ); +if (val &SYMBOL_NO_WRITE ) +strcat (buf,"no_write/" ); buf[strlen (buf) -1 ] ='\0' ;
scripts/kconfig/lkc.h +0 -2
@@ -97,7 +97,6 @@ void menu_set_type(int type);/* util.c */ struct file *file_lookup (const char *name); -int file_write_dep (const char *name);void *xmalloc (size_t size);void *xcalloc (size_t nmemb,size_t size);void *xrealloc (void *p,size_t size);
@@ -126,7 +125,6 @@ const char *sym_get_string_default(struct symbol *sym);struct symbol *sym_check_deps (struct symbol *sym);struct property *prop_alloc (enum prop_type type,struct symbol *sym);struct symbol *prop_get_symbol (struct property *prop); -struct property *sym_get_env_prop (struct symbol *sym);static inline tristate sym_get_tristate_value (struct symbol *sym) {
scripts/kconfig/lkc_proto.h +1 -1
@@ -10,7 +10,7 @@ int conf_write(const char *name);int conf_write_autoconf (void );bool conf_get_changed (void );void conf_set_changed_callback (void (*fn)(void )); -void conf_set_message_callback (void (*fn)(const char *fmt,va_list ap)); +void conf_set_message_callback (void (*fn)(const char *s));/* menu.c */ extern struct menu rootmenu;
scripts/kconfig/mconf-cfg.sh +14 -11
@@ -4,20 +4,23 @@ PKG="ncursesw" PKG2="ncurses" -if pkg-config --exists $PKG; then - echo cflags=\"$(pkg-config --cflags $PKG)\" - echo libs=\"$(pkg-config --libs $PKG)\" - exit 0 -fi +if [ -n "$(command -v pkg-config)" ]; then + if pkg-config --exists $PKG; then + echo cflags=\"$(pkg-config --cflags $PKG)\" + echo libs=\"$(pkg-config --libs $PKG)\" + exit 0 + fi -if pkg-config --exists $PKG2; then - echo cflags=\"$(pkg-config --cflags $PKG2)\" - echo libs=\"$(pkg-config --libs $PKG2)\" - exit 0 + if pkg-config --exists $PKG2; then + echo cflags=\"$(pkg-config --cflags $PKG2)\" + echo libs=\"$(pkg-config --libs $PKG2)\" + exit 0 + fi fi -# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses -# by pkg-config. +# Check the default paths in case pkg-config is not installed. +# (Even if it is installed, some distributions such as openSUSE cannot +# find ncurses by pkg-config.) if [ -f /usr/include/ncursesw/ncurses.h ]; then echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" echo libs=\"-lncursesw\"
scripts/kconfig/mconf.c +3 -7
@@ -490,7 +490,6 @@ static void build_conf(struct menu *menu)switch (prop->type) {case P_MENU : child_count++; - prompt = prompt;if (single_menu_mode) { item_make("%s%*c%s", menu->data ? "-->" : "++>",
@@ -772,16 +771,13 @@ static void show_helptext(const char *title, const char *text)show_textbox (title, text,0 ,0 ); } -static void conf_message_callback (const char *fmt,va_list ap) +static void conf_message_callback (const char *s) { -char buf[PATH_MAX +1 ]; - -vsnprintf (buf,sizeof (buf), fmt, ap);if (save_and_exit) {if (!silent) -printf ("%s" , buf); +printf ("%s" , s); }else { -show_textbox (NULL , buf,6 ,60 ); +show_textbox (NULL , s,6 ,60 ); } }
scripts/kconfig/menu.c +1 -1
@@ -212,7 +212,7 @@ void menu_add_option(int token, char *arg) sym_defconfig_list = current_entry->sym; else if (sym_defconfig_list != current_entry->sym) zconf_error("trying to redefine defconfig symbol"); - sym_defconfig_list->flags |=SYMBOL_AUTO ; + sym_defconfig_list->flags |=SYMBOL_NO_WRITE ;break ;case T_OPT_ALLNOCONFIG_Y : current_entry->sym->flags |=SYMBOL_ALLNOCONFIG_Y ;
scripts/kconfig/nconf-cfg.sh +14 -11
@@ -4,20 +4,23 @@ PKG="ncursesw menuw panelw" PKG2="ncurses menu panel" -if pkg-config --exists $PKG; then - echo cflags=\"$(pkg-config --cflags $PKG)\" - echo libs=\"$(pkg-config --libs $PKG)\" - exit 0 -fi +if [ -n "$(command -v pkg-config)" ]; then + if pkg-config --exists $PKG; then + echo cflags=\"$(pkg-config --cflags $PKG)\" + echo libs=\"$(pkg-config --libs $PKG)\" + exit 0 + fi -if pkg-config --exists $PKG2; then - echo cflags=\"$(pkg-config --cflags $PKG2)\" - echo libs=\"$(pkg-config --libs $PKG2)\" - exit 0 + if pkg-config --exists $PKG2; then + echo cflags=\"$(pkg-config --cflags $PKG2)\" + echo libs=\"$(pkg-config --libs $PKG2)\" + exit 0 + fi fi -# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses -# by pkg-config. +# Check the default paths in case pkg-config is not installed. +# (Even if it is installed, some distributions such as openSUSE cannot +# find ncurses by pkg-config.) if [ -f /usr/include/ncursesw/ncurses.h ]; then echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" echo libs=\"-lncursesw -lmenuw -lpanelw\"
scripts/kconfig/nconf.c +2 -5
@@ -1210,12 +1210,9 @@ static void conf(struct menu *menu) } } -static void conf_message_callback (const char *fmt,va_list ap) +static void conf_message_callback (const char *s) { -char buf[1024 ]; - -vsnprintf (buf,sizeof (buf), fmt, ap); -btn_dialog (main_window, buf,1 ,"<OK>" ); +btn_dialog (main_window, s,1 ,"<OK>" ); }static void show_help (struct menu *menu)
scripts/kconfig/qconf-cfg.sh +7 -0
@@ -4,6 +4,13 @@ PKG="Qt5Core Qt5Gui Qt5Widgets" PKG2="QtCore QtGui" +if [ -z "$(command -v pkg-config)" ]; then + echo >&2 "*" + echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it." + echo >&2 "*" + exit 1 +fi + if pkg-config --exists $PKG; then echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\" echo libs=\"$(pkg-config --libs $PKG)\"
scripts/kconfig/qconf.cc +0 -1
@@ -1149,7 +1149,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym) case P_DEFAULT: case P_SELECT: case P_RANGE: - case P_ENV: debug += prop_get_type_name(prop->type); debug += ": "; expr_print(prop->expr, expr_print_help, &debug, E_NONE);
scripts/kconfig/symbol.c +41 -30
137 lines not on this page · raw message
scripts/kconfig/tests/err_recursive_dep/Kconfig renamed from scripts/kconfig/tests/warn_recursive_dep/Kconfig +2 -1
@@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + # depends on itself config A
@@ -31,7 +33,6 @@ config D2 bool # depends on and imply -# This is not recursive dependency config E1 bool "E1"
scripts/kconfig/tests/err_recursive_dep/__init__.py new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 +""" +Detect recursive dependency error. + +Recursive dependency should be treated as an error. +""" + +def test(conf): + assert conf.oldaskconfig() == 1 + assert conf.stderr_contains('expected_stderr')
scripts/kconfig/tests/err_recursive_dep/expected_stderr new file +38 -0
@@ -0,0 +1,38 @@ +Kconfig:11:error: recursive dependency detected! +Kconfig:11: symbol B is selected by B +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:5:error: recursive dependency detected! +Kconfig:5: symbol A depends on A +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:17:error: recursive dependency detected! +Kconfig:17: symbol C1 depends on C2 +Kconfig:21: symbol C2 depends on C1 +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:32:error: recursive dependency detected! +Kconfig:32: symbol D2 is selected by D1 +Kconfig:27: symbol D1 depends on D2 +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:37:error: recursive dependency detected! +Kconfig:37: symbol E1 depends on E2 +Kconfig:42: symbol E2 is implied by E1 +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:60:error: recursive dependency detected! +Kconfig:60: symbol G depends on G +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations" + +Kconfig:51:error: recursive dependency detected! +Kconfig:51: symbol F2 depends on F1 +Kconfig:49: symbol F1 default value contains F2 +For a resolution refer to Documentation/kbuild/kconfig-language.txt +subsection "Kconfig recursive dependency limitations"
scripts/kconfig/tests/warn_recursive_dep/__init__.py deleted +0 -9
@@ -1,9 +0,0 @@ -""" -Warn recursive inclusion. - -Recursive dependency should be warned. -""" - -def test(conf): - assert conf.oldaskconfig() == 0 - assert conf.stderr_contains('expected_stderr')
scripts/kconfig/tests/warn_recursive_dep/expected_stderr deleted +0 -30
@@ -1,30 +0,0 @@ -Kconfig:9:error: recursive dependency detected! -Kconfig:9: symbol B is selected by B -For a resolution refer to Documentation/kbuild/kconfig-language.txt -subsection "Kconfig recursive dependency limitations" - -Kconfig:3:error: recursive dependency detected! -Kconfig:3: symbol A depends on A -For a resolution refer to Documentation/kbuild/kconfig-language.txt -subsection "Kconfig recursive dependency limitations" - -Kconfig:15:error: recursive dependency detected! -Kconfig:15: symbol C1 depends on C2 -Kconfig:19: symbol C2 depends on C1 -For a resolution refer to Documentation/kbuild/kconfig-language.txt -subsection "Kconfig recursive dependency limitations" - -Kconfig:30:error: recursive dependency detected! -Kconfig:30: symbol D2 is selected by D1 -Kconfig:25: symbol D1 depends on D2 -For a resolution refer to Documentation/kbuild/kconfig-language.txt -subsection "Kconfig recursive dependency limitations" - -Kconfig:59:error: recursive dependency detected! -Kconfig:59: symbol G depends on G -For a resolution refer to Documentation/kbuild/kconfig-language.txt -subsection "Kconfig recursive dependency limitations" - -Kconfig:50:error: recursive dependency detected! -Kconfig:50: symbol F2 depends on F1 -Kconfig:48: symbol F1 default value contains F2
scripts/kconfig/util.c +0 -30
@@ -29,36 +29,6 @@ struct file *file_lookup(const char *name)return file; } -/* write a dependency file as used by kbuild to track dependencies */ -int file_write_dep (const char *name) -{ -struct file *file; -FILE *out; - -if (!name) - name =".kconfig.d" ; - out =fopen ("..config.tmp" ,"w" ); -if (!out) -return 1 ; -fprintf (out,"deps_config := \\\n" ); -for (file = file_list; file; file = file->next) { -if (file->next) -fprintf (out,"\t%s \\\n" , file->name); -else -fprintf (out,"\t%s\n" , file->name); - } -fprintf (out,"\n%s: \\\n" -"\t$(deps_config)\n\n" ,conf_get_autoconfig_name ()); - -env_write_dep (out,conf_get_autoconfig_name ()); - -fprintf (out,"\n$(deps_config): ;\n" ); -fclose (out); -rename ("..config.tmp" , name); -return 0 ; -} - -/* Allocate initial growable string */ struct gstr str_new (void ) {
scripts/kconfig/zconf.y +3 -3
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; static struct menu *current_menu, *current_entry; %} -%expect 31 +%expect 30 %union {
@@ -117,7 +117,7 @@ start: mainmenu_stmt stmt_list | stmt_list; /* mainmenu entry */ -mainmenu_stmt: T_MAINMENU prompt nl +mainmenu_stmt: T_MAINMENU prompt T_EOL { menu_add_prompt(P_MENU, $2, NULL); };
@@ -265,7 +265,7 @@ symbol_option_arg: choice: T_CHOICE word_opt T_EOL { struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE); - sym->flags |= SYMBOL_AUTO; + sym->flags |= SYMBOL_NO_WRITE; menu_add_entry(sym); menu_add_expr(P_CHOICE, NULL, NULL); free($2);
tools/Makefile +4 -4
@@ -161,7 +161,7 @@ endif ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),) HOSTCFLAGS_kwbimage.o += \ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") -HOSTLOADLIBES_mkimage += \ +HOSTLDLIBS_mkimage += \ $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto") # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
@@ -175,9 +175,9 @@ endif HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\" -HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage) -HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage) -HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage) +HOSTLDLIBS_dumpimage := $(HOSTLDLIBS_mkimage) +HOSTLDLIBS_fit_info := $(HOSTLDLIBS_mkimage) +HOSTLDLIBS_fit_check_sign := $(HOSTLDLIBS_mkimage) hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
Signature · 1 line
2.17.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/3 riscv: Start using ldflags-y for 32/64bit LDFLAGS
Quoted 6 lines
From: Tom Rini [mailto:trini at konsulko.com]
Sent: Friday, March 27, 2020 9:52 PM
To: u-boot at lists.denx.de
Cc: Rick Jian-Zhi Chen(???)
Subject: [PATCH 1/3] riscv: Start using ldflags-y for 32/64bit LDFLAGS
Quoted 7 lines
To prepare to update our
Kbuildlogic, start switching some of our cases of adding different bit/endian linker flags via ldflags-yCc Rick Chen <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/riscv/config.mk | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
.