public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Schorm <mschorm@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/flyingsaucersattack] rawhide: Fix annocheck hardening failures: pass '%{build_ldflags}' to the linker
Date: Wed, 15 Jul 2026 18:11:43 GMT	[thread overview]
Message-ID: <178413910348.1.10709009478345541968.rpms-flyingsaucersattack-0ee5d8ea1960@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/flyingsaucersattack
            Branch : rawhide
            Commit : 0ee5d8ea19601e431fea7194d1aa3dc15ffa0263
            Author : Michal Schorm <mschorm@redhat.com>
            Date   : 2026-07-15T00:44:45+02:00
            Stats  : +29/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/flyingsaucersattack/c/0ee5d8ea19601e431fea7194d1aa3dc15ffa0263?branch=rawhide

            Log:
            Fix annocheck hardening failures: pass '%{build_ldflags}' to the linker

The binary '/usr/bin/flyingsaucersattack' failed annocheck 'bind-now' and
'pie' tests because '%{build_ldflags}' (which provides '-Wl,-z,now' and
'-Wl,-pie') was not being passed to the linker.

The Makefile (created by the unixify patch) used 'LDFLAGS' for library
flags ('-ldumb', '-laldmb', etc.), preventing RPM build flags from being
passed via 'LDFLAGS' without overriding the required libraries.

Add 'flyingsaucersattack-1.20h-ldflags.patch' to separate library flags
into a new 'LIBS' variable and pass '%{build_ldflags}' via 'LDFLAGS' in
the spec.

Co-Authored-By: Claude AI <noreply@anthropic.com>

---
diff --git a/flyingsaucersattack-1.20h-ldflags.patch b/flyingsaucersattack-1.20h-ldflags.patch
new file mode 100644
index 0000000..ecdf852
--- /dev/null
+++ b/flyingsaucersattack-1.20h-ldflags.patch
@@ -0,0 +1,20 @@
+Separate library flags from LDFLAGS so that RPM build flags
+(including '-Wl,-z,now' and '-Wl,-pie') can be passed via LDFLAGS
+without overriding the required library linkage.
+
+diff -up fuga120h/sources/Makefile.ldflags fuga120h/sources/Makefile
+--- fuga120h/sources/Makefile.ldflags	2016-02-27 16:35:01.604551576 +0100
++++ fuga120h/sources/Makefile	2016-02-27 16:35:01.604551576 +0100
+@@ -3,10 +3,10 @@
+ DATADIR = $(PREFIX)/share/$(TARGET)
+ DEFINES = -DDATADIR=\"$(DATADIR)\"
+ CFLAGS  = -g -Wall -O2 -Wno-deprecated-declarations -Wno-deprecated -Wno-write-strings
+-LDFLAGS = -ldumb -laldmb `allegro-config --libs`
++LIBS = -ldumb -laldmb `allegro-config --libs`
+
+ $(TARGET): fugamain.cpp
+-	g++ $(LDFLAGS) $(CFLAGS) $(DEFINES) -o $@ $^
++	g++ $(LDFLAGS) $(CFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
+
+ install: $(TARGET)
+ 	mkdir -p $(DESTDIR)$(PREFIX)/bin

diff --git a/flyingsaucersattack.spec b/flyingsaucersattack.spec
index ba0eb9b..5faca8b 100644
--- a/flyingsaucersattack.spec
+++ b/flyingsaucersattack.spec
@@ -1,6 +1,6 @@
 Name:           flyingsaucersattack
 Version:        1.20h
-Release:        27%{?dist}
+Release:        28%{?dist}
 Summary:        Shoot down the attacking UFOs and to save the city
 # Engine is MIT, resources are CC-BY-SA-4.0
 License:        MIT AND CC-BY-SA-4.0
@@ -11,6 +11,7 @@ Source2:        %{name}.desktop
 Source3:        %{name}.appdata.xml
 # Note upstream is not interested in taking unix porting patches
 Patch0:         flyingsaucersattack-1.20h-unixify.patch
+Patch1:         flyingsaucersattack-1.20h-ldflags.patch
 BuildRequires:  gcc-c++
 BuildRequires:  allegro-devel dumb-devel desktop-file-utils libappstream-glib
 BuildRequires: make
@@ -33,6 +34,7 @@ in a game over.
 %prep
 %setup -q -n fuga120h
 %patch -P0 -p1 -b .unix
+%patch -P1 -p1 -b .ldflags
 for i in docs/*; do
   sed -i 's/\r//' $i;
 done
@@ -42,7 +44,8 @@ done
 # Note -Wno-format-security is to work around the custom translation system
 # All format strings passed to printf are actually const strings
 %make_build -C sources \
-  CFLAGS="$RPM_OPT_FLAGS -Wno-deprecated-declarations -Wno-deprecated -Wno-write-strings -Wno-unused-result -Wno-format-security"
+  CFLAGS="$RPM_OPT_FLAGS -Wno-deprecated-declarations -Wno-deprecated -Wno-write-strings -Wno-unused-result -Wno-format-security" \
+  LDFLAGS="%{build_ldflags}"
 
 
 %install
@@ -71,6 +74,10 @@ appstream-util validate-relax --nonet \
 
 
 %changelog
+* Wed Jul 15 2026 Michal Schorm <mschorm@redhat.com> - 1.20h-28
+- Fix annocheck hardening failures: pass '%{build_ldflags}' to the linker
+- Add 'flyingsaucersattack-1.20h-ldflags.patch' to separate library flags from 'LDFLAGS'
+
 * Tue Jul 14 2026 Michal Schorm <mschorm@redhat.com> - 1.20h-27
 - Fix SPDX license expression: 'MIT AND CC-BY-SA-4.0'
 

                 reply	other threads:[~2026-07-15 18:11 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=178413910348.1.10709009478345541968.rpms-flyingsaucersattack-0ee5d8ea1960@fedoraproject.org \
    --to=mschorm@redhat.com \
    --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