SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I understand that it has been practice for many years now to remove .la files from software packages before calling makepkg. I've read volkerdi's post where he explained the rationale.
Accordingly, I've added the standard "remove .la" routine to a SlackBuild script that I'm working on.
When complete, I notice that there are still about a dozen *.la files in my final package. Apparently, they (the retained .la files) are being missed by the above "rm" command because they do not reside in usr/lib64. Rather, for this package, "make install" places them in usr/lib64/subdirectory1/subdirectory2/blahblah.la
Based on the aforementioned post--where volkerdi states the goal of "shipping as few .la files as possible (and hopefully someday none at all)"--I've gone ahead and replaced the simple "rm" with the following:
This worked: I now have a package with "none at all"--i.e., all *.la files have been successfully purged before invoking makepkg.
But, seeing as how the simple "rm" command quoted above was taken directly from Slackware's official SlackBuild scripts, it seems that Slackware itself is content to let slide those *.la files that are found in subdirectories of usr/lib(64). (or am I missing something?)
In light of this, I'm beginning to question whether my "find" command is too aggressive. That is to say, do we really want to remove all *.la files, or just the ones in lib(64) itself?
Based on the aforementioned post--where volkerdi states the goal of "shipping as few .la files as possible (and hopefully someday none at all)"--I've gone ahead and replaced the simple "rm" with the following:
This worked: I now have a package with "none at all"--i.e., all *.la files have been successfully purged before invoking makepkg.
That's bad.
It was discussed in the past about this "full" removal of the .la files, and I understand that's quite bad, because the plugins, drivers, whatever things which are libraries outside of the standard library paths, they still need their .la files.
So, the .la files should be removed only from the library paths (just like Slackware do), otherwise bad things will happen.
Last edited by LuckyCyborg; 09-08-2021 at 12:29 PM.
Hi Jay, it seems you missed an important part of what Pat wrote in the ChangeLog: I'll paste the whole bit below
Quote:
Originally Posted by Pat
Thu Apr 19 01:04:06 UTC 2018
Hi folks, and welcome to the third ever Slackware Mass Rebuild (and the
longest ChangeLog entry in project history). There were two primary
motivations for rebuilding everything in the main tree. The first was to
switch to the new C++ ABI. The second was to get rid of all the .la files
in the LD_LIBRARY_PATH. Really, having .la files installed has been mostly
obsolete since things began to use pkg-config instead, but it's not easy
to get rid of them unless you do it all at once. If you just take them out
of one package, any other packages containing .la files that refer to the
removed ones will be broken. We've removed a few here and there before
(and then handled any packages that had referred to them with a rebuild),
but it was time to finally remove all the ones in /lib{,64} and
/usr/lib{,64}. One of the reasons that this really needed to happen is that
many projects are starting to migrate to build systems other than autotools,
and those systems do not generate .la files. So if we didn't get rid of them
now, we might end up in a situation later on where they are being removed
by upstream and then we would have to chase down the dependency breakage and
recompile (possibly many) other packages. The .la files that are outside of
the LD_LIBRARY_PATH were not removed (and shouldn't be) - those ones are
often used by the lt_dlopen() function to load plugins and removing those
ones can break things. But those ones don't cause problems... they aren't
likely to try to infect .la files produced by other packages.
IMPORTANT NOTE: If you have any third party or other packages installed on
your system that don't come with Slackware, and those packages have installed
any .la files, it is very likely that they refer to some .la files which we
have just removed, and that trying to compile against these packages will no
longer work. Luckily, the solution is simple: remove them. This command will
remove any stale .la files from the LD_LIBRARY_PATH:
rm /{,usr/}lib{,64}/*.la
Moving forward, nothing shipped in Slackware will contain any .la files in
those directories, and any SlackBuilds intended to be used with Slackware 15.0
should contain this bit of script:
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
Thanks, LC and ponce. It turns out my intuition was right...
That is, after I read volkerdi's statement about "none at all," I added the "find" command. Since I had about an hour of build time to contemplate the situation, I began to think to myself: "But if this 'find' was really necessary, wouldn't volkerdi put it in his SlackBuilds?"
The fact that official Slackware build scripts remove the *.la files from only lib(64) and usr/lib(64) led me to question my use of the "find" command to remove them all.
@ponce
Another valuable lesson you've imparted: always search the Changelog first!
Thanks again, both of you.
Marking this as solved.
Last edited by JayByrd; 09-08-2021 at 12:56 PM.
Reason: clarification.
I understand that it has been practice for many years now to remove .la files from software packages before calling makepkg. I've read volkerdi's post where he explained the rationale.
Accordingly, I've added the standard "remove .la" routine to a SlackBuild script that I'm working on.
When complete, I notice that there are still about a dozen *.la files in my final package. Apparently, they (the retained .la files) are being missed by the above "rm" command because they do not reside in usr/lib64. Rather, for this package, "make install" places them in usr/lib64/subdirectory1/subdirectory2/blahblah.la
Based on the aforementioned post--where volkerdi states the goal of "shipping as few .la files as possible (and hopefully someday none at all)"--I've gone ahead and replaced the simple "rm" with the following:
This worked: I now have a package with "none at all"--i.e., all *.la files have been successfully purged before invoking makepkg.
But, seeing as how the simple "rm" command quoted above was taken directly from Slackware's official SlackBuild scripts, it seems that Slackware itself is content to let slide those *.la files that are found in subdirectories of usr/lib(64). (or am I missing something?)
In light of this, I'm beginning to question whether my "find" command is too aggressive. That is to say, do we really want to remove all *.la files, or just the ones in lib(64) itself?
TIA,
Jay
I've actually been using:
Code:
find $PKG -type f -name '*.la' -delete
on current for quite a while and have had no issues.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.