public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pm: cpupower: Makefile: Fix cross compilation
@ 2024-11-21  4:43 Florian Fainelli
  2024-11-22 15:25 ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2024-11-21  4:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Thomas Renninger, Shuah Khan, John B. Wyatt IV,
	John Kacur, Peng Fan, open list:CPU POWER MONITORING SUBSYSTEM

After f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
cross-compiling env params") we would fail to cross compile cpupower in
buildroot which uses the recipe at [1] where only the CROSS variable is
being set.

The issue here is the use of the lazy evaluation for all variables: CC,
LD, AR, STRIP, RANLIB, rather than just CROSS.

[1]:
https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in

Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross-compiling env params")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Change-Id: Id98f2c648c82c08044b7281714bc6a8e921629ad
---
 tools/power/cpupower/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

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
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2024-11-21  4:43 Florian Fainelli
@ 2024-11-22 15:25 ` Shuah Khan
  2024-11-22 16:11   ` Florian Fainelli
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2024-11-22 15:25 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur,
	Peng Fan, open list:CPU POWER MONITORING SUBSYSTEM, Shuah Khan

On 11/20/24 21:43, Florian Fainelli wrote:
> After f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
> cross-compiling env params") we would fail to cross compile cpupower in
> buildroot which uses the recipe at [1] where only the CROSS variable is
> being set.
> 
> The issue here is the use of the lazy evaluation for all variables: CC,
> LD, AR, STRIP, RANLIB, rather than just CROSS.
> 
> [1]:
> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in
> 
> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross-compiling env params")
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Change-Id: Id98f2c648c82c08044b7281714bc6a8e921629ad
> ---
>   tools/power/cpupower/Makefile | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> 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
>   

Thank you for the patch. I will apply this once the merge window
closes.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2024-11-22 15:25 ` Shuah Khan
@ 2024-11-22 16:11   ` Florian Fainelli
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2024-11-22 16:11 UTC (permalink / raw)
  To: Shuah Khan, linux-kernel
  Cc: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur,
	Peng Fan, open list:CPU POWER MONITORING SUBSYSTEM



On 11/22/2024 7:25 AM, Shuah Khan wrote:
> On 11/20/24 21:43, Florian Fainelli wrote:
>> After f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
>> cross-compiling env params") we would fail to cross compile cpupower in
>> buildroot which uses the recipe at [1] where only the CROSS variable is
>> being set.
>>
>> The issue here is the use of the lazy evaluation for all variables: CC,
>> LD, AR, STRIP, RANLIB, rather than just CROSS.
>>
>> [1]:
>> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux- 
>> tool-cpupower.mk.in
>>
>> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross- 
>> compiling env params")
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> Change-Id: Id98f2c648c82c08044b7281714bc6a8e921629ad
>> ---
>>   tools/power/cpupower/Makefile | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> 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
> 
> Thank you for the patch. I will apply this once the merge window
> closes.

Thanks for taking a look, there is still an on-going discussion with 
Peng about how to best approach this, the discussion is here:

https://lore.kernel.org/all/PAXPR04MB84595BA5BEAE2D21F015036688232@PAXPR04MB8459.eurprd04.prod.outlook.com/

Let's wait until that settles before taking this patch, or Peng's.
-- 
Florian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] pm: cpupower: Makefile: Fix cross compilation
@ 2024-11-29  1:20 Peng Fan (OSS)
  2024-12-02 17:12 ` Florian Fainelli
  0 siblings, 1 reply; 8+ messages in thread
From: Peng Fan (OSS) @ 2024-11-29  1:20 UTC (permalink / raw)
  To: Thomas Renninger, Shuah Khan, John B. Wyatt IV, John Kacur,
	Peng Fan, open list:CPU POWER MONITORING SUBSYSTEM, open list
  Cc: Florian Fainelli

From: Peng Fan <peng.fan@nxp.com>

After commit f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
cross-compiling env params") we would fail to cross compile cpupower in
buildroot which uses the recipe at [1] where only the CROSS variable is
being set.

The issue here is the use of the lazy evaluation for all variables: CC,
LD, AR, STRIP, RANLIB, rather than just CROSS.

[1]:
https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in

Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross-compiling env params")
Reported-by: Florian Fainelli <florian.fainelli@broadcom.com>
Closes: https://lore.kernel.org/all/2bbabd2c-24ef-493c-a199-594e5dada3da@broadcom.com/
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 tools/power/cpupower/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 175004ce44b2..51a95239fe06 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -87,11 +87,19 @@ 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-
+ifneq ($(CROSS), )
+CC = $(CROSS)gcc
+LD = $(CROSS)gcc
+AR = $(CROSS)ar
+STRIP = $(CROSS)strip
+RANLIB = $(CROSS)ranlib
+else
 CC ?= $(CROSS)gcc
 LD ?= $(CROSS)gcc
 AR ?= $(CROSS)ar
 STRIP ?= $(CROSS)strip
 RANLIB ?= $(CROSS)ranlib
+endif
 HOSTCC = gcc
 MKDIR = mkdir
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2024-11-29  1:20 [PATCH] pm: cpupower: Makefile: Fix cross compilation Peng Fan (OSS)
@ 2024-12-02 17:12 ` Florian Fainelli
  2024-12-10  0:58   ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2024-12-02 17:12 UTC (permalink / raw)
  To: Peng Fan (OSS), Thomas Renninger, Shuah Khan, John B. Wyatt IV,
	John Kacur, Peng Fan, open list:CPU POWER MONITORING SUBSYSTEM,
	open list

On 11/28/24 17:20, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> After commit f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
> cross-compiling env params") we would fail to cross compile cpupower in
> buildroot which uses the recipe at [1] where only the CROSS variable is
> being set.
> 
> The issue here is the use of the lazy evaluation for all variables: CC,
> LD, AR, STRIP, RANLIB, rather than just CROSS.
> 
> [1]:
> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in
> 
> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross-compiling env params")
> Reported-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Closes: https://lore.kernel.org/all/2bbabd2c-24ef-493c-a199-594e5dada3da@broadcom.com/
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>

Thanks!
-- 
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2024-12-02 17:12 ` Florian Fainelli
@ 2024-12-10  0:58   ` Shuah Khan
  2025-01-07 18:56     ` Florian Fainelli
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2024-12-10  0:58 UTC (permalink / raw)
  To: Florian Fainelli, Peng Fan (OSS), Thomas Renninger, Shuah Khan,
	John B. Wyatt IV, John Kacur, Peng Fan,
	open list:CPU POWER MONITORING SUBSYSTEM, open list, Shuah Khan

On 12/2/24 10:12, Florian Fainelli wrote:
> On 11/28/24 17:20, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> After commit f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
>> cross-compiling env params") we would fail to cross compile cpupower in
>> buildroot which uses the recipe at [1] where only the CROSS variable is
>> being set.
>>
>> The issue here is the use of the lazy evaluation for all variables: CC,
>> LD, AR, STRIP, RANLIB, rather than just CROSS.
>>
>> [1]:
>> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-cpupower.mk.in
>>
>> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross-compiling env params")
>> Reported-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> Closes: https://lore.kernel.org/all/2bbabd2c-24ef-493c-a199-594e5dada3da@broadcom.com/
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 
> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
> 
> Thanks!

Thank you. Applied to linux-cpupower for my next full request to
Rafael.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2024-12-10  0:58   ` Shuah Khan
@ 2025-01-07 18:56     ` Florian Fainelli
  2025-01-07 20:38       ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2025-01-07 18:56 UTC (permalink / raw)
  To: Shuah Khan, Peng Fan (OSS), Thomas Renninger, Shuah Khan,
	John B. Wyatt IV, John Kacur, Peng Fan,
	open list:CPU POWER MONITORING SUBSYSTEM, open list

On 12/9/24 16:58, Shuah Khan wrote:
> On 12/2/24 10:12, Florian Fainelli wrote:
>> On 11/28/24 17:20, Peng Fan (OSS) wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> After commit f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
>>> cross-compiling env params") we would fail to cross compile cpupower in
>>> buildroot which uses the recipe at [1] where only the CROSS variable is
>>> being set.
>>>
>>> The issue here is the use of the lazy evaluation for all variables: CC,
>>> LD, AR, STRIP, RANLIB, rather than just CROSS.
>>>
>>> [1]:
>>> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux- 
>>> tool-cpupower.mk.in
>>>
>>> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross- 
>>> compiling env params")
>>> Reported-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>> Closes: https://lore.kernel.org/all/2bbabd2c-24ef-493c- 
>>> a199-594e5dada3da@broadcom.com/
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>
>> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>
>> Thanks!
> 
> Thank you. Applied to linux-cpupower for my next full request to
> Rafael.

Since this is a bug fix, any chance you can fast track that change so we 
can keep on building that tool in various environments?

Thanks
-- 
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pm: cpupower: Makefile: Fix cross compilation
  2025-01-07 18:56     ` Florian Fainelli
@ 2025-01-07 20:38       ` Shuah Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Shuah Khan @ 2025-01-07 20:38 UTC (permalink / raw)
  To: Florian Fainelli, Peng Fan (OSS), Thomas Renninger, Shuah Khan,
	John B. Wyatt IV, John Kacur, Peng Fan,
	open list:CPU POWER MONITORING SUBSYSTEM, open list, Shuah Khan

On 1/7/25 11:56, Florian Fainelli wrote:
> On 12/9/24 16:58, Shuah Khan wrote:
>> On 12/2/24 10:12, Florian Fainelli wrote:
>>> On 11/28/24 17:20, Peng Fan (OSS) wrote:
>>>> From: Peng Fan <peng.fan@nxp.com>
>>>>
>>>> After commit f79473ed9220 ("pm: cpupower: Makefile: Allow overriding
>>>> cross-compiling env params") we would fail to cross compile cpupower in
>>>> buildroot which uses the recipe at [1] where only the CROSS variable is
>>>> being set.
>>>>
>>>> The issue here is the use of the lazy evaluation for all variables: CC,
>>>> LD, AR, STRIP, RANLIB, rather than just CROSS.
>>>>
>>>> [1]:
>>>> https://git.buildroot.net/buildroot/tree/package/linux-tools/linux- tool-cpupower.mk.in
>>>>
>>>> Fixes: f79473ed9220 ("pm: cpupower: Makefile: Allow overriding cross- compiling env params")
>>>> Reported-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>> Closes: https://lore.kernel.org/all/2bbabd2c-24ef-493c- a199-594e5dada3da@broadcom.com/
>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>>
>>> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>
>>> Thanks!
>>
>> Thank you. Applied to linux-cpupower for my next full request to
>> Rafael.
> 
> Since this is a bug fix, any chance you can fast track that change so we can keep on building that tool in various environments?
> 

I am planning to send pull request to Rafael later on today.
It will be available in linux-next once Rafael pulls it in.

I don't think if it can be fast tracked with the vacations
and holidays for the past 3 weeks or so. The best I can do
is getting this into linux-next

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-07 20:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-29  1:20 [PATCH] pm: cpupower: Makefile: Fix cross compilation Peng Fan (OSS)
2024-12-02 17:12 ` Florian Fainelli
2024-12-10  0:58   ` Shuah Khan
2025-01-07 18:56     ` Florian Fainelli
2025-01-07 20:38       ` Shuah Khan
  -- strict thread matches above, loose matches on Subject: below --
2024-11-21  4:43 Florian Fainelli
2024-11-22 15:25 ` Shuah Khan
2024-11-22 16:11   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox