🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Sebastien Bacher Tue, 13 Oct 2026 07:20
Bug#1150744: libapache2-mod-ldap-userdir: FTBFS with LTO enabled: bare -flto LDFLAGS passed to apxs
#664
Author: Sebastien Bacher
Date: Tue, 13 Oct 2026 07:20
97 lines
5098 bytes
This is a multi-part MIME message sent by reportbug.


--===============0269921874025154756==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Source: libapache2-mod-ldap-userdir
Version: 1.1.19-2.2
Severity: normal
Tags: patch ftbfs
X-Debbugs-Cc: seb128@ubuntu.com
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu stonking

Hi,

libapache2-mod-ldap-userdir fails to build when LTO is enabled in the
default build flags (e.g. DEB_BUILD_MAINT_OPTIONS=optimize=+lto). Ubuntu
enables LTO by default on most architectures, so we hit it there:

  apxs -c -Wdate-time -D_FORTIFY_SOURCE=3 -Wl,-Bsymbolic-functions ... \
       -flto=auto -ffat-lto-objects -Wl,-z,relro ... mod_ldap_userdir.c
  apxs:Error: Unknown option: f.
  apxs:Error: Unknown option: t.
  apxs:Error: Unknown option: -.
  make[2]: *** [Makefile:10: .libs/mod_ldap_userdir.so] Error 1

Ubuntu build log:
https://launchpad.net/ubuntu/+source/libapache2-mod-ldap-userdir/1.1.19-2.2/+build/32793477

Makefile.in passes the build flags directly to apxs:

  $(APXS) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS) $(TLS) mod_ldap_userdir.c

apxs only accepts compiler/linker flags wrapped as -Wc,... or -Wl,....
The -Wl,-prefixed parts of LDFLAGS work, but bare flags such as
-flto=auto and -ffat-lto-objects are parsed by apxs as unknown options.

Since 1.1.19-2.2 switched to a plain dh sequence (#989941),
dh_auto_configure passes the full LDFLAGS to configure, so any LTO flags
in LDFLAGS now break the build. It builds in Debian today only because
Debian does not enable LTO by default.

Upstream (https://github.com/jwm/mod_ldap_userdir) has had no commits
since the 1.1.19 release in 2012, so I'm reporting it here rather than
upstream.

The minimal fix is to disable LTO for this package (debian-rules.diff,
attached):

  -export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-branch
  +export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-branch optimize=-lto

A more thorough fix would be to patch Makefile.in so that flags apxs does
not understand natively are passed in -Wc,/-Wl, form, or to filter
LDFLAGS so that only -L/-l/-Wl, entries reach apxs directly.

Note: the diff has not been test-built yet.

Thanks,


-- System Information:
Debian Release: forky/sid
  APT prefers resolute-updates
  APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 'resolute'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 7.0.0-38-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

--===============0269921874025154756==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="debian-rules.diff"

--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-branch
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-branch optimize=-lto
 
 %:
 	dh $@ --with apache2

--===============0269921874025154756==--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads