From: Valters Jansons <valter.jansons@gmail.com>
To: location@lists.ipfire.org
Subject: [PATCH 2/2] Makefile: Avoid installing libtool control files
Date: Wed, 24 Jun 2026 22:39:15 +0900 [thread overview]
Message-ID: <20260624133915.434197-2-valter.jansons@gmail.com> (raw)
In-Reply-To: <20260624133915.434197-1-valter.jansons@gmail.com>
This project currently uses autoconf, automake, and libtool for
building. During build process, libtool creates `.la` control files
with metadata about the `.so` library. On modern systems, shipping
these files is now strongly discouraged.
The `.la` files are generally not used on live systems. The only
scenario where they would be used is if someone loads the library using
libltdl (libtool's `dlopen` wrapper). However, both Python and Lua just
load the library directly using a `dlopen("location.so")` instead of
calling `lt_dlopen("location.la")`. This project does not reference
`lt_dlopen` or `ltdl` as such.
Moreover, the `.la` files include redundant dependency chain
information. For example, the Lua module depends on libloc. Even though
OpenSSL is a transitive dependency (`src/database.c` and `src/writer.c`,
not `src/lua/`), libtool anyway adds `-lssl` (as well as `-lcrypto
-lresolv`) directly to `dependency_libs` of Lua's `location.la`.
Listing these transitive dependencies muddies the chain. If someone is
consuming the Lua module downstream, then libtool would force the full
dependency chain onto them directly, which is not needed.
Additionally, due to hardcoded dependencies, rebuild propagation is
a concern. An upstream library updating their soname requires all
downstream `.la` files to be rebuilt, even if libloc's ABI has not
changed. This is especially painful at distro packaging scale.
As a result, modern packaging is pushing towards removing these `.la`
files. In cases where some libltdl consumers exist, the fallback route
is emptying out the dependency_libs metadata field. This is visible in
Debian Lintian as error `non-empty-dependency_libs-in-la-file`.
We can go the whole way and drop these files outright. The `.la` files
reference each other; therefore, when one is being removed, all of them
should be removed, to avoid dangling references.
Ref: https://wiki.debian.org/ReleaseGoals/LAFileRemoval
Ref: https://fedoraproject.org/wiki/Changes/RemoveLaFiles
Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
---
Note: This commit adds the removal logic in `install-exec-hook`. This
depends on the parent commit in this series, ensuring Lua is installed
in `exec` instead of `data`.
Makefile.am | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index a64a20a..735e07a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -359,6 +359,20 @@ CLEANFILES += \
# ------------------------------------------------------------------------------
+install-exec-hook:
+ # Avoid installing .la files, as we do not use libltdl.
+ @for la in $(lib_LTLIBRARIES); do \
+ rm -f "$(DESTDIR)$(libdir)/`basename $$la`"; \
+ done
+ @for la in $(pyexec_LTLIBRARIES); do \
+ rm -f "$(DESTDIR)$(pyexecdir)/`basename $$la`"; \
+ done
+ @for la in $(luaexec_LTLIBRARIES); do \
+ rm -f "$(DESTDIR)$(luaexecdir)/`basename $$la`"; \
+ done
+
+# ------------------------------------------------------------------------------
+
# Use systemd timers if available
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
--
2.54.0
next prev parent reply other threads:[~2026-06-24 13:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 13:39 [PATCH 1/2] Makefile: Install Lua in `exec` stage, not `data` Valters Jansons
2026-06-24 13:39 ` Valters Jansons [this message]
2026-06-24 13:49 ` [PATCH 2/2] [v2] Makefile: Avoid installing libtool control files Valters Jansons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624133915.434197-2-valter.jansons@gmail.com \
--to=valter.jansons@gmail.com \
--cc=location@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox