Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra libraries on CC build command #647

Open
jkeenan opened this issue Nov 9, 2009 · 3 comments
Open

Extra libraries on CC build command #647

jkeenan opened this issue Nov 9, 2009 · 3 comments

Comments

@jkeenan
Copy link
Contributor

jkeenan commented Nov 9, 2009

This ticket moves to the Trac system discussion of issues originally raised as [http://rt.perl.org/rt3/Ticket/Display.html?id=53610 RT 53610]. In that RT, Alberto Simões stated:

As discussed on the mailing list, currently parrot is being
linked with a bunch of libraries that will be just used by 
dynamic loading.

For instante:

[ambs@rachmaninoff parrot]$ ldd parrot
parrot:
/Users/ambs/Projects/parrot/blib/lib/libparrot.dylib 
  (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.0.0)
/opt/local/lib/libicuuc.38.dylib (compatibility version 38.0.0, current
version 38.1.0)
/opt/local/lib/libicudata.38.dylib (compatibility version 38.0.0,
current version 38.1.0)
/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current
version 8.2.0)
/opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0,
current version 5.2.0)
/opt/local/lib/libpcre.0.dylib (compatibility version 1.0.0, current
version 1.1.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/GLUT.framework/Versions/A/GLUT
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current
version 0.9.7)
/opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current
version 9.2.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)

From these, I am sure GLUT/GL and pcre should not be there. 
Some others might be in excess as well, like readline (?).

So, the CC line used to build parrot should be cleaned up 
from these extra libraries.

Note: Though I too am on Darwin (albeit an older version), I apparently don't have the ldd command, so I could not produce a more recent report on that platform. It's not clear to me whether this is a Darwin-specific issues or one that applies regardless of platform.

kid51

Originally http://trac.parrot.org/parrot/ticket/1246

@ghost
Copy link

ghost commented Nov 9, 2009

In perl 5, we use two separate variables, libs and perllibs, to deal with this issue. The libs variable contains the full list of libraries found by Configure. Libraries only needed by extensions are normally dropped from the perllibs variable. The final linking of the perl executable only uses perllibs.

@coke
Copy link
Contributor

coke commented Nov 15, 2009

Here's an OS X shortcut that vaguely simulates ldd:

$ alias ldd
alias ldd='otool -arch all -L'
$ ldd ~/bird/bin/parrot | head -2
/Users/coke/bird/bin/parrot:
        /Users/coke/research/parrot/blib/lib/libparrot.dylib (compatibility version 0.0.0, current version 0.0.0)

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 9, 2010

Here are recent (r47499) data first from linux/i386 ...

$ ldd ./parrot
        linux-gate.so.1 =>  (0xb7ef7000)
        libparrot.so.2.4.0 =>
            /home/jimk/work/parrot/blib/lib/libparrot.so.2.4.0 (0xb7cc8000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7ca9000)
        libm.so.6 => /lib/libm.so.6 (0xb7c83000)
        libicuuc.so.36 => /usr/lib/libicuuc.so.36 (0xb7b69000)
        libicudata.so.36 => /usr/lib/libicudata.so.36 (0xb71b9000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb71a2000)
        libdl.so.2 => /lib/libdl.so.2 (0xb719e000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb716c000)
        libutil.so.1 => /lib/libutil.so.1 (0xb7168000)
        librt.so.1 => /lib/librt.so.1 (0xb715e000)
        libgmp.so.3 => /usr/lib/libgmp.so.3 (0xb711b000)
        libreadline.so.5 => /lib/libreadline.so.5 (0xb70e9000)
        libc.so.6 => /lib/libc.so.6 (0xb6fab000)
        /lib/ld-linux.so.2 (0xb7ef8000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6ebd000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6eaf000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb6e7d000)

... and then, using Coke's suggestion, from darwin/ppc:

[parrot] 569 $ otool -arch all -L ./parrot
./parrot:
        /Users/jimk/work/parrot/blib/lib/libparrot.dylib
            (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib
            (compatibility version 1.0.0, current version 88.1.12)
        /sw/lib/libgmp.3.dylib (compatibility version 7.0.0, current version 7.3.0)
        /sw/lib/libreadline.5.dylib
            (compatibility version 5.0.0, current version 5.0.0)
        /opt/local/lib/libintl.8.dylib
            (compatibility version 9.0.0, current version 9.2.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 47.1.0)

So, now, in each case, how would we determine what is not needed for the parrot executable (hence, only needed for libraries)?

Thank you very much.

kid51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants