History

Kbuild, lto: add ld-version and ld-ifversion macros

To check the linker version. Used by the LTO makefile.

Andi Kleen committed 12 years ago

Commit ccbef161 parent 7d02b492 files · +17 −0Browse files

Showing the changes to scripts/Kbuild.include (1 of 2 files). Show all

Unified · Split

scripts/Kbuild.include+9−0
@@ -155,6 +155,15 @@ ld-option = $(call try-run,\ · 154 unmodified lines
155155 # Important: no spaces around options
156156 ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
157157
158+# ld-version
159+# Usage: $(call ld-version)
160+# Note this is mainly for HJ Lu's 3 number binutil versions
161+ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
162+
163+# ld-ifversion
164+# Usage: $(call ld-ifversion, -ge, 22252, y)
165+ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
166+
158167 ######
159168
160169 ###