Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108225724
D11308.id29964.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11308.id29964.diff
View Options
Index: share/mk/Makefile
===================================================================
--- share/mk/Makefile
+++ share/mk/Makefile
@@ -33,6 +33,7 @@
bsd.kmod.mk \
bsd.lib.mk \
bsd.libnames.mk \
+ bsd.linker.mk \
bsd.links.mk \
bsd.man.mk \
bsd.mkopt.mk \
Index: share/mk/bsd.compiler.mk
===================================================================
--- share/mk/bsd.compiler.mk
+++ share/mk/bsd.compiler.mk
@@ -194,4 +194,5 @@
.endif # ${cc} == "CC" || !empty(XCC)
.endfor # .for cc in CC XCC
+.include <bsd.linker.mk>
.endif # !target(__<bsd.compiler.mk>__)
Index: share/mk/bsd.linker.mk
===================================================================
--- /dev/null
+++ share/mk/bsd.linker.mk
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+# Setup variables for the linker.
+#
+# LINKER_TYPE is the major type of linker. Currently binutils and lld support
+# automatic detection.
+#
+# LINKER_VERSION is a numeric constant equal to:
+# major * 10000 + minor * 100 + tiny
+# It too can be overridden on the command line.
+#
+# This file may be included multiple times, but only has effect the first time.
+#
+
+.if !target(__<bsd.linker.mk>__)
+__<bsd.linker.mk>__:
+
+_ld_version!= ${LD} --version 2>/dev/null | head -n 1 || echo none
+.if ${_ld_version} == "none"
+.error Unable to determine linker type from LD=${LD}
+.endif
+.if ${_ld_version:[1..2]} == "GNU ld"
+LINKER_TYPE= binutils
+_v= ${_ld_version:[3]}
+.elif ${_ld_version:[1]} == "LLD"
+LINKER_TYPE= lld
+_v= ${_ld_version:[2]}
+.else
+.error Unknown linker from LD=${LD}: ${_ld_version}
+.endif
+LINKER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
+
+.endif # !target(__<bsd.linker.mk>__)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 8:39 PM (21 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16063617
Default Alt Text
D11308.id29964.diff (1 KB)
Attached To
Mode
D11308: Add basic bsd.linker.mk auto included from bsd.compiler.mk.
Attached
Detach File
Event Timeline
Log In to Comment