🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Bug#1150410: pyfftw: d/p/hardening passes LDFLAGS as a single argument, breaking multi-flag LDFLAGS

#233
From: Sebastien Bacher
Date: Fri, 09 Oct 2026 10:10
99 lines
5257 bytes
This is a multi-part MIME message sent by reportbug.


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

Source: pyfftw
Version: 0.15.0-1.1
Severity: normal
Tags: patch
X-Debbugs-Cc: seb128@ubuntu.com

Hi,

debian/patches/hardening passes LDFLAGS to the feature-detection link
checks in setup.py as a single argument:

  self.linker_flags = [os.environ.get("LDFLAGS")]

With Debian's default LDFLAGS ("-Wl,-z,relro") that happens to work,
because it is a single flag. As soon as LDFLAGS contains more than one
flag, the linker gets them as one bogus option, every check fails, and
the build stops with a misleading error. In Ubuntu:

  ld.bfd: unrecognized option '-Bsymbolic-functions -Wl'
  collect2: error: ld returned 1 exit status
  error: Could not find the FFTW header 'fftw3.h'

The same would happen in Debian with any extra flag in LDFLAGS (for
example DEB_LDFLAGS_MAINT_APPEND or a local hardening setting). When
LDFLAGS is unset it also passes None to the linker call.

The attached updated patch splits the variable with shlex:

  self.linker_flags = shlex.split(os.environ.get("LDFLAGS", ""))

With it, pyfftw builds in Ubuntu and the test suite passes (1720 passed,
86 skipped), with single, double and long double support detected. With
Debian's LDFLAGS the behaviour is unchanged.

Regards,
Sebastien


-- 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

--===============6874764464206105764==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="hardening.patch"

From: Michael R. Crusoe <crusoe@debian.org>
Subject: respect LDFLAGS
Description: Pass LDFLAGS to the feature-detection link checks
 Split LDFLAGS into separate arguments with shlex. Passing the whole
 string as one argument breaks as soon as LDFLAGS has more than one
 flag (e.g. Ubuntu's "-Wl,-Bsymbolic-functions ... -Wl,-z,relro"): the
 linker rejects it, every check fails and the build stops with
 "Could not find the FFTW header 'fftw3.h'". It also passed None when
 LDFLAGS was unset.
Last-Update: 2026-10-09
Index: pyfftw-0.15.0/setup.py
===================================================================
--- pyfftw-0.15.0.orig/setup.py
+++ pyfftw-0.15.0/setup.py
@@ -47,6 +47,7 @@ from sysconfig import get_platform
 
 from contextlib import redirect_stderr, redirect_stdout
 import os
+import shlex
 import logging
 import platform
 import sys
@@ -172,7 +173,7 @@ class EnvironmentSniffer(object):
         self.objects = []
         self.libraries = []
         self.library_dirs = get_library_dirs()
-        self.linker_flags = []
+        self.linker_flags = shlex.split(os.environ.get("LDFLAGS", ""))
         self.compile_time_env = {}
 
         if self.compiler.compiler_type == 'msvc':

--===============6874764464206105764==--
Technical Details
Message-ID: <NMfI5-4rs6-13@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!fu-berlin.de!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!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Sebastien Bacher <seb128@ubuntu.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150410: pyfftw: d/p/hardening passes LDFLAGS as a single argument, breaking multi-flag LDFLAGS
Date: Fri, 09 Oct 2026 12:10:01 +0200
Message-ID: <NMfI5-4rs6-13@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Oct  9 10:09: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>, 1150410@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: seb128@ubuntu.com, debian-science-maintainers@lists.alioth.debian.org
X-Debian-Pr-Message: report 1150410
X-Debian-Pr-Package: src:pyfftw
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: pyfftw
Content-Type: multipart/mixed; boundary="===============6874764464206105764=="
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/1995863
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 99
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 09 Oct 2026 12:06:11 +0200
X-Original-Message-ID: <179154037174.414113.5715741080099477127.reportbug@seb128-ThinkPad-T16>