bsd.linker.mk (a3604b95ed1b025e84c6b948b9939cf63fc9f9ce) bsd.linker.mk (d786d510911c8479d1ed573950523a666aec2134)
1# $FreeBSD$
2
3# Setup variables for the linker.
4#
5# LINKER_TYPE is the major type of linker. Currently binutils and lld support
6# automatic detection.
7#
8# LINKER_VERSION is a numeric constant equal to:

--- 33 unchanged lines hidden (view full) ---

42.if defined(${var}.${${X_}_ld_hash})
43${var}= ${${var}.${${X_}_ld_hash}}
44.endif
45.endfor
46.endif
47
48.if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD})
49.if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION)
1# $FreeBSD$
2
3# Setup variables for the linker.
4#
5# LINKER_TYPE is the major type of linker. Currently binutils and lld support
6# automatic detection.
7#
8# LINKER_VERSION is a numeric constant equal to:

--- 33 unchanged lines hidden (view full) ---

42.if defined(${var}.${${X_}_ld_hash})
43${var}= ${${var}.${${X_}_ld_hash}}
44.endif
45.endfor
46.endif
47
48.if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD})
49.if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION)
50_ld_version!= ${${ld}} --version 2>/dev/null | head -n 1 || echo none
50_ld_version!= (${${ld}} --version || echo none) | head -n 1
51.if ${_ld_version} == "none"
51.if ${_ld_version} == "none"
52.error Unable to determine linker type from ${ld}=${${ld}}
52.warning Unable to determine linker type from ${ld}=${${ld}}
53.endif
54.if ${_ld_version:[1..2]} == "GNU ld"
55${X_}LINKER_TYPE= bfd
56_v= ${_ld_version:M[1-9].[0-9]*:[1]}
57.elif ${_ld_version:[1]} == "LLD"
58${X_}LINKER_TYPE= lld
59_v= ${_ld_version:[2]}
60.else
53.endif
54.if ${_ld_version:[1..2]} == "GNU ld"
55${X_}LINKER_TYPE= bfd
56_v= ${_ld_version:M[1-9].[0-9]*:[1]}
57.elif ${_ld_version:[1]} == "LLD"
58${X_}LINKER_TYPE= lld
59_v= ${_ld_version:[2]}
60.else
61.error Unknown linker from ${ld}=${${ld}}: ${_ld_version}
61.warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd
62${X_}LINKER_TYPE= bfd
63_v= 2.17.50
62.endif
63${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \
64 awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
65.undef _ld_version
66.undef _v
67${X_}LINKER_FEATURES=
68.if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750
69${X_}LINKER_FEATURES+= build-id

--- 22 unchanged lines hidden ---
64.endif
65${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \
66 awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
67.undef _ld_version
68.undef _v
69${X_}LINKER_FEATURES=
70.if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750
71${X_}LINKER_FEATURES+= build-id

--- 22 unchanged lines hidden ---