[PATCH 2/2] rt-tests: Handle -lcpupower flag outside LDFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tomas Glozar <tglozar@xxxxxxxxxx>

The rt-tests Makefile adds -lcpupower to LDFLAGS if libcpupower support
is detected on the system. However, this does not work when LDFLAGS is
overwritten by an external source.

Add separate variable LIBCPUPOWER to contain the flag and pass it to the
cyclictest linking phase. This also avoids unnecessarily passing the
flag to the linking of other rt-tests binaries which do not use
libcpupower.

Signed-off-by: Tomas Glozar <tglozar@xxxxxxxxxx>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f656e34..0fa0928 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ PYLIB ?= $(shell python3 -m get_pylib)
 ifneq ($(no_libcpupower), 1)
 ifeq ($(call test-feature,libcpupower), 0)
 CPPFLAGS += -DHAVE_LIBCPUPOWER_SUPPORT
-LDFLAGS += -lcpupower
+LIBCPUPOWER += -lcpupower
 else
 $(warning libcpupower is missing, building without --deepest-idle-state support.)
 $(warning Please install libcpupower-dev/kernel-tools-libs-devel)
@@ -135,7 +135,7 @@ $(OBJDIR):
 -include $(addprefix $(OBJDIR)/,$(sources:.c=.d))
 
 cyclictest: $(OBJDIR)/cyclictest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) $(LIBCPUPOWER)
 
 cyclicdeadline: $(OBJDIR)/cyclicdeadline.o $(OBJDIR)/librttest.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
-- 
2.47.0





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux