[Bug 213547] Mk/Scripts/qa.sh - hard-coded LD_LIBRARY_PATH causes false positives
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Oct 18 21:11:13 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213547
--- Comment #3 from John Hein <z7dr6ut7gs at 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++ port
is installed):
% ldd /usr/local/lib/libjsoncpp.so > /tmp/base ; env
LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/lib/libjsoncpp.so > /tmp/ports ;
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 => /lib/libthr.so.3 (0x801639000)
> - libc++.so.1 => /usr/lib/libc++.so.1 (0x80185d000)
> - libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x801b1c000)
> - libm.so.5 => /lib/libm.so.5 (0x801d39000)
> - libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x801f62000)
> + libc++.so.1 => /usr/local/lib/libc++.so.1 (0x80185d000)
> + libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x801b1d000)
> + libm.so.5 => /lib/libm.so.5 (0x801d3a000)
> + libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x801f63000)
> libc.so.7 => /lib/libc.so.7 (0x800822000)
> + librt.so.1 => /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 not
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 may
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-ports-bugs
mailing list