diff options
| author | Mark Brown <broonie@kernel.org> | 2019-06-26 12:39:34 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2019-06-26 12:39:34 +0100 |
| commit | 53c8b29abe42e5601cfa0ea5962532f0cfdec8a0 (patch) | |
| tree | cad53f42ce7a03c39a984bcdbcc42cd47f1af6f9 /scripts/Kbuild.include | |
| parent | e3303268f9cfa4eb7c2217df471417d4327109fd (diff) | |
| parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) | |
Merge tag 'v5.2-rc6' into asoc-5.3
Linux 5.2-rc6
Diffstat (limited to 'scripts/Kbuild.include')
| -rw-r--r-- | scripts/Kbuild.include | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a675ce11a573..f641bb0aa63f 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 #### # kbuild: Generic definitions @@ -73,8 +74,13 @@ endef # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) # Return first <prefix> where a <prefix>gcc is found in PATH. # If no gcc found in PATH with listed prefixes return nothing +# +# Note: '2>/dev/null' is here to force Make to invoke a shell. Otherwise, it +# would try to directly execute the shell builtin 'command'. This workaround +# should be kept for a long time since this issue was fixed only after the +# GNU Make 4.2.1 release. cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ - $(if $(shell which $(c)gcc), $(c)))) + $(if $(shell command -v $(c)gcc 2>/dev/null), $(c)))) # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) @@ -138,11 +144,6 @@ cc-disable-warning = $(call try-run,\ # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) -# cc-ldoption -# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) -cc-ldoption = $(call try-run,\ - $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) - # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) |
