All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Roman Storozhenko <romeusmeister@gmail.com>,
	Thomas Renninger <trenn@suse.com>, Shuah Khan <shuah@kernel.org>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] cpupower: fix lib default installation path
Date: Fri, 28 Jun 2024 14:44:04 -0600	[thread overview]
Message-ID: <cfee36c5-c5d9-49db-bc94-c6e5fdb77840@linuxfoundation.org> (raw)
In-Reply-To: <20240623-fix-lib-install-v1-1-bcbd03b78d87@gmail.com>

On 6/23/24 07:10, Roman Storozhenko wrote:
> Invocation the tool built with the default settings fails:
> $ cpupower
> cpupower: error while loading shared libraries: libcpupower.so.1: cannot
> open shared object file: No such file or directory> The issue is that Makefile puts the library to "/usr/lib64" dir for a 64
> bit machine. This is wrong. According to the "File hierarchy standard
> specification:
> https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
> https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
> 
> "/usr/lib<qual>" dirs are intended for alternative-format libraries
> (e.g., "/usr/lib32" for 32-bit libraries on a 64-bit machine (optional)).
> 
> The utility is built for the current machine and doesn't change bit
> depth.
> Fix the issue by changing library destination dir to "/usr/lib".
> 
> Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
> ---
>   tools/power/cpupower/Makefile | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
> index cd0225a312b4..6c02f401069e 100644
> --- a/tools/power/cpupower/Makefile
> +++ b/tools/power/cpupower/Makefile
> @@ -67,6 +67,7 @@ LANGUAGES = 			de fr it cs pt ka
>   bindir ?=	/usr/bin
>   sbindir ?=	/usr/sbin
>   mandir ?=	/usr/man
> +libdir ?=	/usr/lib
>   includedir ?=	/usr/include
>   localedir ?=	/usr/share/locale
>   docdir ?=       /usr/share/doc/packages/cpupower
> @@ -94,15 +95,6 @@ RANLIB = $(CROSS)ranlib
>   HOSTCC = gcc
>   MKDIR = mkdir

These are set when make invoked from the kernel main
Makefile - see "make tools" option in main Makefile
>   
> -# 64bit library detection
> -include ../../scripts/Makefile.arch

This does the 64-librray detection based on arch.
> -
> -ifeq ($(IS_64_BIT), 1)
> -libdir ?=	/usr/lib64
> -else
> -libdir ?=	/usr/lib
> -endif
> -
>   # Now we set up the build system
>   #
>   
> 
> ---
> base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7
> change-id: 20240623-fix-lib-install-3b7dccdbdf45
> 
> Best regards,

What happens if you cross-compile with this patch? Take a look at this
commit that fixed cross-compile:

a73f6e2fbe8077811ea9546e0d44a7533111f0ba

This makefile has to be in sync with the rest of the tools - see
"make tools" in the kernel main Makefile.

thanks,
-- Shuah



  reply	other threads:[~2024-06-28 20:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23 13:10 [PATCH] cpupower: fix lib default installation path Roman Storozhenko
2024-06-28 20:44 ` Shuah Khan [this message]
2024-06-29 12:20   ` Roman Storozhenko
2024-07-01 19:36     ` Shuah Khan

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=cfee36c5-c5d9-49db-bc94-c6e5fdb77840@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=romeusmeister@gmail.com \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.