Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

- Add new environment variables, USERCFLAGS and USERLDFLAGS to allow
additional flags to be passed to user-space programs.

- Fix missing fflush() bugs in Kconfig and fixdep

- Fix a minor bug in the comment format of the .config file

- Make kallsyms ignore llvm's local labels, .L*

- Fix UAPI compile-test for cross-compiling with Clang

- Extend the LLVM= syntax to support LLVM=<suffix> form for using a
particular version of LLVm, and LLVM=<prefix> form for using custom
LLVM in a particular directory path.

- Clean up Makefiles

* tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: Make $(LLVM) more flexible
kbuild: add --target to correctly cross-compile UAPI headers with Clang
fixdep: use fflush() and ferror() to ensure successful write to files
arch: syscalls: simplify uapi/kapi directory creation
usr/include: replace extra-y with always-y
certs: simplify empty certs creation in certs/Makefile
certs: include certs/signing_key.x509 unconditionally
kallsyms: ignore all local labels prefixed by '.L'
kconfig: fix missing '# end of' for empty menu
kconfig: add fflush() before ferror() check
kbuild: replace $(if A,A,B) with $(or A,B)
kbuild: Add environment variables for userprogs flags
kbuild: unify cmd_copy and cmd_shipped

+189 -175
+11
Documentation/kbuild/kbuild.rst
··· 77 77 ---------- 78 78 Additional libraries to link against when building host programs. 79 79 80 + .. _userkbuildflags: 81 + 82 + USERCFLAGS 83 + ---------- 84 + Additional options used for $(CC) when compiling userprogs. 85 + 86 + USERLDFLAGS 87 + ----------- 88 + Additional options used for $(LD) when linking userprogs. userprogs are linked 89 + with CC, so $(USERLDFLAGS) should include "-Wl," prefix as applicable. 90 + 80 91 KBUILD_KCONFIG 81 92 -------------- 82 93 Set the top-level Kconfig file to the value of this environment
+25 -6
Documentation/kbuild/llvm.rst
··· 49 49 LLVM Utilities 50 50 -------------- 51 51 52 - LLVM has substitutes for GNU binutils utilities. Kbuild supports ``LLVM=1`` 53 - to enable them. :: 54 - 55 - make LLVM=1 56 - 57 - They can be enabled individually. The full list of the parameters: :: 52 + LLVM has substitutes for GNU binutils utilities. They can be enabled individually. 53 + The full list of supported make variables:: 58 54 59 55 make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \ 60 56 OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \ 61 57 HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld 58 + 59 + To simplify the above command, Kbuild supports the ``LLVM`` variable:: 60 + 61 + make LLVM=1 62 + 63 + If your LLVM tools are not available in your PATH, you can supply their 64 + location using the LLVM variable with a trailing slash:: 65 + 66 + make LLVM=/path/to/llvm/ 67 + 68 + which will use ``/path/to/llvm/clang``, ``/path/to/llvm/ld.lld``, etc. 69 + 70 + If your LLVM tools have a version suffix and you want to test with that 71 + explicit version rather than the unsuffixed executables like ``LLVM=1``, you 72 + can pass the suffix using the ``LLVM`` variable:: 73 + 74 + make LLVM=-14 75 + 76 + which will use ``clang-14``, ``ld.lld-14``, etc. 77 + 78 + ``LLVM=0`` is not the same as omitting ``LLVM`` altogether, it will behave like 79 + ``LLVM=1``. If you only wish to use certain LLVM utilities, use their respective 80 + make variables. 62 81 63 82 The integrated assembler is enabled by default. You can pass ``LLVM_IAS=0`` to 64 83 disable it.
+2
Documentation/kbuild/makefiles.rst
··· 982 982 983 983 When linking bpfilter_umh, it will be passed the extra option -static. 984 984 985 + From command line, :ref:`USERCFLAGS and USERLDFLAGS <userkbuildflags>` will also be used. 986 + 985 987 5.4 When userspace programs are actually built 986 988 ---------------------------------------------- 987 989
+27 -19
Makefile
··· 424 424 HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) 425 425 426 426 ifneq ($(LLVM),) 427 - HOSTCC = clang 428 - HOSTCXX = clang++ 427 + ifneq ($(filter %/,$(LLVM)),) 428 + LLVM_PREFIX := $(LLVM) 429 + else ifneq ($(filter -%,$(LLVM)),) 430 + LLVM_SUFFIX := $(LLVM) 431 + endif 432 + 433 + HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX) 434 + HOSTCXX = $(LLVM_PREFIX)clang++$(LLVM_SUFFIX) 429 435 else 430 436 HOSTCC = gcc 431 437 HOSTCXX = g++ 432 438 endif 433 439 434 - export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ 435 - -O2 -fomit-frame-pointer -std=gnu11 \ 436 - -Wdeclaration-after-statement 437 - export KBUILD_USERLDFLAGS := 440 + KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ 441 + -O2 -fomit-frame-pointer -std=gnu11 \ 442 + -Wdeclaration-after-statement 443 + KBUILD_USERCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(USERCFLAGS) 444 + KBUILD_USERLDFLAGS := $(USERLDFLAGS) 438 445 439 - KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) 446 + KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) 440 447 KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) 441 448 KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) 442 449 KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) ··· 451 444 # Make variables (CC, etc...) 452 445 CPP = $(CC) -E 453 446 ifneq ($(LLVM),) 454 - CC = clang 455 - LD = ld.lld 456 - AR = llvm-ar 457 - NM = llvm-nm 458 - OBJCOPY = llvm-objcopy 459 - OBJDUMP = llvm-objdump 460 - READELF = llvm-readelf 461 - STRIP = llvm-strip 447 + CC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX) 448 + LD = $(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX) 449 + AR = $(LLVM_PREFIX)llvm-ar$(LLVM_SUFFIX) 450 + NM = $(LLVM_PREFIX)llvm-nm$(LLVM_SUFFIX) 451 + OBJCOPY = $(LLVM_PREFIX)llvm-objcopy$(LLVM_SUFFIX) 452 + OBJDUMP = $(LLVM_PREFIX)llvm-objdump$(LLVM_SUFFIX) 453 + READELF = $(LLVM_PREFIX)llvm-readelf$(LLVM_SUFFIX) 454 + STRIP = $(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX) 462 455 else 463 456 CC = $(CROSS_COMPILE)gcc 464 457 LD = $(CROSS_COMPILE)ld ··· 538 531 export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 539 532 export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD 540 533 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE 534 + export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS 541 535 542 536 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS 543 537 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE ··· 1245 1237 echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL) 1246 1238 endef 1247 1239 1248 - $(version_h): PATCHLEVEL := $(if $(PATCHLEVEL), $(PATCHLEVEL), 0) 1249 - $(version_h): SUBLEVEL := $(if $(SUBLEVEL), $(SUBLEVEL), 0) 1240 + $(version_h): PATCHLEVEL := $(or $(PATCHLEVEL), 0) 1241 + $(version_h): SUBLEVEL := $(or $(SUBLEVEL), 0) 1250 1242 $(version_h): FORCE 1251 1243 $(call filechk,version.h) 1252 1244 ··· 1629 1621 @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp 1630 1622 @echo '' 1631 1623 @echo 'Architecture specific targets ($(SRCARCH)):' 1632 - @$(if $(archhelp),$(archhelp),\ 1624 + @$(or $(archhelp),\ 1633 1625 echo ' No architecture specific help defined for $(SRCARCH)') 1634 1626 @echo '' 1635 1627 @$(if $(boards), \ ··· 1846 1838 1847 1839 clean: $(clean-dirs) 1848 1840 $(call cmd,rmfiles) 1849 - @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1841 + @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1850 1842 \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ 1851 1843 -o -name '*.ko.*' \ 1852 1844 -o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
+1 -2
arch/alpha/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/arm/tools/Makefile
··· 29 29 uapi: $(uapi-hdrs-y) 30 30 31 31 # Create output directory if not already present 32 - _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \ 33 - $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') 32 + $(shell mkdir -p $(kapi) $(uapi)) 34 33 35 34 quiet_cmd_gen_mach = GEN $@ 36 35 cmd_gen_mach = $(AWK) -f $(real-prereqs) > $@
+1 -2
arch/ia64/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/m68k/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -1
arch/microblaze/boot/Makefile
··· 29 29 $(call if_changed,uimage) 30 30 31 31 $(obj)/simpleImage.$(DTB).unstrip: vmlinux FORCE 32 - $(call if_changed,shipped) 32 + $(call if_changed,copy) 33 33 34 34 $(obj)/simpleImage.$(DTB).strip: vmlinux FORCE 35 35 $(call if_changed,strip)
+1 -1
arch/microblaze/boot/dts/Makefile
··· 12 12 # Generate system.dtb from $(DTB).dtb 13 13 ifneq ($(DTB),system) 14 14 $(obj)/system.dtb: $(obj)/$(DTB).dtb 15 - $(call if_changed,shipped) 15 + $(call if_changed,copy) 16 16 endif 17 17 endif 18 18
+1 -2
arch/microblaze/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/mips/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syshdr := $(srctree)/scripts/syscallhdr.sh 9 8 sysnr := $(srctree)/$(src)/syscallnr.sh
+1 -2
arch/parisc/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/powerpc/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/s390/kernel/syscalls/Makefile
··· 21 21 22 22 23 23 # Create output directory if not already present 24 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 25 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 24 + $(shell mkdir -p $(uapi) $(kapi)) 26 25 27 26 filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< 28 27
+1 -2
arch/sh/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/sparc/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+1 -2
arch/x86/entry/syscalls/Makefile
··· 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 5 # Create output directory if not already present 6 - _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \ 7 - $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') 6 + $(shell mkdir -p $(out) $(uapi)) 8 7 9 8 syscall32 := $(src)/syscall_32.tbl 10 9 syscall64 := $(src)/syscall_64.tbl
+1 -2
arch/xtensa/kernel/syscalls/Makefile
··· 2 2 kapi := arch/$(SRCARCH)/include/generated/asm 3 3 uapi := arch/$(SRCARCH)/include/generated/uapi/asm 4 4 5 - _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 6 - $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 5 + $(shell mkdir -p $(uapi) $(kapi)) 7 6 8 7 syscall := $(src)/syscall.tbl 9 8 syshdr := $(srctree)/scripts/syscallhdr.sh
+11 -26
certs/Makefile
··· 13 13 endif 14 14 15 15 quiet_cmd_extract_certs = CERT $@ 16 - cmd_extract_certs = $(obj)/extract-cert $(2) $@ 16 + cmd_extract_certs = $(obj)/extract-cert $(extract-cert-in) $@ 17 + extract-cert-in = $(or $(filter-out $(obj)/extract-cert, $(real-prereqs)),"") 17 18 18 19 $(obj)/system_certificates.o: $(obj)/x509_certificate_list 19 20 20 21 $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE 21 - $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_TRUSTED_KEYS),$<,"")) 22 + $(call if_changed,extract_certs) 22 23 23 24 targets += x509_certificate_list 24 25 25 - ifeq ($(CONFIG_MODULE_SIG),y) 26 - SIGN_KEY = y 27 - endif 28 - 29 - ifeq ($(CONFIG_IMA_APPRAISE_MODSIG),y) 30 - ifeq ($(CONFIG_MODULES),y) 31 - SIGN_KEY = y 32 - endif 33 - endif 34 - 35 - ifdef SIGN_KEY 36 - ############################################################################### 37 - # 38 26 # If module signing is requested, say by allyesconfig, but a key has not been 39 27 # supplied, then one will need to be generated to make sure the build does not 40 28 # fail and that the kernel may be used afterwards. 41 29 # 42 - ############################################################################### 43 - 44 30 # We do it this way rather than having a boolean option for enabling an 45 31 # external private key, because 'make randconfig' might enable such a 46 32 # boolean option and we unfortunately can't make it depend on !RANDCONFIG. ··· 53 67 54 68 endif # CONFIG_MODULE_SIG_KEY 55 69 56 - # If CONFIG_MODULE_SIG_KEY isn't a PKCS#11 URI, depend on it 57 - ifneq ($(filter-out pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) 58 - X509_DEP := $(CONFIG_MODULE_SIG_KEY) 59 - endif 60 - 61 70 $(obj)/system_certificates.o: $(obj)/signing_key.x509 62 71 63 - $(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE 64 - $(call if_changed,extract_certs,$(if $(CONFIG_MODULE_SIG_KEY),$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)),"")) 65 - endif # CONFIG_MODULE_SIG 72 + PKCS11_URI := $(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)) 73 + ifdef PKCS11_URI 74 + $(obj)/signing_key.x509: extract-cert-in := $(PKCS11_URI) 75 + endif 76 + 77 + $(obj)/signing_key.x509: $(filter-out $(PKCS11_URI),$(CONFIG_MODULE_SIG_KEY)) $(obj)/extract-cert FORCE 78 + $(call if_changed,extract_certs) 66 79 67 80 targets += signing_key.x509 68 81 69 82 $(obj)/revocation_certificates.o: $(obj)/x509_revocation_list 70 83 71 84 $(obj)/x509_revocation_list: $(CONFIG_SYSTEM_REVOCATION_KEYS) $(obj)/extract-cert FORCE 72 - $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_REVOCATION_KEYS),$<,"")) 85 + $(call if_changed,extract_certs) 73 86 74 87 targets += x509_revocation_list 75 88
-3
certs/system_certificates.S
··· 9 9 system_certificate_list: 10 10 __cert_list_start: 11 11 __module_cert_start: 12 - #if defined(CONFIG_MODULE_SIG) || (defined(CONFIG_IMA_APPRAISE_MODSIG) \ 13 - && defined(CONFIG_MODULES)) 14 12 .incbin "certs/signing_key.x509" 15 - #endif 16 13 __module_cert_end: 17 14 .incbin "certs/x509_certificate_list" 18 15 __cert_list_end:
+1 -1
fs/unicode/Makefile
··· 33 33 else 34 34 35 35 $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE 36 - $(call if_changed,shipped) 36 + $(call if_changed,copy) 37 37 38 38 endif 39 39
+4 -4
init/Kconfig
··· 62 62 63 63 config CC_CAN_LINK 64 64 bool 65 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT 66 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m32-flag)) 65 + default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT 66 + default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag)) 67 67 68 68 config CC_CAN_LINK_STATIC 69 69 bool 70 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag) -static) if 64BIT 71 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m32-flag) -static) 70 + default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag) -static) if 64BIT 71 + default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag) -static) 72 72 73 73 config CC_HAS_ASM_GOTO 74 74 def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
+1 -2
scripts/Makefile.build
··· 40 40 41 41 # The filename Kbuild has precedence over Makefile 42 42 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 43 - kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) 44 - include $(kbuild-file) 43 + include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 45 44 46 45 include $(srctree)/scripts/Makefile.lib 47 46
+1 -1
scripts/Makefile.clean
··· 12 12 13 13 # The filename Kbuild has precedence over Makefile 14 14 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 15 - include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 15 + include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 16 16 17 17 # Figure out what we need to build from the various variables 18 18 # ==========================================================================
+6 -10
scripts/Makefile.lib
··· 106 106 modname-multi = $(sort $(foreach m,$(multi-obj-ym),\ 107 107 $(if $(filter $*.o, $(call suffix-search, $m, .o, -objs -y -m)),$(m:.o=)))) 108 108 109 - __modname = $(if $(modname-multi),$(modname-multi),$(basetarget)) 109 + __modname = $(or $(modname-multi),$(basetarget)) 110 110 111 111 modname = $(subst $(space),:,$(__modname)) 112 112 modfile = $(addprefix $(obj)/,$(__modname)) ··· 241 241 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) 242 242 endef 243 243 244 - quiet_cmd_copy = COPY $@ 245 - cmd_copy = cp $< $@ 246 - 247 - # Shipped files 244 + # Copy a file 248 245 # =========================================================================== 249 246 # 'cp' preserves permissions. If you use it to copy a file in read-only srctree, 250 247 # the copy would be read-only as well, leading to an error when executing the 251 248 # rule next time. Use 'cat' instead in order to generate a writable file. 252 - 253 - quiet_cmd_shipped = SHIPPED $@ 254 - cmd_shipped = cat $< > $@ 249 + quiet_cmd_copy = COPY $@ 250 + cmd_copy = cat $< > $@ 255 251 256 252 $(obj)/%: $(src)/%_shipped 257 - $(call cmd,shipped) 253 + $(call cmd,copy) 258 254 259 255 # Commands useful for building a boot image 260 256 # =========================================================================== ··· 427 431 # SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces 428 432 # the number of overrides in arch makefiles 429 433 UIMAGE_ARCH ?= $(SRCARCH) 430 - UIMAGE_COMPRESSION ?= $(if $(2),$(2),none) 434 + UIMAGE_COMPRESSION ?= $(or $(2),none) 431 435 UIMAGE_OPTS-y ?= 432 436 UIMAGE_TYPE ?= kernel 433 437 UIMAGE_LOADADDR ?= arch_must_set_this
+19 -27
scripts/basic/fixdep.c
··· 105 105 exit(1); 106 106 } 107 107 108 - /* 109 - * In the intended usage of this program, the stdout is redirected to .*.cmd 110 - * files. The return value of printf() must be checked to catch any error, 111 - * e.g. "No space left on device". 112 - */ 113 - static void xprintf(const char *format, ...) 114 - { 115 - va_list ap; 116 - int ret; 117 - 118 - va_start(ap, format); 119 - ret = vprintf(format, ap); 120 - if (ret < 0) { 121 - perror("fixdep"); 122 - exit(1); 123 - } 124 - va_end(ap); 125 - } 126 - 127 108 struct item { 128 109 struct item *next; 129 110 unsigned int len; ··· 170 189 171 190 define_config(m, slen, hash); 172 191 /* Print out a dependency path from a symbol name. */ 173 - xprintf(" $(wildcard include/config/%.*s) \\\n", slen, m); 192 + printf(" $(wildcard include/config/%.*s) \\\n", slen, m); 174 193 } 175 194 176 195 /* test if s ends in sub */ ··· 299 318 */ 300 319 if (!saw_any_target) { 301 320 saw_any_target = 1; 302 - xprintf("source_%s := %s\n\n", 303 - target, m); 304 - xprintf("deps_%s := \\\n", target); 321 + printf("source_%s := %s\n\n", 322 + target, m); 323 + printf("deps_%s := \\\n", target); 305 324 } 306 325 is_first_dep = 0; 307 326 } else { 308 - xprintf(" %s \\\n", m); 327 + printf(" %s \\\n", m); 309 328 } 310 329 311 330 buf = read_file(m); ··· 328 347 exit(1); 329 348 } 330 349 331 - xprintf("\n%s: $(deps_%s)\n\n", target, target); 332 - xprintf("$(deps_%s):\n", target); 350 + printf("\n%s: $(deps_%s)\n\n", target, target); 351 + printf("$(deps_%s):\n", target); 333 352 } 334 353 335 354 int main(int argc, char *argv[]) ··· 344 363 target = argv[2]; 345 364 cmdline = argv[3]; 346 365 347 - xprintf("cmd_%s := %s\n\n", target, cmdline); 366 + printf("cmd_%s := %s\n\n", target, cmdline); 348 367 349 368 buf = read_file(depfile); 350 369 parse_dep_file(buf, target); 351 370 free(buf); 371 + 372 + fflush(stdout); 373 + 374 + /* 375 + * In the intended usage, the stdout is redirected to .*.cmd files. 376 + * Call ferror() to catch errors such as "No space left on device". 377 + */ 378 + if (ferror(stdout)) { 379 + fprintf(stderr, "fixdep: not all data was written to the output\n"); 380 + exit(1); 381 + } 352 382 353 383 return 0; 354 384 }
+1 -1
scripts/kallsyms.c
··· 108 108 /* Symbol names that begin with the following are ignored.*/ 109 109 static const char * const ignored_prefixes[] = { 110 110 "$", /* local symbols for ARM, MIPS, etc. */ 111 - ".LASANPC", /* s390 kasan local symbols */ 111 + ".L", /* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ 112 112 "__crc_", /* modversions */ 113 113 "__efistub_", /* arm64 EFI stub namespace */ 114 114 "__kvm_nvhe_", /* arm64 non-VHE KVM namespace */
+15 -12
scripts/kconfig/confdata.c
··· 903 903 menu = menu->list; 904 904 continue; 905 905 } 906 - if (menu->next) 906 + 907 + end_check: 908 + if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu && 909 + menu->prompt->type == P_MENU) { 910 + fprintf(out, "# end of %s\n", menu_get_prompt(menu)); 911 + need_newline = true; 912 + } 913 + 914 + if (menu->next) { 907 915 menu = menu->next; 908 - else while ((menu = menu->parent)) { 909 - if (!menu->sym && menu_is_visible(menu) && 910 - menu != &rootmenu) { 911 - str = menu_get_prompt(menu); 912 - fprintf(out, "# end of %s\n", str); 913 - need_newline = true; 914 - } 915 - if (menu->next) { 916 - menu = menu->next; 917 - break; 918 - } 916 + } else { 917 + menu = menu->parent; 918 + if (menu) 919 + goto end_check; 919 920 } 920 921 } 921 922 fclose(out); ··· 980 979 981 980 fprintf(out, "\n$(deps_config): ;\n"); 982 981 982 + fflush(out); 983 983 ret = ferror(out); /* error check for all fprintf() calls */ 984 984 fclose(out); 985 985 if (ret) ··· 1099 1097 if ((sym->flags & SYMBOL_WRITE) && sym->name) 1100 1098 print_symbol(file, sym); 1101 1099 1100 + fflush(file); 1102 1101 /* check possible errors in conf_write_heading() and print_symbol() */ 1103 1102 ret = ferror(file); 1104 1103 fclose(file);
+2 -2
tools/bpf/bpftool/Makefile
··· 74 74 CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers 75 75 CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS)) 76 76 CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ 77 - -I$(if $(OUTPUT),$(OUTPUT),.) \ 77 + -I$(or $(OUTPUT),.) \ 78 78 -I$(LIBBPF_INCLUDE) \ 79 79 -I$(srctree)/kernel/bpf/ \ 80 80 -I$(srctree)/tools/include \ ··· 180 180 181 181 $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP) 182 182 $(QUIET_CLANG)$(CLANG) \ 183 - -I$(if $(OUTPUT),$(OUTPUT),.) \ 183 + -I$(or $(OUTPUT),.) \ 184 184 -I$(srctree)/tools/include/uapi/ \ 185 185 -I$(LIBBPF_BOOTSTRAP_INCLUDE) \ 186 186 -g -O2 -Wall -target bpf -c $< -o $@
+1 -1
tools/build/Makefile
··· 36 36 37 37 clean: 38 38 $(call QUIET_CLEAN, fixdep) 39 - $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 39 + $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 40 40 $(Q)rm -f $(OUTPUT)fixdep 41 41 $(call QUIET_CLEAN, feature-detect) 42 42 ifneq ($(wildcard $(TMP_O)),)
+1 -1
tools/counter/Makefile
··· 40 40 clean: 41 41 rm -f $(ALL_PROGRAMS) 42 42 rm -rf $(OUTPUT)include/linux/counter.h 43 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 43 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 44 44 45 45 install: $(ALL_PROGRAMS) 46 46 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/gpio/Makefile
··· 78 78 clean: 79 79 rm -f $(ALL_PROGRAMS) 80 80 rm -f $(OUTPUT)include/linux/gpio.h 81 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 81 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 82 82 83 83 install: $(ALL_PROGRAMS) 84 84 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/hv/Makefile
··· 47 47 48 48 clean: 49 49 rm -f $(ALL_PROGRAMS) 50 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 50 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 51 51 52 52 install: $(ALL_PROGRAMS) 53 53 install -d -m 755 $(DESTDIR)$(sbindir); \
+1 -1
tools/iio/Makefile
··· 58 58 clean: 59 59 rm -f $(ALL_PROGRAMS) 60 60 rm -rf $(OUTPUT)include/linux/iio 61 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 61 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 62 62 63 63 install: $(ALL_PROGRAMS) 64 64 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/lib/api/Makefile
··· 60 60 61 61 clean: 62 62 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ 63 - find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 63 + find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 64 64 65 65 FORCE: 66 66
+1 -1
tools/lib/bpf/Makefile
··· 60 60 VERBOSE = 0 61 61 endif 62 62 63 - INCLUDES = -I$(if $(OUTPUT),$(OUTPUT),.) \ 63 + INCLUDES = -I$(or $(OUTPUT),.) \ 64 64 -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi 65 65 66 66 export prefix libdir src obj
+1 -1
tools/lib/perf/Makefile
··· 153 153 $(QUIET_LINK)$(CC) -o $@ $^ 154 154 155 155 $(TESTS_SHARED): $(TESTS_IN) $(LIBAPI) 156 - $(QUIET_LINK)$(CC) -o $@ -L$(if $(OUTPUT),$(OUTPUT),.) $^ -lperf 156 + $(QUIET_LINK)$(CC) -o $@ -L$(or $(OUTPUT),.) $^ -lperf 157 157 158 158 make-tests: libs $(TESTS_SHARED) $(TESTS_STATIC) 159 159
+1 -1
tools/lib/subcmd/Makefile
··· 63 63 64 64 clean: 65 65 $(call QUIET_CLEAN, libsubcmd) $(RM) $(LIBFILE); \ 66 - find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 66 + find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 67 67 68 68 FORCE: 69 69
+1 -1
tools/objtool/Makefile
··· 13 13 endif 14 14 15 15 SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ 16 - LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/) 16 + LIBSUBCMD_OUTPUT = $(or $(OUTPUT),$(CURDIR)/) 17 17 LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a 18 18 19 19 OBJTOOL := $(OUTPUT)objtool
+1 -1
tools/pci/Makefile
··· 42 42 clean: 43 43 rm -f $(ALL_PROGRAMS) 44 44 rm -rf $(OUTPUT)include/ 45 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 45 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 46 46 47 47 install: $(ALL_PROGRAMS) 48 48 install -d -m 755 $(DESTDIR)$(bindir); \
+2 -2
tools/perf/Makefile.perf
··· 724 724 # get relative building directory (to $(OUTPUT)) 725 725 # and '.' if it's $(OUTPUT) itself 726 726 __build-dir = $(subst $(OUTPUT),,$(dir $@)) 727 - build-dir = $(if $(__build-dir),$(__build-dir),.) 727 + build-dir = $(or $(__build-dir),.) 728 728 729 729 prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioctl_array) \ 730 730 $(fadvise_advice_array) \ ··· 1090 1090 1091 1091 clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean 1092 1092 $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf-iostat $(LANG_BINDINGS) 1093 - $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 1093 + $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 1094 1094 $(Q)$(RM) $(OUTPUT).config-detected 1095 1095 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so 1096 1096 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
+1 -1
tools/power/x86/intel-speed-select/Makefile
··· 47 47 clean: 48 48 rm -f $(ALL_PROGRAMS) 49 49 rm -rf $(OUTPUT)include/linux/isst_if.h 50 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 50 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 51 51 52 52 install: $(ALL_PROGRAMS) 53 53 install -d -m 755 $(DESTDIR)$(bindir); \
+14 -8
tools/scripts/Makefile.include
··· 52 52 endef 53 53 54 54 ifneq ($(LLVM),) 55 - $(call allow-override,CC,clang) 56 - $(call allow-override,AR,llvm-ar) 57 - $(call allow-override,LD,ld.lld) 58 - $(call allow-override,CXX,clang++) 59 - $(call allow-override,STRIP,llvm-strip) 55 + ifneq ($(filter %/,$(LLVM)),) 56 + LLVM_PREFIX := $(LLVM) 57 + else ifneq ($(filter -%,$(LLVM)),) 58 + LLVM_SUFFIX := $(LLVM) 59 + endif 60 + 61 + $(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX)) 62 + $(call allow-override,AR,$(LLVM_PREFIX)llvm-ar$(LLVM_SUFFIX)) 63 + $(call allow-override,LD,$(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX)) 64 + $(call allow-override,CXX,$(LLVM_PREFIX)clang++$(LLVM_SUFFIX)) 65 + $(call allow-override,STRIP,$(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX)) 60 66 else 61 67 # Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix. 62 68 $(call allow-override,CC,$(CROSS_COMPILE)gcc) ··· 75 69 CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?) 76 70 77 71 ifneq ($(LLVM),) 78 - HOSTAR ?= llvm-ar 79 - HOSTCC ?= clang 80 - HOSTLD ?= ld.lld 72 + HOSTAR ?= $(LLVM_PREFIX)llvm-ar$(LLVM_SUFFIX) 73 + HOSTCC ?= $(LLVM_PREFIX)clang$(LLVM_SUFFIX) 74 + HOSTLD ?= $(LLVM_PREFIX)ld.lld$(LLVM_SUFFIX) 81 75 else 82 76 HOSTAR ?= ar 83 77 HOSTCC ?= gcc
+1 -1
tools/scripts/utilities.mak
··· 175 175 define get-executable-or-default 176 176 $(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2))) 177 177 endef 178 - _ge_attempt = $(if $(get-executable),$(get-executable),$(call _gea_err,$(2))) 178 + _ge_attempt = $(or $(get-executable),$(call _gea_err,$(2))) 179 179 _gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
+3 -3
tools/spi/Makefile
··· 53 53 clean: 54 54 rm -f $(ALL_PROGRAMS) 55 55 rm -rf $(OUTPUT)include/ 56 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete 57 - find $(if $(OUTPUT),$(OUTPUT),.) -name '\.*.o.d' -delete 58 - find $(if $(OUTPUT),$(OUTPUT),.) -name '\.*.o.cmd' -delete 56 + find $(or $(OUTPUT),.) -name '*.o' -delete 57 + find $(or $(OUTPUT),.) -name '\.*.o.d' -delete 58 + find $(or $(OUTPUT),.) -name '\.*.o.cmd' -delete 59 59 60 60 install: $(ALL_PROGRAMS) 61 61 install -d -m 755 $(DESTDIR)$(bindir); \
+7 -1
tools/testing/selftests/lib.mk
··· 1 1 # This mimics the top-level Makefile. We do it explicitly here so that this 2 2 # Makefile can operate with or without the kbuild infrastructure. 3 3 ifneq ($(LLVM),) 4 - CC := clang 4 + ifneq ($(filter %/,$(LLVM)),) 5 + LLVM_PREFIX := $(LLVM) 6 + else ifneq ($(filter -%,$(LLVM)),) 7 + LLVM_SUFFIX := $(LLVM) 8 + endif 9 + 10 + CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) 5 11 else 6 12 CC := $(CROSS_COMPILE)gcc 7 13 endif
+1 -1
tools/tracing/rtla/Makefile
··· 46 46 DOCDIR := $(DATADIR)/doc 47 47 MANDIR := $(DATADIR)/man 48 48 LICDIR := $(DATADIR)/licenses 49 - SRCTREE := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)) 49 + SRCTREE := $(or $(BUILD_SRC),$(CURDIR)) 50 50 51 51 # If running from the tarball, man pages are stored in the Documentation 52 52 # dir. If running from the kernel source, man pages are stored in
+1 -1
tools/usb/Makefile
··· 38 38 39 39 clean: 40 40 rm -f $(ALL_PROGRAMS) 41 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete -o -name '\.*.o.cmd' -delete 41 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete -o -name '\.*.o.cmd' -delete 42 42 43 43 install: $(ALL_PROGRAMS) 44 44 install -d -m 755 $(DESTDIR)$(bindir); \
+2 -2
usr/Makefile
··· 3 3 # kbuild file for usr/ - including initramfs image 4 4 # 5 5 6 - compress-y := shipped 6 + compress-y := copy 7 7 compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip 8 8 compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2 9 9 compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA) := lzma ··· 37 37 # .cpio.*, use it directly as an initramfs, and avoid double compression. 38 38 ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2) 39 39 cpio-data := $(ramfs-input) 40 - compress-y := shipped 40 + compress-y := copy 41 41 endif 42 42 43 43 endif
+5 -2
usr/include/Makefile
··· 10 10 11 11 # In theory, we do not care -m32 or -m64 for header compile tests. 12 12 # It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64. 13 - UAPI_CFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS)) 13 + UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS)) 14 + 15 + # USERCFLAGS might contain sysroot location for CC. 16 + UAPI_CFLAGS += $(USERCFLAGS) 14 17 15 18 override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include 16 19 ··· 87 84 # asm-generic/*.h is used by asm/*.h, and should not be included directly 88 85 no-header-test += asm-generic/% 89 86 90 - extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null)) 87 + always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null)) 91 88 92 89 # Include the header twice to detect missing include guard. 93 90 quiet_cmd_hdrtest = HDRTEST $<