[pkg-apparmor] Bug#1057188: apparmor FTCBFS: invalid compiler flags during python extension build

Helmut Grohne helmut at subdivi.de
Fri Dec 1 07:23:50 GMT 2023


Source: apparmor
Version: 3.0.12-1
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs

apparmor fails to cross build from source in unstable. The same version
used to cross build, so the cause is some change in the wider Debian
ecosystem. The ultimate failure e.g. when cross building from amd64 is
that the compiler fails to understand the flag -fcf-protection. This is
no surprise, given that this flag is amd64-specific and has no business
for other architectures. Evidently, apparmor was confusing build flags
and host flags all the time, but this never was a problem until now. So
now we tell the python build about the right sysconfigdata, the build
uses the host flags and works again. Consider applying the attached
patch.

Helmut
-------------- next part --------------
diff --minimal -Nru apparmor-3.0.12/debian/changelog apparmor-3.0.12/debian/changelog
--- apparmor-3.0.12/debian/changelog	2023-07-16 16:39:37.000000000 +0200
+++ apparmor-3.0.12/debian/changelog	2023-12-01 08:13:35.000000000 +0100
@@ -1,3 +1,11 @@
+apparmor (3.0.12-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Fix confusion of compiler flags for python extension.
+    (Closes: #-1)
+
+ -- Helmut Grohne <helmut at subdivi.de>  Fri, 01 Dec 2023 08:13:35 +0100
+
 apparmor (3.0.12-1) unstable; urgency=medium
 
   * New upstream releases: 3.0.9, 3.0.10, 3.0.11, and 3.0.12
diff --minimal -Nru apparmor-3.0.12/debian/rules apparmor-3.0.12/debian/rules
--- apparmor-3.0.12/debian/rules	2023-07-16 16:39:37.000000000 +0200
+++ apparmor-3.0.12/debian/rules	2023-12-01 08:13:32.000000000 +0100
@@ -1,15 +1,17 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/pkg-info.mk
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow optimize=+lto
 
-export DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-
 export PERL_VENDORARCH := $(shell perl -MConfig -e 'print substr($$Config{vendorarch},1)' )
 export PYTHON=/usr/bin/python3
 export PYTHON_VERSION=3
 export PYTHON_VERSIONS=python3
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)
+endif
 
 %:
 	dh $@ --with=python3,apache2


More information about the pkg-apparmor-team mailing list