public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/flyingsaucersattack] rawhide: Fix annocheck hardening failures: pass '%{build_ldflags}' to the linker
@ 2026-07-15 18:11 Michal Schorm
0 siblings, 0 replies; only message in thread
From: Michal Schorm @ 2026-07-15 18:11 UTC (permalink / raw)
To: git-commits
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'
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-15 18:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15 18:11 [rpms/flyingsaucersattack] rawhide: Fix annocheck hardening failures: pass '%{build_ldflags}' to the linker Michal Schorm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox