Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2015 20:46:03 +0200
From:      David Naylor <dbn@freebsd.org>
To:        FreeBSD Mailing List <freebsd-ports@freebsd.org>, freebsd-python@freebsd.org
Cc:        Bartek Rutkowski <robak@freebsd.org>
Subject:   The mystery of the missing library.
Message-ID:  <2883201.vcG9JJBxrl@dragon.local>

next in thread | raw e-mail | index | archive | help

--nextPart2070440.nVP58Iq3bL
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Hi Hackers,

I am busy simplifying the lang/pypy port (see 
https://reviews.freebsd.org/D3209) however I have uncovered a rather 
strange problem:

## BACKGROUND ##
PyPy has it's own directory layout so we install it into $PREFIX/pypy-2.6.  In 
there is everything pypy needs including bin/pypy (the binary) and 
bin/libpypy-c.so (the shared library).  

For convenience we create a symlink to the pypy binary:
```
# ln -s ../pypy-2.6/bin/pypy $PREFIX/bin/pypy
```

## PROBLEM ##
For some reason FreeBSD cannot find the library when executing the 
pypy command - except under some situations:
```
# uname -a
FreeBSD dragon.local 10.1-RELEASE-p10 FreeBSD 10.1-RELEASE-p10 #0: 
Wed May 13 06:54:13 UTC 2015     root@amd64-
builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

# cd /

# pypy
Shared object "libpypy-c.so" not found, required by "pypy"

# `which pypy`
Shared object "libpypy-c.so" not found, required by "pypy"

# .`which pypy`
Python 2.7.9 (295ee98b69288471b0fcf2e0ede82ce5209eb90b, Jul 26 
2015, 18:38:23)
[PyPy 2.6.0 with GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 
(tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>>> 

# ldd `which pypy`
/usr/local/bin/pypy:
        libpypy-c.so => not found (0)
        libthr.so.3 => /lib/libthr.so.3 (0x80081d000)
        libc.so.7 => /lib/libc.so.7 (0x800a42000)

# ldd .`which pypy`
./usr/local/bin/pypy:
        libpypy-c.so => /usr/local/pypy-2.6/bin//libpypy-c.so (0x80081d000)
        libthr.so.3 => /lib/libthr.so.3 (0x804337000)
        libc.so.7 => /lib/libc.so.7 (0x80455c000)
        libbz2.so.4 => /usr/lib/libbz2.so.4 (0x804906000)
        libm.so.5 => /lib/libm.so.5 (0x804b18000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x804d40000)
        libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x804f4a000)
        libz.so.6 => /lib/libz.so.6 (0x805170000)
        libssl.so.7 => /usr/lib/libssl.so.7 (0x805386000)
        libcrypto.so.7 => /lib/libcrypto.so.7 (0x8055f1000)
        libffi.so.6 => /usr/local/lib/libffi.so.6 (0x8059e5000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x805bec000)
        librt.so.1 => /usr/lib/librt.so.1 (0x805e0c000)
        libutil.so.9 => /lib/libutil.so.9 (0x806012000)
        libncurses.so.8 => /lib/libncurses.so.8 (0x806224000)
```

Why would the shared library be found when using a relative path but not 
when using an absolute path?  Is this a bug in FreeBSD? 

Regards

David

--nextPart2070440.nVP58Iq3bL
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAABCgBmBQJVt83rXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5NDhFQzUxMUEyN0YwMzAyRTc5OUI1M0FB
RDYzRkE4REQ2QjJEQTU1AAoJEK1j+o3WstpVoMUP/13bHiPR9ERzLEI6aWq7hb5X
NG8NNsUOJ+TP20vipoHSGv26M7qzdpASEkDyV9KNG+rMSYYG71VHUs74BG4F3y1Y
DfwVgeVnenh4c7Ej1Rxo9hleRTJ9m9GgVxmrQbtFiARx7GFVzVItdA7m3IBVAIs1
X3Ar3IukiZmcTQ166fNmjXyUTQOM3l4wWTFuR324W/AKa0aDou9LN2uR6JBcqIjL
xCv3r7GmpjJ7TFe6IBV8zJpQ805Smt057GYbdh+GvhLfauRxWxJdTrMcJID0crMM
Ztar14s+HofTiaHqRIdqlY48k0EAs+u6lM8wrqB1InVuvZ73oG47DKVip/Zb8Nji
xm5xoPj2GIDrdFBLoPaLzWBwcsz9xIeh4LAIeyklK052L9/sb7VCX6inwxiGuJKy
C/nSKxVx4GbPTX0arzkyjPM+YQUHSG+SJMrWw0XcX+BdcqZB6BKC4YKwAegKSt+j
c8Kj/CoQD0HczokI52pPAIeoiahY5wfIj8anQSfhmXgGpx70TxHyHGK0fEDZNtNP
gYkBb2nrllmJ+mZ3bqOc2tPvhwgd+9V9rvfk32H9R8rcpDUy/fYR3rXSzZ3R3rzf
KDxLEOo1bOX5pw0vbsVW9RAO6B5UCEadCL+UDny0St8fBQwMP/eGIeAY/X4oHb//
grpAukIV0y5jEbv2Sb/T
=Uy1B
-----END PGP SIGNATURE-----

--nextPart2070440.nVP58Iq3bL--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2883201.vcG9JJBxrl>