public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gprolog] f44: Fix FTBFS on ix86: pass -Wl,-z,notext via LDFLAGS, not --with-c-flags
@ 2026-07-03  6:31 Till Hofmann
  0 siblings, 0 replies; only message in thread
From: Till Hofmann @ 2026-07-03  6:31 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gprolog
            Branch : f44
            Commit : be5000b73fb13026c2aed710cc90abebe52d1c24
            Author : Till Hofmann <thofmann@fedoraproject.org>
            Date   : 2026-07-02T23:51:30+02:00
            Stats  : +13/-3 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/gprolog/c/be5000b73fb13026c2aed710cc90abebe52d1c24?branch=f44

            Log:
            Fix FTBFS on ix86: pass -Wl,-z,notext via LDFLAGS, not --with-c-flags

The --disable-regs build on ix86 keeps WAM registers in .text via
non-PIC-style relocations, which conflicts with the linker's default
text-relocation hardening (-z now/-z relro), causing:

  /usr/bin/ld.bfd: error: read-only segment has dynamic relocations

-Wl,-z,notext needs to end up in LDFLAGS, which gplc uses at link
time; --with-c-flags only sets CFLAGS, used for compiling .c to .o.

Resolves rhbz#2434633.

---
diff --git a/gprolog.spec b/gprolog.spec
index 8ed8fd3..1dc30b9 100644
--- a/gprolog.spec
+++ b/gprolog.spec
@@ -67,14 +67,24 @@ cd src
 
 # `-std=gnu17` is required as GCC 15 defaults to C23, which is not yet supported.
 # See also https://gcc.gnu.org/gcc-15/porting_to.html#c23.
+%ifarch %{ix86}
+# ix86's --disable-regs build keeps WAM registers in .text via non-PIC-style
+# relocations; -Wl,-z,notext permits the resulting text relocations. This
+# must go in LDFLAGS (used by gplc at link time), not --with-c-flags (only
+# used to compile .c to .o).
+# See https://bugzilla.redhat.com/show_bug.cgi?id=2434633
+export LDFLAGS="$LDFLAGS -Wl,-z,notext"
+%define _pkg_disable_regs --disable-regs
+%else
+%define _pkg_disable_regs %{nil}
+%endif
+
 %configure \
       --with-install-dir=$RPM_BUILD_ROOT%{_libdir}/gprolog-%{version} \
       --without-links-dir --without-examples-dir \
       --with-doc-dir=dist-doc \
       --with-c-flags="$RPM_OPT_FLAGS -std=gnu17" \
-%ifarch %{ix86}
-      --disable-regs
-%endif
+      %{_pkg_disable_regs}
 
 # Remove package notes flag from LDFLAGS
 # See https://bugzilla.redhat.com/show_bug.cgi?id=2051341

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-03  6:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-03  6:31 [rpms/gprolog] f44: Fix FTBFS on ix86: pass -Wl,-z,notext via LDFLAGS, not --with-c-flags Till Hofmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox