public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Till Hofmann <thofmann@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/gprolog] rawhide: Fix FTBFS on ix86: pass -Wl,-z,notext via LDFLAGS, not --with-c-flags
Date: Fri, 03 Jul 2026 06:20:38 GMT	[thread overview]
Message-ID: <178305963887.1.1673872694651225089.rpms-gprolog-be5000b73fb1@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gprolog
            Branch : rawhide
            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=rawhide

            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

                 reply	other threads:[~2026-07-03  6:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178305963887.1.1673872694651225089.rpms-gprolog-be5000b73fb1@fedoraproject.org \
    --to=thofmann@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox