Blame SOURCES/0004-checkpolicy-pass-CFLAGS-at-link-stage.patch

83845a
From 40e2f98519ba3fc6a4a0f2b4a2b8b0e1d864fd9e Mon Sep 17 00:00:00 2001
83845a
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
83845a
Date: Tue, 6 Jul 2021 19:54:21 +0200
83845a
Subject: [PATCH] checkpolicy: pass CFLAGS at link stage
83845a
MIME-Version: 1.0
83845a
Content-Type: text/plain; charset=UTF-8
83845a
Content-Transfer-Encoding: 8bit
83845a
83845a
Pass CFLAGS when invoking CC at link time, it might contain optimization
83845a
or sanitizer flags required for linking.
83845a
83845a
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
83845a
---
83845a
 checkpolicy/Makefile      | 4 ++--
83845a
 checkpolicy/test/Makefile | 4 ++--
83845a
 2 files changed, 4 insertions(+), 4 deletions(-)
83845a
83845a
diff --git a/checkpolicy/Makefile b/checkpolicy/Makefile
83845a
index 0d282ef93d14..be63c0182682 100644
83845a
--- a/checkpolicy/Makefile
83845a
+++ b/checkpolicy/Makefile
83845a
@@ -30,10 +30,10 @@ all:  $(TARGETS)
83845a
 	$(MAKE) -C test
83845a
 
83845a
 checkpolicy: $(CHECKPOLOBJS) $(LIBSEPOLA)
83845a
-	$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
83845a
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
83845a
 
83845a
 checkmodule: $(CHECKMODOBJS) $(LIBSEPOLA)
83845a
-	$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
83845a
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
83845a
 
83845a
 %.o: %.c 
83845a
 	$(CC) $(CFLAGS) -o $@ -c $<
83845a
diff --git a/checkpolicy/test/Makefile b/checkpolicy/test/Makefile
83845a
index 89e7557c7aa6..e2a332b5a079 100644
83845a
--- a/checkpolicy/test/Makefile
83845a
+++ b/checkpolicy/test/Makefile
83845a
@@ -13,10 +13,10 @@ endif
83845a
 all: dispol dismod
83845a
 
83845a
 dispol: dispol.o $(LIBSEPOLA)
83845a
-	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
83845a
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
83845a
 
83845a
 dismod: dismod.o $(LIBSEPOLA)
83845a
-	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
83845a
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
83845a
 
83845a
 clean:
83845a
 	-rm -f dispol dismod *.o 
83845a
-- 
83845a
2.32.0
83845a