🚀 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 Fri, 09 Oct 2026 10:10
Bug#1150410: pyfftw: d/p/hardening passes LDFLAGS as a single argument, breaking multi-flag LDFLAGS
#233
Author: 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==--
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