diff options
author | Pali Rohár <pali@kernel.org> | 2024-02-25 03:22:08 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2024-04-05 13:13:58 +0200 |
commit | a34006f8e9c1f80e1446d1007bfff3ffefef4d23 (patch) | |
tree | 42f57977d3f45ca03a821b6def5d835e19645be3 | |
parent | 34092dd9262f4f204e7b2043b0a1faeb3b4157bd (diff) | |
download | pciutils-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-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 := , |