Linux Power Management development
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: linux-pm@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: [PATCH] tools/power/cpupower: Add 64 bit library detection
Date: Wed,  1 Nov 2017 20:48:17 -0400	[thread overview]
Message-ID: <20171102004817.20124-1-prarit@redhat.com> (raw)

The kernel-tools-lib rpm is installing the library to /usr/lib64, and not
/usr/lib as the cpupower Makefile is doing in the kernel tree.  This
resulted in a conflict between the two libraries.  After looking at how
other tools installed libraries, and looking at the perf code in
tools/perf it looks like installing to /usr/lib64 for 64-bit arches is the
correct thing to do.

Checks with 'ldd cpupower' on SLES, RHEL, Fedora, and Ubuntu result in
the correct binary AFAICT:

[root@testsystem cpupower]# ldd cpupower | grep cpupower
        libcpupower.so.0 => /lib64/libcpupower.so.0 (0x00007f1dab447000)

P.

----8<----

Commit ac5a181d065d ("cpupower: Add cpuidle parts into library") added a
new cpupower library version.  On Fedora, executing the cpupower binary then
resulted in this error

[root@testsystem cpupower]# ./cpupower monitor
./cpupower: symbol lookup error: ./cpupower: undefined symbol: get_cpu_topology

64-bit libraries should be installed to /usr/lib64, and other libraries
should be installed to /usr/lib.

This code was taken from the perf Makefile.config which supports /usr/lib and
/usr/lib64.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/power/cpupower/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index d6e1c02ddcfe..da205d1fa03c 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -30,6 +30,8 @@ OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 endif
 
+include ../../scripts/Makefile.arch
+
 # --- CONFIGURATION BEGIN ---
 
 # Set the following to `true' to make a unstripped, unoptimized
@@ -79,7 +81,11 @@ bindir ?=	/usr/bin
 sbindir ?=	/usr/sbin
 mandir ?=	/usr/man
 includedir ?=	/usr/include
+ifeq ($(IS_64_BIT), 1)
+libdir ?=	/usr/lib64
+else
 libdir ?=	/usr/lib
+endif
 localedir ?=	/usr/share/locale
 docdir ?=       /usr/share/doc/packages/cpupower
 confdir ?=      /etc/
-- 
2.15.0.rc0.39.g2f0e14e64

             reply	other threads:[~2017-11-02  0:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02  0:48 Prarit Bhargava [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-27 11:30 [PATCH] tools/power/cpupower: Add 64 bit library detection Prarit Bhargava
2016-09-27 11:38 ` Prarit Bhargava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102004817.20124-1-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=shuahkh@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox