Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146224689
D14318.id39177.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
D14318.id39177.diff
View Options
Index: share/mk/bsd.linker.mk
===================================================================
--- share/mk/bsd.linker.mk
+++ share/mk/bsd.linker.mk
@@ -49,16 +49,29 @@
.if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD})
.if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION)
-_ld_version!= (${${ld}} --version || echo none) | head -n 1
+_ld_version!= (${${ld}} --version 2>/dev/null || echo none) | head -n 1
+.if ${_ld_version} == "none"
+# The MacOS /usr/bin/ld doesn't accept --version but -v works.
+# The final test -eq 141 is there in order to make this work even when the bmake
+# shell is set to bash -o pipefail
+_ld_version!= (${${ld}} -v 2>&1 || echo none) | head -n 1 || test $$? -eq 141
.if ${_ld_version} == "none"
.warning Unable to determine linker type from ${ld}=${${ld}}
.endif
+.endif
.if ${_ld_version:[1..2]} == "GNU ld"
${X_}LINKER_TYPE= bfd
_v= ${_ld_version:M[1-9].[0-9]*:[1]}
.elif ${_ld_version:[1]} == "LLD"
${X_}LINKER_TYPE= lld
_v= ${_ld_version:[2]}
+.elif ${_ld_version:[1]} == "@(\#)PROGRAM:ld"
+# bootstrap linker on MacOS
+${X_}LINKER_TYPE= mac
+_v= ${_ld_version:[2]:S/PROJECT:ld64-//}
+# Convert version 305 to 3.0.5 so that the echo + awk below works
+_v:= ${_v:C/([0-9])([0-9])/\1.\2./}
+# .info "MacOS linker version is ${_v}"
.else
.warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd
${X_}LINKER_TYPE= bfd
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 1, 9:59 PM (2 h, 28 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29093998
Default Alt Text
D14318.id39177.diff (1 KB)
Attached To
Mode
D14318: Make bsd.linker.mk work with the MacOS linker
Attached
Detach File
Event Timeline
Log In to Comment