Should *.la libraries be stripped?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Should *.la libraries be stripped?

#1 Post by musher0 »

Hello all.

After I've compiled an application, I routinely do a < strip --stip-unneeded > on the resulting
executable and *.so libraries.

Can we strip big *.la libraries as well? I read somewhere that we should leave those as
they are. Is that true? Why would that be?

Thanks in advance for any insight.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

You must be thinking of the *.a archives. *.la files are simple text files which can't be stripped.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Thanks, amigo. I'll study it more. BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#4 Post by Geoffrey »

I think the la files are used to statically link, you should be able to remove those and any other DEV files.

I usually split the packages once compiled to separate DEV, DOC, NLS, if you are using "new2dir make install" or "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install"
then just drag the created package output folder to this script(splitpkg.sh)

Note: "new2dir make install" will strip unneeded, where "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install" doesn't,
so "strip --strip-unneeded" will have to be performed on the resulting binaries and lib files.
Attachments
splitpkg.tar.gz
(942 Bytes) Downloaded 147 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#5 Post by 01micko »

Sorry @musher0 for my misleading tired post which caused the confusion. I'll edit it.
Puppy Linux Blog - contact me for access

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

01micko wrote:Sorry @musher0 for my misleading tired post which caused the confusion. I'll edit it.
Oh, hi, 01micko!

No-no, it has nothing to do with the libabiword snafu in the last slacko devx. But thanks
for showing up! :)

The reason I initiated this thread is that I compiled the most recent "sox" (aka Sound
Exchange) utility, and there's are big a and la libraries in there after compilation. I was
wondering what to do with them -- if it would damage anything if I tried to strip them.
(BTW, sox works fine with those libs as they are.)

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

Hi musher0

Before you run ./configure run ./configure --help and look at the options to see if something like '--disable-static' is available. You may have to type '--disable-static=yes' or '--enable-static=no'. If you are not going to make use of programs that link in the static library then there is no use having it.

Cheers!
Puppy Linux Blog - contact me for access

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

Geoffrey wrote:I think the la files are used to statically link, you should be able to remove those and any other DEV files.

I usually split the packages once compiled to separate DEV, DOC, NLS, if you are using "new2dir make install" or "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install"
then just drag the created package output folder to this script(splitpkg.sh)

Note: "new2dir make install" will strip unneeded, where "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install" doesn't,
so "strip --strip-unneeded" will have to be performed on the resulting binaries and lib files.
Hi Geoffrey.

I know that I can do a < strip --strip-unneeded > on ELF executables and *.so libs, but...
are you saying that I could also apply a < strip --strip-unneeded > to the a and la files?

Thanks in advance.

BFN.

~~~~~~~~~~~~~~~
PS.
I'm not absolutely clear about your "new2dir" procedure, but I'm keeping it out of the
current discussion to maintain focus.

I'm a bit suspicious about it, actually. I always do the < make install > with the 2nd
option that you mention: "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install".
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

01micko wrote:Hi musher0

Before you run ./configure run ./configure --help and look at the options to see if something like '--disable-static' is available. You may have to type '--disable-static=yes' or '--enable-static=no'. If you are not going to make use of programs that link in the static library then there is no use having it.

Cheers!
Ah. So all packages do NOT build dynamically by default. I didn't know that. Thanks.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#10 Post by 01micko »

musher0 wrote:Ah. So all packages do NOT build dynamically by default. I didn't know that. Thanks.
Most do actually; a notable exception is wireless-tools. Some build both by default, some only shared, some (rare) only static.

Anyway, I found a slackbuild that strips ar archives with 'strip --strip-debug' here
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \
xargs strip --strip-debug 2> /dev/null
I suppose it is probably safer.

HTH
Puppy Linux Blog - contact me for access

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#11 Post by Geoffrey »

musher0 wrote: I know that I can do a < strip --strip-unneeded > on ELF executables and *.so libs, but...
are you saying that I could also apply a < strip --strip-unneeded > to the a and la files?
Na, I thought I'd mention that the .la .a are part of the DEV files and aren't needed if you only want the the application and the lib files it requires.
I'm not absolutely clear about your "new2dir" procedure, but I'm keeping it out of the
current discussion to maintain focus.
"new2dir make install" will install to your system as well as make a directory that a package can be made from,
"make DESTDIR=/Bla install", installs only to the DESTDIR, but I don't always have success with it, sometimes the directory is left empty

http://puppylinux.org/wikka/new2dir
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#12 Post by Sailor Enceladus »

Thanks for that info Geoffrey, new2dir looks pretty handy. I also had the issue where DESTDIR was just ignored when adding it to make install in a certain source. Having the DEV/NLS/DOC separated automatically also sounds convenient for puppy builds.

version2013
Posts: 503
Joined: Mon 09 Sep 2013, 00:00
Location: Florida, USA
Contact:

#13 Post by version2013 »

Geoffrey wrote:I think the la files are used to statically link, you should be able to remove those and any other DEV files.

I usually split the packages once compiled to separate DEV, DOC, NLS, if you are using "new2dir make install" or "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install"
then just drag the created package output folder to this script(splitpkg.sh)

Note: "new2dir make install" will strip unneeded, where "make DESTDIR=/PATH/TO/PACKAGE/FOLDER install" doesn't,
so "strip --strip-unneeded" will have to be performed on the resulting binaries and lib files.
I am not sure where the 'splitpkg.sh' originated, but thank you for posting it on the forum.

When I compile and create pet files, I previously used new2dir.
Using new2dir when compiling and packaging 'wine' worked fine.
For some pet files, I needed to manually comment-out the lines in that script for stripping.

At some point, I needed to compile and package some other application.
new2dir would not function correctly with this app.
I needed to find an alternative to new2dir because I still needed the splitting function it has.

I found this forum thread and splitpkg.
Thank you again.

Post Reply