Control: tags -1 + patch
On Wed, 24 Dec 2025 at 14:24:08 +0000, Simon McVittie wrote:
As of December 2025, a similar build failure can be seen even without
explicitly enabling LTO. I encountered this while doing test-builds
with libsdl2-dev provided by src:sdl2-compat, but I can reproduce the
build failure without that change.
I suspect that the bug might be that -Wl,-fcf-protection is passed to
the linker. -fcf-protection is a compiler option, not a linker option,
so the linker interprets it as "-f cf-protection" or equivalently
"--auxiliary=cf-protection", which would only be valid when linking a
shared object.
Please consider the attached patches, which seem to make it build
successfully either with or without experimental's sdl2-compat.
I haven't tested the resulting binaries, because I don't know where I
would find software for MSX machines.
smcv
>From abc10a3bdb091c2704afaa4ea95228f9ee5a5087 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Wed, 24 Dec 2025 14:54:26 +0000
Subject: [PATCH 1/2] d/p/dpkg-buildflags.diff: Don't pass C options to the C++
compiler
This avoids a recurring compiler warning "cc1plus: warning: '-Werror='
argument '-Werror=implicit-function-declaration' is not valid for C++".
---
debian/patches/dpkg-buildflags.diff | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/patches/dpkg-buildflags.diff b/debian/patches/dpkg-buildflags.diff
index 00182a5..4c5fb70 100644
--- a/debian/patches/dpkg-buildflags.diff
+++ b/debian/patches/dpkg-buildflags.diff
@@ -12,7 +12,7 @@ Index: openmsx-20.0+dfsg/build/flavour-debian.mk
+ $(shell dpkg-buildflags --get LDFLAGS | sed -e 's/-Wl,//g')
+
+CXXFLAGS += \
-+ $(shell dpkg-buildflags --get CFLAGS | sed -e 's/ *-O[0-3] */ /') \
++ $(shell dpkg-buildflags --get CXXFLAGS | sed -e 's/ *-O[0-3] */ /') \
+ $(shell dpkg-buildflags --get CPPFLAGS) \
+ -DDEFAULT_FONT=\"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf\" \
+ -DDEFAULT_MONO_FONT=\"/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf\"
--
2.51.0
>From b4dab118e871807d9a5bcd01581e20e140fc2536 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Wed, 24 Dec 2025 14:54:28 +0000
Subject: [PATCH 2/2] debian/patches/dpkg-buildflags.diff: Pass Debian LDFLAGS
to gcc, not ld
Debian follows the Autotools/GNU convention that LDFLAGS are flags for
the compiler driver used for the link step, so the --foo flag for ld(1)
gets passed through via -Wl,--foo. openmsx's upstream build system uses
a different convention, where LINK_FLAGS are the equivalent of GNU
LDFLAGS, and instead LDFLAGS are flags to be used directly by ld(1).
Closes: #1015568
---
debian/patches/dpkg-buildflags.diff | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/debian/patches/dpkg-buildflags.diff b/debian/patches/dpkg-buildflags.diff
index 4c5fb70..d3df08e 100644
--- a/debian/patches/dpkg-buildflags.diff
+++ b/debian/patches/dpkg-buildflags.diff
@@ -7,8 +7,11 @@ Index: openmsx-20.0+dfsg/build/flavour-debian.mk
===================================================================
--- /dev/null
+++ openmsx-20.0+dfsg/build/flavour-debian.mk
-@@ -0,0 +1,27 @@
-+LDFLAGS += \
+@@ -0,0 +1,30 @@
++# Note that in Autotools/GNU and Debian conventions, LDFLAGS are flags
++# for the compiler driver, but in openmsx's build system, LINK_FLAGS
++# take that role.
++LINK_FLAGS += \
+ $(shell dpkg-buildflags --get LDFLAGS | sed -e 's/-Wl,//g')
+
+CXXFLAGS += \
--
2.51.0