aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2024-02-25 03:22:08 +0100
committerMartin Mares <mj@ucw.cz>2024-04-05 13:13:58 +0200
commita34006f8e9c1f80e1446d1007bfff3ffefef4d23 (patch)
tree42f57977d3f45ca03a821b6def5d835e19645be3
parent34092dd9262f4f204e7b2043b0a1faeb3b4157bd (diff)
downloadpciutils-a34006f8e9c1f80e1446d1007bfff3ffefef4d23.tar.gz
Makefile: Pass CFLAGS also when linking executable
Optimization flags like -O2 from $(OPT) passed via $(CFLAGS) used during compiling individual object files are ignored when gcc's LTO is enabled for the linking final executable. Optimization flags used for compiling individual object files should be same as optimization flags for linking final executable. Fix propagation of $(CFLAGS) and $(OPT) when LTO is enabled.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index aaec04e..37333c1 100644
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@ pcilmr$(EXEEXT): pcilmr.o $(LMROBJS) $(COMMON) lib/$(PCIIMPLIB)
pcilmr.o: pcilmr.c $(LMRINC)
%$(EXEEXT): %.o
- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
ifdef PCI_OS_WINDOWS
comma := ,