x11-terms/ptyxis: fix build with gcc-16 and lto

See-also: https://gitlab.gnome.org/chergert/ptyxis/-/issues/504
Closes: https://bugs.gentoo.org/966109
Signed-off-by: Lukas Schmelting <lschmelting@posteo.com>
Part-of: https://github.com/gentoo/gentoo/pull/44768
Closes: https://github.com/gentoo/gentoo/pull/44768
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Lukas Schmelting 2025-11-24 23:15:28 +01:00 committed by Sam James
parent b26113ad39
commit 5bb9d01763
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,61 @@
From 64affa1242283923b24a1b3d683e8438a1585c6d Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Mon, 17 Nov 2025 15:12:46 -0800
Subject: [PATCH] build: make libc-compat builds optional
---
agent/meson.build | 2 ++
meson_options.txt | 5 +++++
org.gnome.Ptyxis.Devel.json | 3 ++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/agent/meson.build b/agent/meson.build
index 147c70b..bd0b928 100644
--- a/agent/meson.build
+++ b/agent/meson.build
@@ -45,6 +45,7 @@ ptyxis_agent_c_args = [
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(PTYXIS_AGENT_MIN_GLIB_MAJOR, PTYXIS_AGENT_MIN_GLIB_MINOR),
]
+if get_option('libc-compat')
libc_compat = true
if target_machine.cpu_family() == 'x86_64'
ptyxis_agent_c_args += ['-include', 'x86_64/force_link_glibc_2.17.h']
@@ -56,6 +57,7 @@ if libc_compat
config_h.set10('LIBC_COMPAT', libc_compat)
ptyxis_agent_link_args += ['-Wl,--wrap=__libc_start_main']
endif
+endif
executable('ptyxis-agent', ptyxis_agent_sources,
dependencies: ptyxis_agent_deps,
diff --git a/meson_options.txt b/meson_options.txt
index ec7f85c..a2d918e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,3 +5,8 @@ option('generic', type: 'combo', value: 'ptyxis',
option('app-id', type: 'string', value: '', description: 'An alternate app-id to use for the application')
option('gschema-id', type: 'string', value: '', description: 'An alternative gschema identifier prefix')
option('gschema-path', type: 'string', value: '', description: 'An alternative gschema path to use')
+
+# Building with libc-compat is generally just useful when building the Flatpak
+# since that is where we will want to build a binary that can run on the host
+# outside of the Flatpak container.
+option('libc-compat', type: 'boolean', value: false, description: 'Try to build the agent with old glibc symbols for running on older hosts')
diff --git a/org.gnome.Ptyxis.Devel.json b/org.gnome.Ptyxis.Devel.json
index 9350c88..ae53aaf 100644
--- a/org.gnome.Ptyxis.Devel.json
+++ b/org.gnome.Ptyxis.Devel.json
@@ -100,7 +100,8 @@
"builddir" : true,
"buildsystem" : "meson",
"config-opts" : [
- "-Ddevelopment=true"
+ "-Ddevelopment=true",
+ "-Dlibc-compat=true"
],
"sources" : [
{
--
GitLab

View File

@ -35,6 +35,10 @@ BDEPEND="
)
"
PATCHES=(
"${FILESDIR}/make-libc-compat-builds-optional.patch"
)
src_configure() {
use X || append-cppflags -DGENTOO_GTK_HIDE_X11

View File

@ -35,6 +35,10 @@ BDEPEND="
)
"
PATCHES=(
"${FILESDIR}/make-libc-compat-builds-optional.patch"
)
src_configure() {
use X || append-cflags -DGENTOO_GTK_HIDE_X11
local emesonargs=(