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
8686 $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))
8787
8888 # output directory for tests below
89−TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
89+TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
9090
9191 # try-run
9292 # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
9393 # Exit code chooses option. "$$TMP" serves as a temporary file and is
9494 # automatically cleaned up.
9595 try-run = $(shell set -e; \
96− TMP="$(TMPOUT).$$$$.tmp"; \
97− TMPO="$(TMPOUT).$$$$.o"; \
96+ TMP=$(TMPOUT)/tmp; \
97+ TMPO=$(TMPOUT)/tmp.o; \
98+ mkdir -p $(TMPOUT); \
99+ trap "rm -rf $(TMPOUT)" EXIT; \
98100 if ($(1)) >/dev/null 2>&1; \
99101 then echo "$(2)"; \
100102 else echo "$(3)"; \
101− fi; \
102− rm -f "$$TMP" "$$TMPO")
103+ fi)
103104
104105 # as-option
105106 # 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
2525
2626 # $(cc-option,<flag>)
2727 # Return y if the compiler supports <flag>, n otherwise
28−cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)
28+cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o)
2929
3030 # $(ld-option,<flag>)
3131 # Return y if the linker supports <flag>, n otherwise
3232 ld-option = $(success,$(LD) -v $(1))
3333
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.
38−as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -c -x assembler /dev/null -o /dev/zero)
39−
4034 # $(as-instr,<instr>)
4135 # Return y if the assembler supports <instr>, n otherwise
4236 as-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
1111 echo "asm/inline/volatile keywords."
1212 echo
1313 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"
1515
1616 exit 1
1717 fi

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