History

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

Pull Kbuild fixes from Masahiro Yamada: - fix -gz=zlib compiler option test for CONFIG_DEBUG_INFO_COMPRESSED - improve cc-option in scripts/Kbuild.include to clean up temp files - improve cc-option in scripts/Kconfig.include for more reliable compile option test - do not copy modules.builtin by 'make install' because it would break existing systems - use 'userprogs' syntax for watch_queue sample * tag 'kbuild-fixes-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: samples: watch_queue: build sample program for target architecture Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n" scripts: Fix typo in headers_install.sh kconfig: unify cc-option and as-option kbuild: improve cc-option to clean up all temporary files Makefile: Improve compressed debug info support detection

Linus Torvalds committed 6 years ago

Commit be9160a2 parents 7561393 214377e8 files · +18 −34Browse files

Showing the changes to scripts (3 of 8 files). Show all

Unified · Split

3 files
  1. scripts/Kbuild.include +6 −5
  2. scripts/Kconfig.include +1 −7
  3. scripts/headers_install.sh +1 −1
scripts/Kbuild.include+6−5
@@ -86,20 +86,21 @@ cc-cross-prefix = $(firstword $(foreach c, $(1), \ · 85 unmodified lines
86 $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))86 $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))
87 87
88# output directory for tests below88# output directory for tests below
89TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)89TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
90 90
91# try-run91# try-run
92# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)92# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
93# Exit code chooses option. "$$TMP" serves as a temporary file and is93# Exit code chooses option. "$$TMP" serves as a temporary file and is
94# automatically cleaned up.94# automatically cleaned up.
95try-run = $(shell set -e; \95try-run = $(shell set -e; \
96 TMP="$(TMPOUT).$$$$.tmp"; \96 TMP=$(TMPOUT)/tmp; \
97 TMPO="$(TMPOUT).$$$$.o"; \97 TMPO=$(TMPOUT)/tmp.o; \
98 mkdir -p $(TMPOUT); \
99 trap "rm -rf $(TMPOUT)" EXIT; \
98 if ($(1)) >/dev/null 2>&1; \100 if ($(1)) >/dev/null 2>&1; \
99 then echo "$(2)"; \101 then echo "$(2)"; \
100 else echo "$(3)"; \102 else echo "$(3)"; \
101 fi; \103 fi)
102 rm -f "$$TMP" "$$TMPO")
103 104
104# as-option105# as-option
105# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)106# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
scripts/Kconfig.include+1−7
@@ -25,18 +25,12 @@ failure = $(if-success,$(1),n,y) · 24 unmodified lines
25 25
26# $(cc-option,<flag>)26# $(cc-option,<flag>)
27# Return y if the compiler supports <flag>, n otherwise27# Return y if the compiler supports <flag>, n otherwise
28cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)28cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o)
29 29
30# $(ld-option,<flag>)30# $(ld-option,<flag>)
31# Return y if the linker supports <flag>, n otherwise31# Return y if the linker supports <flag>, n otherwise
32ld-option = $(success,$(LD) -v $(1))32ld-option = $(success,$(LD) -v $(1))
33 33
34# $(as-option,<flag>)
35# /dev/zero is used as output instead of /dev/null as some assembler cribs when
36# both input and output are same. Also both of them have same write behaviour so
37# can be easily substituted.
38as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -c -x assembler /dev/null -o /dev/zero)
39
40# $(as-instr,<instr>)34# $(as-instr,<instr>)
41# Return y if the assembler supports <instr>, n otherwise35# Return y if the assembler supports <instr>, n otherwise
42as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -)36as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -)
scripts/headers_install.sh+1−1
@@ -11,7 +11,7 @@ then · 10 unmodified lines
11 echo "asm/inline/volatile keywords."11 echo "asm/inline/volatile keywords."
12 echo12 echo
13 echo "INFILE: header file to operate on"13 echo "INFILE: header file to operate on"
14 echo "OUTFILE: output file which the processed header is writen to"14 echo "OUTFILE: output file which the processed header is written to"
15 15
16 exit 116 exit 1
17fi17fi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t