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
Showing the changes to scripts (3 of 8 files). Show all
Unified · Split
| @@ -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 below | 88 | # output directory for tests below |
| 89 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) | 89 | TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$ |
| 90 | 90 | ||
| 91 | # try-run | 91 | # 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 is | 93 | # Exit code chooses option. "$$TMP" serves as a temporary file and is |
| 94 | # automatically cleaned up. | 94 | # automatically cleaned up. |
| 95 | try-run = $(shell set -e; \ | 95 | try-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-option | 105 | # as-option |
| 105 | # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) | 106 | # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) |
| @@ -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 otherwise | 27 | # 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) |
| 29 | 29 | ||
| 30 | # $(ld-option,<flag>) | 30 | # $(ld-option,<flag>) |
| 31 | # Return y if the linker supports <flag>, n otherwise | 31 | # Return y if the linker supports <flag>, n otherwise |
| 32 | ld-option = $(success,$(LD) -v $(1)) | 32 | ld-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. | ||
| 38 | as-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 otherwise | 35 | # Return y if the assembler supports <instr>, n otherwise |
| 42 | as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -) | 36 | as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -) |
| @@ -11,7 +11,7 @@ then · 10 unmodified lines | |||
| 11 | echo "asm/inline/volatile keywords." | 11 | echo "asm/inline/volatile keywords." |
| 12 | echo | 12 | 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 1 | 16 | exit 1 |
| 17 | fi | 17 | fi |