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 | 86 | $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c)))) |
| 87 | 87 | |
| 88 | 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 | 91 | # try-run |
| 92 | 92 | # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise) |
| 93 | 93 | # Exit code chooses option. "$$TMP" serves as a temporary file and is |
| 94 | 94 | # automatically cleaned up. |
| 95 | 95 | 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; \ | |
| 98 | 100 | if ($(1)) >/dev/null 2>&1; \ |
| 99 | 101 | then echo "$(2)"; \ |
| 100 | 102 | else echo "$(3)"; \ |
| 101 | − fi; \ | |
| 102 | − rm -f "$$TMP" "$$TMPO") | |
| 103 | + fi) | |
| 103 | 104 | |
| 104 | 105 | # as-option |
| 105 | 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 | 26 | # $(cc-option,<flag>) |
| 27 | 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 | 30 | # $(ld-option,<flag>) |
| 31 | 31 | # Return y if the linker supports <flag>, n otherwise |
| 32 | 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 | 34 | # $(as-instr,<instr>) |
| 41 | 35 | # Return y if the assembler supports <instr>, n otherwise |
| 42 | 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 | 11 | echo "asm/inline/volatile keywords." |
| 12 | 12 | echo |
| 13 | 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 | 16 | exit 1 |
| 17 | 17 | fi |