From: Sami Tolvanen Date: Fri, 17 Nov 2017 23:55:54 +0000 (-0800) Subject: FROMLIST: kbuild: add __ld-ifversion and linker-specific macros X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8029e5db9939c8187784cb42a36932d52539b9b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git FROMLIST: kbuild: add __ld-ifversion and linker-specific macros Add macros for testing both linker name and version. Bug: 62093296 Bug: 67506682 Change-Id: Icbb13e9bb889017cd4a7457a62dea7e0335c53b5 (am from https://patchwork.kernel.org/patch/10085789/) Signed-off-by: Sami Tolvanen --- diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index ae167b7b187b..76f57f595785 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -216,6 +216,18 @@ ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) # Usage: $(call ld-ifversion, -ge, 22252, y) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) +# __ld-ifversion +# Usage: $(call __ld-ifversion, gold, -ge, 112000000, y) +__ld-ifversion = $(shell [ $(ld-name) = $(1) ] && [ $(ld-version) $(2) $(3) ] && echo $(4) || echo $(5)) + +# bfd-ifversion +# Usage: $(call bfd-ifversion, -ge, 227000000, y) +bfd-ifversion = $(call __ld-ifversion, bfd, $(1), $(2), $(3), $(4)) + +# gold-ifversion +# Usage: $(call gold-ifversion, -ge, 112000000, y) +gold-ifversion = $(call __ld-ifversion, gold, $(1), $(2), $(3), $(4)) + ###### ###