Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668498 > unrolled thread

[PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS

Started bySeongJae Park <sj38.park@gmail.com>
First post2017-06-18 03:00 +0200
Last post2017-06-18 03:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS SeongJae Park <sj38.park@gmail.com> - 2017-06-18 03:00 +0200

#1668498 — [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS

FromSeongJae Park <sj38.park@gmail.com>
Date2017-06-18 03:00 +0200
Subject[PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS
Message-ID<tTwJj-6yj-7@gated-at.bofh.it>
Build of aperf fails as below:
```
gcc  -Wall -D_GNU_SOURCE   -lm  aperf.c  -o /tools/testing/selftests/intel_pstate/aperf
/tmp/ccKf3GF6.o: In function `main':
aperf.c:(.text+0x278): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
```

The faulure occurs because -lm was defined as LDFLAGS and implicit rule
of make places LDFLAGS before source file.  This commit fixes the
problem by using LDLIBS instead of LDFLAGS.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 tools/testing/selftests/intel_pstate/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index 19678e90efb2..849a90ffe8dd 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -1,5 +1,5 @@
 CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
-LDFLAGS := $(LDFLAGS) -lm
+LDLIBS := $(LDLIBS) -lm
 
 TEST_GEN_FILES := msr aperf
 
-- 
2.13.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web