tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: $LD contents changing



Hi,

On Fri, 13 Apr 2012 17:33:18 +0900, Filip Hajny <filip%joyent.com@localhost> 
wrote:

can someone help me understand what's happening here? I'm setting LD in my 
mk.conf file currently, but it's being re-set to just 'ld' somewhere in the 
'tools' phase. I tried going through the 'mk' directory up and down, but still 
don't understand it where/why is it happening.

[root /opt/pkgsrc/devel/libtool-base pkgsrc_2012Q1 ]# bmake show-var VARNAME=LD
/usr/bin/ld

[root /opt/pkgsrc/devel/libtool-base pkgsrc_2012Q1 ]# bmake tools
=> Bootstrap dependency digest>=20010302: found digest-20111104
=> Checksum SHA1 OK for libtool-2.2.6b.tar.gz
=> Checksum RMD160 OK for libtool-2.2.6b.tar.gz
===> Installing dependencies for libtool-base-2.2.6bnb6
=> Build dependency nbpatch-[0-9]*: found nbpatch-20100124
=> Build dependency checkperms>=1.1: found checkperms-1.11
===> Overriding tools for libtool-base-2.2.6bnb6

[root /opt/pkgsrc/devel/libtool-base pkgsrc_2012Q1 ]# bmake show-var VARNAME=LD
ld

I'm trying to make libtool behave properly, but with the value of LD stripped 
of path, libtool's configure will fall back to PATH based linker lookup, which 
means that as soon as binutils is installed, libtool will try to use it, 
regardless of what linker GCC was configured to use.

One way would be to stop adding lt_cv_path_LD=${LD:Q} to CONFIGURE_ENV in 
devel/libtool/Makefile.common, as libtool knows how to extract the linker from 
'gcc -print-prog-name', but that's really GCC specific only.

(This is on SmartOS/SunOS.)

Is this is a bug in devel/libtool?

No, it's a expected behavior.

If you have "LD=/bin/foo" in mk.conf, LD will be stripped as "LD=foo",
but ${WRAPPER_DIR}/bin/foo (wrapper for /bin/foo) will be created and
${WRAPPER_DIR}/bin/ld is symbolic link to the wrapper.
${WRAPPER_DIR}/bin will be put in the front of PATH.

The wrapper script for LD is required for pkgsrc (buildlink),
so LD for libtool must not be absolute path.
(but it is not expected result for using libtool without pkgsrc framework)

--
OBATA Akio / obache%NetBSD.org@localhost


Home | Main Index | Thread Index | Old Index