Ticket #1246 (new bug)

Opened 5 years ago

Last modified 3 years ago

Extra libraries on CC build command

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: configure Version: 1.7.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description (last modified by jkeenan) (diff)

This ticket moves to the Trac system discussion of issues originally raised as  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

Change History

Changed 5 years ago by doughera

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.

Changed 5 years ago by coke

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)

Changed 4 years ago by jkeenan

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

Changed 3 years ago by jkeenan

  • description modified (diff)
Note: See TracTickets for help on using tickets.