Skip to content

Drop the unused LT_INIT and the libtool build dependency - #762

Merged
fcostaoliveira merged 2 commits into
masterfrom
fix/640-lt-init
Oct 17, 2026
Merged

fcostaoliveira merged 2 commits into
masterfrom
fix/640-lt-init

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

configure.ac calls LT_INIT, but nothing in the build uses libtool. If libtool's m4 macros are not installed when autoreconf runs, autoreconf still succeeds, LT_INIT is left as a literal line in configure, and configure prints LT_INIT: command not found but exits 0. The build works, but the error line is confusing, and libtool is a build dependency we do not need. On a system without libtool the RPM build stops before it starts, because the spec has BuildRequires: libtool.

Root cause

LT_INIT has been in configure.ac since the first commit. Makefile.am builds only programs (bin_PROGRAMS, check_PROGRAMS, the fuzz noinst_PROGRAMS). There are no *_LTLIBRARIES and no .la/.lo files, and no script or workflow calls $(LIBTOOL). With libtool installed, automake just runs the final link through ./libtool --mode=link, which adds nothing for a plain executable. autoconf's forbidden-token check covers ^_?A[CHUMST]_ but not LT_, so a missing libtool is not caught.

Fix

  • Remove LT_INIT from configure.ac. Explicitly run AC_PROG_CC before the coverage macro, which reads $GCC; AC_CONFIG_MACRO_DIR([m4]) stays for ax_code_coverage.m4.

  • Drop libtool from the build-dependency lists: rpm/memtier-benchmark.spec (BuildRequires), Dockerfile.alpine, the Alpine and macOS jobs in ci.yml, release-rpm.yml, scripts/test-rpm-locally.sh, and DEVELOPMENT.md.

  • Remove the stale .libs/ artifact path and guard the libtool-free Alpine build against literal libtool macros or unknown commands in configure. The guard catches reintroducing LT_INIT, even though configure otherwise exits successfully.

Generated Makefile variables (CC, CXX, CFLAGS, CXXFLAGS, CPPFLAGS, LDFLAGS, LIBS, DEFS) are identical before and after. The order of the linked shared libraries (DT_NEEDED) changes when the libtool wrapper is removed; the library set and application code remain the same, so this ordering change is harmless for these dependencies. config.h only loses HAVE_DLFCN_H and LT_OBJDIR, which no source uses (the two test injectors include <dlfcn.h> directly). debian/ is unaffected: dh-autoreconf still pulls libtool, which is harmless. The macOS jobs build libevent from release tarballs, which ship their own ltmain.sh, so they don't need Homebrew's libtool either. .gitignore keeps libtool/ltmain.sh for trees configured before this change.

Test evidence

These are build-system changes, so the "tests" are the build flows. Host: Ubuntu 24.04, autoconf 2.71, automake 1.16.5. "libtool hidden" means libtool/libtoolize removed from PATH, and aclocal pointed at a system dir that holds only pkg.m4, as in the issue.

Flow origin/master afbb514 this PR
autoreconf + configure, libtool hidden ./configure: line 3602: LT_INIT: command not found, rc=0 autoreconf: configure.ac: not using Libtool, no error, rc=0
autoreconf + configure + make, libtool present builds; ./libtool and ltmain.sh generated, link goes through $(LIBTOOL) builds; no libtool or ltmain.sh, same flags
make check 12/12 pass 12/12 pass
make distcheck, libtool hidden (*) n/a rc=0, 12/12 pass, archives ready for distribution
RPM build in rockylinux:8 with no libtool installed (body of scripts/test-rpm-locally.sh) error: Failed build dependencies: libtool is needed by memtier-benchmark-255.255.255-1.el8.x86_64 rc=0, OK: el8 x86_64 built, signed-not-verified, and repo-installed, with direct install and local-repo install
docker build -f Dockerfile.alpine (no libtool in apk list) n/a builds; memtier_benchmark v=255.255.255 ... openssl=OpenSSL 3.5.9

(*) make distcheck on this host fails for an unrelated reason, #644 (bash completion installed outside --prefix). The run above passes DISTCHECK_CONFIGURE_FLAGS=PKG_CONFIG_LIBDIR=/usr/lib/x86_64-linux-gnu/pkgconfig so the completion falls back to $datadir. #644 is fixed in a separate PR.

The owner follow-up additionally passes a fresh host build and all 12 unit tests. A fresh Alpine container with no libtool builds and passes the same 12 tests; restoring LT_INIT makes the new CI guard fail, and the separate unknown-command diagnostic check also catches the resulting error.

These flows are deterministic, so I ran each one once. CI covers the Alpine and macOS jobs and the RPM workflow.

Fixes #640

Affected versions

1.0.0 through 2.5.2 (latest) and master. Introduced by 833a8df "First memtier_benchmark version." (first tag 1.0.0). Confirmed on master afbb514.

🤖 Generated with Claude Code


Note

Low Risk
Build-system and packaging-only changes; no application logic, with CI guards to catch accidental libtool macro regressions.

Overview
Removes the unused libtool integration from the autotools build so environments without libtool (e.g. minimal Alpine, RPM builders) configure and link cleanly instead of emitting a misleading LT_INIT: command not found while still exiting 0.

configure.ac drops LT_INIT and adds AC_PROG_CC before AX_CODE_COVERAGE (coverage macros expect $GCC). libtool is removed from documented and packaged build deps (DEVELOPMENT.md, Dockerfile.alpine, RPM spec, release-rpm.yml, test-rpm-locally.sh) and from macOS/Alpine CI install lists. The Alpine CI job now fails if configure contains literal LT_* lines or unknown commands from a bad macro expansion; the Ubuntu artifact upload no longer includes the stale .libs/ path.

Reviewed by Cursor Bugbot for commit 6f35988. Bugbot is set up for automated code reviews on this repo. Configure here.

fcostaoliveira and others added 2 commits October 17, 2026 04:08
configure.ac called LT_INIT, but the build has no libtool libraries:
Makefile.am builds only programs. With libtool installed, automake just
wraps the final link in ./libtool --mode=link, which adds nothing for a
plain executable. Without libtool's m4 macros, autoreconf succeeds, LT_INIT
stays as a literal line in configure, and configure prints
"LT_INIT: command not found" but still exits 0.

Remove LT_INIT and drop libtool from the RPM BuildRequires, the Alpine
Dockerfile, the macOS/Alpine CI jobs, the RPM release workflow, the local
RPM test script and DEVELOPMENT.md. The generated Makefile flags are
unchanged; config.h only loses HAVE_DLFCN_H and LT_OBJDIR, which nothing
uses. AC_CONFIG_MACRO_DIR([m4]) stays for ax_code_coverage.m4.

Fixes #640

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fcostaoliveira
fcostaoliveira merged commit 1962f68 into master Oct 17, 2026
129 checks passed
fcostaoliveira added a commit that referenced this pull request Oct 24, 2026
Resolve ci.yml (master's macOS lines plus cmake for the helper; libtool
stays removed, see #762), DEVELOPMENT.md (master's macOS sections, keep
the libevent section) and scripts/build-macos-libevent.sh (clean the
prefix as in #674, then build through scripts/build-libevent.sh with
debug mode disabled).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure.ac: LT_INIT is unused, and without libtool installed configure prints "LT_INIT: command not found" but continues

1 participant