🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #664

Bug#1150744: libapache2-mod-ldap-userdir: FTBFS with LTO enabled: bare -flto LDFLAGS passed to apxs

#664
From: 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==--
Technical Details
Message-ID: <NNEXM-5dY7-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Sebastien Bacher <seb128@ubuntu.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150744: libapache2-mod-ldap-userdir: FTBFS with LTO enabled: bare -flto LDFLAGS passed to apxs
Date: Tue, 13 Oct 2026 09:20:02 +0200
Message-ID: <NNEXM-5dY7-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Oct 13 07:13:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Sebastien Bacher <seb128@ubuntu.com>, 1150744@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: seb128@ubuntu.com, jwm@horde.net
X-Debian-Pr-Message: report 1150744
X-Debian-Pr-Package: src:libapache2-mod-ldap-userdir
X-Debian-Pr-Keywords: ftbfs patch
X-Debian-Pr-Source: libapache2-mod-ldap-userdir
Content-Type: multipart/mixed; boundary="===============0269921874025154756=="
MIME-Version: 1.0
X-Mailer: reportbug 13.2.0+ubuntu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1996508
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 97
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 13 Oct 2026 09:10:58 +0200
X-Original-Message-ID: <179187545836.185665.6877574864154341301.reportbug@seb128-ThinkPad-T16>