Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2016 21:11:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 213547] Mk/Scripts/qa.sh - hard-coded LD_LIBRARY_PATH causes false positives
Message-ID:  <bug-213547-13-ervsyVjCD9@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-213547-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-213547-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213547

--- Comment #3 from John Hein <z7dr6ut7gs@snkmail.com> ---
(In reply to yuri from comment #2)

Thanks for providing the background for why LD_LIBRARY_PATH was added.

By the way, here's the difference (you should get the same if the libc++ po=
rt
is installed):

% ldd /usr/local/lib/libjsoncpp.so > /tmp/base ; env
LD_LIBRARY_PATH=3D/usr/local/lib ldd /usr/local/lib/libjsoncpp.so > /tmp/po=
rts ;
diff -u /tmp/base /tmp/ports
> --- /tmp/base 2016-10-18 14:50:37.247449000 -0600
> +++ /tmp/ports        2016-10-18 14:50:37.263341000 -0600
> @@ -1,7 +1,8 @@
>  /usr/local/lib/libjsoncpp.so:
>       libthr.so.3 =3D> /lib/libthr.so.3 (0x801639000)
> -     libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x80185d000)
> -     libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x801b1c000)
> -     libm.so.5 =3D> /lib/libm.so.5 (0x801d39000)
> -     libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x801f62000)
> +     libc++.so.1 =3D> /usr/local/lib/libc++.so.1 (0x80185d000)
> +     libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x801b1d000)
> +     libm.so.5 =3D> /lib/libm.so.5 (0x801d3a000)
> +     libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x801f63000)
>       libc.so.7 =3D> /lib/libc.so.7 (0x800822000)
> +     librt.so.1 =3D> /usr/lib/librt.so.1 (0x802171000)

Pretty straightforward... the path specified in LD_LIBRARY_PATH is searched
first causing it to find /usr/local/lib/libc++.so.1 (and its dependencies)
before /usr/lib/libc++.so.1

If we remove LD_LIBRARY_PATH from qa.sh, we'll just use the normal system
search path... which is the right thing for stage-qa to do.  Since you said=
 it
was added just to get ldd to look in /usr/local/lib, then it's definitely n=
ot
needed.  The system looks there by default already (try 'ldconfig -r | grep
search').  rpath and setuid-ness can change the lib search behavior a bit, =
but
neither of those are involved in this case.

This same problem can happen whether you build with poudriere or not.  It m=
ay
be that if you build jsoncpp using poudriere, devel/libc++ might not be
installed in your jail.  In that case, of course you won't see the problem.=
  I
believe you could try doing a bulk poudriere build with devel/libc++ and
devel/jsoncpp if you really want to see the problem in poudriere.

In any case, inside or outside the jail, I believe it's safe (and correct) =
to
remove the LD_LIBRARY_PATH.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213547-13-ervsyVjCD9>