]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: drop support for cc-ldoption
authorNick Desaulniers <ndesaulniers@google.com>
Tue, 23 Apr 2019 21:27:41 +0000 (14:27 -0700)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 20 May 2019 15:02:59 +0000 (00:02 +0900)
If you want to see if your linker supports a certain flag, then ask the
linker directly with ld-option (not the compiler with cc-ldoption).
Checking for linker flag support is an antipattern that complicates the
usage of various linkers other than bfd via -fuse-ld={bfd|gold|lld}.

Cc: clang-built-linux@googlegroups.com
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Documentation/kbuild/makefiles.txt
scripts/Kbuild.include

index 03c065855eafb39e00179626bfd2a5106a945079..d65ad5746f9482c494bf6bef390308695f7eb35c 100644 (file)
@@ -437,20 +437,6 @@ more details, with real examples.
        The second argument is optional, and if supplied will be used
        if first argument is not supported.
 
-    cc-ldoption
-       cc-ldoption is used to check if $(CC) when used to link object files
-       supports the given option.  An optional second option may be
-       specified if first option are not supported.
-
-       Example:
-               #arch/x86/kernel/Makefile
-               vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
-
-       In the above example, vsyscall-flags will be assigned the option
-       -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
-       The second argument is optional, and if supplied will be used
-       if first argument is not supported.
-
     as-instr
        as-instr checks if the assembler reports a specific instruction
        and then outputs either option1 or option2
index a675ce11a573094b0a959b38dfaea96e6c806e05..e2de6c4dce9074934a7f20acb0f616fa0deb1012 100644 (file)
@@ -138,11 +138,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))