Skip to content

Commit

Permalink
Merge branch 'build-deps'
Browse files Browse the repository at this point in the history
* build-deps:
  Fix Arch build on conflicting _FORTIFY_SOURCE values
  rpm: cleanup build dependencies
  • Loading branch information
marmarek committed Jul 19, 2024
2 parents e4266f1 + 481b198 commit 8cc1f5a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
40 changes: 40 additions & 0 deletions 0653-python-avoid-conflicting-_FORTIFY_SOURCE-values.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 5e9e49c4f0ed9c54b63bf99d7b6a013005f94865 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<[email protected]>
Date: Fri, 19 Jul 2024 01:15:13 +0200
Subject: [PATCH] python: avoid conflicting _FORTIFY_SOURCE values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The compile flags are combined from python's build config (sysconfig
module) and CFLAGS environment. If both define the _FORTIFY_SOURCE but
to different values, the build will fail. This is the case on Arch,
where Python's sysconfig has -D_FORTIFY_SOURCE=2, while Arch's
makepkg.conf has -D_FORTIFY_SOURCE=3. Resolve the config by undefining
_FORTIFY_SOURCE first, and use the value from the CFLAGS environment.
Details:
https://setuptools.pypa.io/en/latest/userguide/ext_modules.html

Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
tools/python/setup.py | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/python/setup.py b/tools/python/setup.py
index 02354f698653..a73c95a9e766 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -20,6 +20,9 @@ PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl"
PATH_LIBXENGUEST = XEN_ROOT + "/tools/libs/guest"
PATH_XENSTORE = XEN_ROOT + "/tools/libs/store"

+if "-D_FORTIFY_SOURCE=" in os.environ.get("CFLAGS", ""):
+ os.environ["CFLAGS"] = "-Wp,-U_FORTIFY_SOURCE " + os.environ["CFLAGS"]
+
xc = Extension("xc",
extra_compile_args = extra_compile_args,
include_dirs = [ PATH_XEN,
--
2.45.2

1 change: 1 addition & 0 deletions archlinux/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ makedepends=(wget make gcc patch git iasl pkg-config openssl pixman python-setup
provides=('xen-qubes-vm-essentials')

_patches=(
0653-python-avoid-conflicting-_FORTIFY_SOURCE-values.patch
1000-Do-not-access-network-during-the-build.patch
1001-hotplug-store-block-params-for-cleanup.patch
1020-xen-tools-qubes-vm.patch
Expand Down
11 changes: 3 additions & 8 deletions xen.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ Patch0643: 0643-cpufreq-enable-HWP-by-default.patch
PAtch0651: 0651-x86-msi-passthrough-all-MSI-X-vector-ctrl-writes-to-.patch
PAtch0652: 0652-x86-hvm-Allow-writes-to-registers-on-the-same-page-a.patch

Patch0653: 0653-python-avoid-conflicting-_FORTIFY_SOURCE-values.patch

# S0ix support
Patch0670: 0670-x86-hpet-Disable-legacy-replacement-mode-after-test-.patch
Patch0671: 0671-x86-idle-Get-PC-8.10-counters-for-Tiger-and-Alder-La.patch
Expand Down Expand Up @@ -208,19 +210,12 @@ BuildRequires: dev86
%endif
BuildRequires: python%{python3_pkgversion}-devel ncurses-devel python%{python3_pkgversion}-setuptools
BuildRequires: perl-interpreter perl-generators
%ifarch %{ix86} x86_64
# so that x86_64 builds pick up glibc32 correctly
BuildRequires: /usr/include/gnu/stubs-32.h
%endif
# BEGIN QUBES SPECIFIC PART
BuildRequires: autoconf
BuildRequires: automake
# END QUBES SPECIFIC PART
BuildRequires: gettext
BuildRequires: gnutls-devel
BuildRequires: openssl-devel
# For ioemu PCI passthrough
BuildRequires: pciutils-devel
BuildRequires: zlib-devel
# Several tools now use uuid
BuildRequires: libuuid-devel
# iasl needed to build hvmloader
Expand Down

0 comments on commit 8cc1f5a

Please sign in to comment.