From: Florian Fainelli <florian.fainelli@broadcom.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
Thomas Renninger <trenn@suse.com>, Shuah Khan <shuah@kernel.org>,
"John B. Wyatt IV" <jwyatt@redhat.com>,
John Kacur <jkacur@redhat.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v2 2/2] pm: cpupower: Makefile: Allow overriding cross-compiling env params
Date: Wed, 20 Nov 2024 20:41:56 -0800 [thread overview]
Message-ID: <48c0adb5-4ae8-48bc-8e83-3d1c413f6861@broadcom.com> (raw)
In-Reply-To: <20240919-pm-v2-2-0f25686556b5@nxp.com>
Hi Peng,
On 9/19/2024 5:08 AM, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Allow overriding the cross-comple env parameters to make it
> easier for Yocto users. Then cross-compiler toolchains to build
> cpupower with only two steps:
> - source (toolchain path)/environment-setup-armv8a-poky-linux
> - make
This patch breaks the way that buildroot builds cpupower:
https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in
and after enabling verbose it becomes clear as to why, see below:
>>> linux-tools Configuring
>>> linux-tools Building
GIT_DIR=.
PATH="/local/users/fainelli/buildroot-upstream/output/arm/host/bin:/local/users/fainelli/buildroot-upstream/output/arm/host/sbin:/projects/firepath/tools/bin:/home/ff944844/bin:/home/ff944844/.local/bin:/opt/stblinux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/toolchains/metaware-vctools-0.4.1/bin/"
/usr/bin/make -j97
CROSS=/local/users/fainelli/buildroot-upstream/output/arm/host/bin/arm-linux-
CPUFREQ_BENCH=false NLS=false LDFLAGS="-L.
-L/local/users/fainelli/buildroot-upstream/output/arm/target/usr/lib"
DEBUG=false V=1 -C
/local/users/fainelli/buildroot-upstream/output/arm/build/linux-custom/tools
cpupower
mkdir -p power/cpupower && /usr/bin/make subdir=power/cpupower
--no-print-directory -C power/cpupower
cc -DVERSION=\"6.12.0\" -DPACKAGE=\"cpupower\"
-DPACKAGE_BUGREPORT=\"linux-pm@vger.kernel.org\" -D_GNU_SOURCE -pipe
-Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare -Wno-pointer-sign
-Wdeclaration-after-statement -Wshadow -Os -fomit-frame-pointer -fPIC -o
lib/cpufreq.o -c lib/cpufreq.c
Here we use cc, aka host compiler, rather than $(CROSS)gcc as we should,
so we are no longer cross compiling at all.
The issue is the use of the lazy set if absent for *all* of CC, LD, AR,
STRIP, RANLIB, rather than just for CROSS. The following fixes it for me:
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 175004ce44b2..96bb1e5f3970 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -87,11 +87,11 @@ INSTALL_SCRIPT = ${INSTALL} -m 644
# to something more interesting, like "arm-linux-". If you want
# to compile vs uClibc, that can be done here as well.
CROSS ?= #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
-CC ?= $(CROSS)gcc
-LD ?= $(CROSS)gcc
-AR ?= $(CROSS)ar
-STRIP ?= $(CROSS)strip
-RANLIB ?= $(CROSS)ranlib
+CC = $(CROSS)gcc
+LD = $(CROSS)gcc
+AR = $(CROSS)ar
+STRIP = $(CROSS)strip
+RANLIB = $(CROSS)ranlib
HOSTCC = gcc
MKDIR = mkdir
--
Florian
next prev parent reply other threads:[~2024-11-21 4:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 12:08 [PATCH v2 0/2] tools: power: cpupower: Allow overriding cross-compiling envs Peng Fan (OSS)
2024-09-19 12:08 ` [PATCH v2 1/2] pm: cpupower: bench: print config file path when open cpufreq-bench.conf fails Peng Fan (OSS)
2024-09-19 12:08 ` [PATCH v2 2/2] pm: cpupower: Makefile: Allow overriding cross-compiling env params Peng Fan (OSS)
2024-11-21 4:41 ` Florian Fainelli [this message]
2024-11-21 12:40 ` Peng Fan
2024-11-21 17:02 ` Florian Fainelli
2024-11-22 0:13 ` Peng Fan
2024-11-22 17:34 ` Florian Fainelli
2024-11-29 0:38 ` Peng Fan
2024-09-19 16:38 ` [PATCH v2 0/2] tools: power: cpupower: Allow overriding cross-compiling envs John B. Wyatt IV
2024-09-20 8:58 ` Peng Fan
2024-09-20 9:01 ` Peng Fan
2024-09-20 12:41 ` John B. Wyatt IV
2024-09-20 12:44 ` John B. Wyatt IV
2024-09-23 6:26 ` Peng Fan
2024-09-30 15:52 ` 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=48c0adb5-4ae8-48bc-8e83-3d1c413f6861@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=jkacur@redhat.com \
--cc=jwyatt@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®