Date: Fri, 23 Jun 2017 06:47:55 -0700 From: Cy Schubert <Cy.Schubert@komquats.com> To: Bryan Drewery <bdrewery@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320245 - head/share/mk Message-ID: <201706231347.v5NDlt39037415@slippy.cwsent.com> In-Reply-To: Message from Bryan Drewery <bdrewery@FreeBSD.org> of "Thu, 22 Jun 2017 21:03:24 -0000." <201706222103.v5ML3Oq3026557@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Let me try replying to this again. It's an exmh thing. Sorry. In message <201706222103.v5ML3Oq3026557@repo.freebsd.org>, Bryan Drewery writes : > Author: bdrewery > Date: Thu Jun 22 21:03:24 2017 > New Revision: 320245 > URL: https://svnweb.freebsd.org/changeset/base/320245 > > Log: > Support XLD for setting X_LINKER_TYPE and X_LINKER_VERSION. > > This is similar to r300350 for bsd.compiler.mk. > > MFC after: 2 weeks > Reviewed by: emaste > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D11309 > > Modified: > head/share/mk/bsd.linker.mk > > Modified: head/share/mk/bsd.linker.mk > ============================================================================= > = > --- head/share/mk/bsd.linker.mk Thu Jun 22 21:03:20 2017 (r32024 > 4) > +++ head/share/mk/bsd.linker.mk Thu Jun 22 21:03:24 2017 (r32024 > 5) > @@ -9,25 +9,39 @@ > # major * 10000 + minor * 100 + tiny > # It too can be overridden on the command line. > # > +# These variables with an X_ prefix will also be provided if XLD is set. > +# > # This file may be included multiple times, but only has effect the first ti > me. > # > > .if !target(__<bsd.linker.mk>__) > __<bsd.linker.mk>__: > > -_ld_version!= ${LD} --version 2>/dev/null | head -n 1 || echo none > +.for ld X_ in LD $${_empty_var_} XLD X_ > +.if ${ld} == "LD" || !empty(XLD) > +.if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) > + > +_ld_version!= ${${ld}} --version 2>/dev/null | head -n 1 || echo none This line gave one of my machines a bit of gas with the error: sh: head: not found make[2]: "/opt/src/svn-current/share/mk/bsd.linker.mk" line 42: Unable to determine linker type from LD=ld *** Error code 1 Specifying the full pathname for head resolves the isssue. > .if ${_ld_version} == "none" > -.error Unable to determine linker type from LD=${LD} > +.error Unable to determine linker type from ${ld}=${${ld}} > .endif > .if ${_ld_version:[1..2]} == "GNU ld" > -LINKER_TYPE= binutils > +${X_}LINKER_TYPE= binutils > _v= ${_ld_version:[3]} > .elif ${_ld_version:[1]} == "LLD" > -LINKER_TYPE= lld > +${X_}LINKER_TYPE= lld > _v= ${_ld_version:[2]} > .else > -.error Unknown linker from LD=${LD}: ${_ld_version} > +.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;}' > +${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \ > + awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' > +.undef _ld_version > +.undef _v > +.endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) > + > +.endif # ${ld} == "LD" || !empty(XLD) > +.endfor # .for ld in LD XLD > + > > .endif # !target(__<bsd.linker.mk>__) > > -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706231347.v5NDlt39037415>