kconfig: detect LD implementation

Detect GNU and LLVM ld implementations. This is required for further
patches that will introduce diverging behaviour depending on the
linker implementation in use.

Note that LLVM ld returns "compatible with GNU linkers" as part of the
version string, so be on the safe side and use '^' to only match at
the start of the line in case LLVM ever decides to change the text to
use "compatible with GNU ld" instead.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Michal Orzel <michal.orzel@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2022-05-02 08:50:39 +02:00
1 parent 3c245bc3a2
commit c70c4b624f
1 file changed
+6
+6
View File
@@ -23,6 +23,12 @@ config CLANG_VERSION
int
default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
config LD_IS_GNU
def_bool $(success,$(LD) --version | head -n 1 | grep -q "^GNU ld")
config LD_IS_LLVM
def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
# -fvisibility=hidden reduces -fpic cost, if it's available
config CC_HAS_VISIBILITY_ATTRIBUTE
def_bool $(cc-option,-fvisibility=hidden)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.