linux-tools/perf: Respect TARGET_CFLAGS
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via TARGET_ABI, see [1] for more details.
[1] https://patchwork.ozlabs.org/patch/1087471/
--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)
package/linux-tools/linux-tool-perf.mk.in +1 -0
@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ prefix=/usr \ WERROR=0 \ NO_LIBAUDIT=1 \
Signature · 1 line
2.16.2
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Hello,
Quoted 19 lines · On Thu, 18 Apr 2019 12:39:02 +0300 Alexey Brodkin…
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via
TARGET_ABI, see [1] for more details.[1] https://patchwork.ozlabs.org/patch/1087471/
Signed-off-by Alexey Brodkin <[email protected]>--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)package/linux-tools/linux-tool-perf.mk.in +0
-0
package/linux-tools/linux-tool-perf.mk.in PERF_MAKE_FLAGS = \ · line 22
Quoted 4 lines
package/linux-tools/linux-tool-perf.mk.in +1
-0@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed.
Arnout, what do you think?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Quoted 33 lines · Thomas Petazzoni
Hello,
Quoted 19 lines · On Thu, 18 Apr 2019 12:39:02 +0300 Alexey Brodkin…
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via
TARGET_ABI, see [1] for more details.[1] https://patchwork.ozlabs.org/patch/1087471/
Signed-off-by Alexey Brodkin <[email protected]>--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)package/linux-tools/linux-tool-perf.mk.in +0
-0package/linux-tools/linux-tool-perf.mk.in PERF_MAKE_FLAGS = \ · line 22
Quoted 4 lines
package/linux-tools/linux-tool-perf.mk.in +1
-0@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed.
Quoted 1 line
Arnout, what do you think?
+1.
Thomas, last year we made a beginning of deciding what should go through the
wrapper and what through CFLAGS, but I'm not sure if we ever got to a conclusion?
Regards,
Arnout
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Hi Arnout, Thomas,
Quoted 46 lines
-----Original Message-----
From: Arnout Vandecappelle <[email protected]>
Sent: Sunday, April 21, 2019 10:36 AM
To: Thomas Petazzoni <[email protected]>; Alexey Brodkin <[email protected]>
Cc: buildroot at busybox.net; ARC Buildroot mailing list <[email protected]>
Subject: Re: [Buildroot] [PATCH] linux-tools/perf: RespectTARGET_CFLAGSQuoted 13 lines · Thomas Petazzoni
Hello,
Quoted 8 lines · On Thu, 18 Apr 2019 12:39:02 +0300 Alexey Brodkin…
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via
TARGET_ABI, see [1] for more details.3A__patchwork.ozlabs.org_patch_1087471_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7b reS55ytWkhpk5R81I&m=eB4KQfsAGH4782y3faOnCUr3nb3xgbJBuMv3P9P6cxY&s=g7hFDq2PCWQQNFtfEGkCnU8PyqSm-NS- FzrkT4QMA8c&e=
Quoted 20 lines
Quoted 11 lines
Signed-off-by Alexey Brodkin <[email protected]>--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)package/linux-tools/linux-tool-perf.mk.in +0
-0package/linux-tools/linux-tool-perf.mk.in PERF_MAKE_FLAGS = \ · line 22
Quoted 4 lines
package/linux-tools/linux-tool-perf.mk.in +1
-0@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed.
Quoted 6 lines
Quoted 1 line
Arnout, what do you think?
+1.
Thomas, last year we made a beginning of deciding what should go through the
wrapper and what through CFLAGS, but I'm not sure if we ever got to a conclusion?
So are we going to wait for some infrastructure changes or shall we first fix the problem at hand with broken perf build to ARC700?
-Alexey
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Quoted 50 lines · Alexey Brodkin
Hi Arnout, Thomas,
Quoted 48 lines
-----Original Message-----
From: Arnout Vandecappelle <[email protected]>
Sent: Sunday, April 21, 2019 10:36 AM
To: Thomas Petazzoni <[email protected]>; Alexey Brodkin <[email protected]>
Cc: buildroot at busybox.net; ARC Buildroot mailing list <[email protected]>
Subject: Re: [Buildroot] [PATCH] linux-tools/perf: RespectTARGET_CFLAGSQuoted 13 lines · Thomas Petazzoni
Hello,
Quoted 8 lines · On Thu, 18 Apr 2019 12:39:02 +0300 Alexey Brodkin…
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via
TARGET_ABI, see [1] for more details.3A__patchwork.ozlabs.org_patch_1087471_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7b reS55ytWkhpk5R81I&m=eB4KQfsAGH4782y3faOnCUr3nb3xgbJBuMv3P9P6cxY&s=g7hFDq2PCWQQNFtfEGkCnU8PyqSm-NS- FzrkT4QMA8c&e=
Quoted 21 lines
Quoted 11 lines
Signed-off-by Alexey Brodkin <[email protected]>--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)package/linux-tools/linux-tool-perf.mk.in +0
-0package/linux-tools/linux-tool-perf.mk.in PERF_MAKE_FLAGS = \ · line 22
Quoted 4 lines
package/linux-tools/linux-tool-perf.mk.in +1
-0@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed.
Arnout, what do you think?
Quoted 7 lines
Quoted 4 lines
+1.
Thomas, last year we made a beginning of deciding what should go through the
wrapper and what through CFLAGS, but I'm not sure if we ever got to a conclusion?So are we going to wait for some infrastructure changes or shall we first fix the problem at hand with broken perf build to ARC700?
It's not really infrastructure changes. Rather, it is a better way to fix the
issue.
You just need to move the -matomic from TARGET_ABI to TOOLCHAIN_WRAPPER_OPTS.
The only tricky part is where that should be done. I think arch/arch.mk.arc
would be the right place. But that indeed requires an infrastructural change, because the TOOLCHAIN_WRAPPER_OPTS = ... in toolchain-wrapper.mk has to change into a +=.
Regards,
Arnout
Regards,
Arnout
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Arnout, Alexey, All,
On 2019-04-27 19:39 +0200, Arnout Vandecappelle spake thusly:
Quoted 1 line · Alexey Brodkin
[--SNIP--]
Quoted 13 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed. Arnout, what do you think?
+1.
Thomas, last year we made a beginning of deciding what should go through the
wrapper and what through CFLAGS, but I'm not sure if we ever got to a conclusion?So are we going to wait for some infrastructure changes or shall we first fix the problem at hand with broken perf build to ARC700?
It's not really infrastructure changes. Rather, it is a better way to fix the
issue.
Quoted 6 lines
You just need to move the -matomic from
TARGET_ABItoTOOLCHAIN_WRAPPER_OPTS.The only tricky part is where that should be done. I think
arch/arch.mk.arc
would be the right place. But that indeed requires an infrastructural change, because theTOOLCHAIN_WRAPPER_OPTS= ... in toolchain-wrapper.mk has to change into a +=.
I'm not too fond of this, but what about the following:
arch/arch.mk.arc new file +3 -0
@@ -0,0 +1,3 @@ +ifeq ($(BR2_arcle),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic +endif
(quoted diff) +0 -0
b/toolchain/toolchain-wrapper.mk
index ca66fa7ba4..8f872506ec 100644
toolchain/toolchain-wrapper.mk +0 -0
@@ -17,6 +17,7 @@ TOOLCHAIN_WRAPPER_ARGS =
$($(PKG)_TOOLCHAIN_WRAPPER_ARGS)
TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'
TOOLCHAIN_WRAPPER_OPTS = \
+ $(ARCH_TOOLCHAIN_WRAPPER_OPTS) \
$(call qstrip,$(BR2_SSP_OPTION)) \
$(call qstrip,$(BR2_TARGET_OPTIMIZATION))Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Hi Yann, all,
Quoted 50 lines
-----Original Message-----
From: Yann E. MORIN <[email protected]> On Behalf Of Yann E. MORIN
Sent: Saturday, April 27, 2019 8:56 PM
To: Arnout Vandecappelle <[email protected]>
Cc: Alexey Brodkin <[email protected]>; Thomas Petazzoni <[email protected]>; buildroot at busybox.net; ARC Buildroot mailing list <[email protected]>
Subject: Re: [Buildroot] [PATCH] linux-tools/perf: RespectTARGET_CFLAGSArnout, Alexey, All,
On 2019-04-27 19:39 +0200, Arnout Vandecappelle spake thusly:
Quoted 1 line · Alexey Brodkin
[--SNIP--]
Quoted 13 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
The change is OK, but I believe that if -matomic is really a core/important CFLAGS on ARC, then we should ideally pass it through the toolchain wrapper, so that we are sure it is always passed. Arnout, what do you think?
+1.
Thomas, last year we made a beginning of deciding what should go through the
wrapper and what through CFLAGS, but I'm not sure if we ever got to a conclusion?So are we going to wait for some infrastructure changes or shall we first fix the problem at hand with broken perf build to ARC700?
It's not really infrastructure changes. Rather, it is a better way to fix the
issue.Quoted 6 lines
You just need to move the -matomic from
TARGET_ABItoTOOLCHAIN_WRAPPER_OPTS.The only tricky part is where that should be done. I think
arch/arch.mk.arc
would be the right place. But that indeed requires an infrastructural change, because theTOOLCHAIN_WRAPPER_OPTS= ... in toolchain-wrapper.mk has to change into a +=.I'm not too fond of this, but what about the following:
arch/arch.mk.arc new file +3
-0@@ -0,0 +1,3 @@ +ifeq ($(BR2_arcle),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic +endiftoolchain/toolchain-wrapper.mk +0
-0
toolchain/toolchain-wrapper.mk TOOLCHAIN_WRAPPER_ARGS = · line 23
Quoted 7 lines
toolchain/toolchain-wrapper.mk +1
-0@@ -17,6 +17,7 @@ TOOLCHAIN_WRAPPER_ARGS = $($(PKG)_TOOLCHAIN_WRAPPER_ARGS) TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"' TOOLCHAIN_WRAPPER_OPTS = \ + $(ARCH_TOOLCHAIN_WRAPPER_OPTS) \ $(call qstrip,$(BR2_SSP_OPTION)) \ $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
That looks good to me with only one change: prefer generic "BR2_arc" instead of little-endian only "BR2_arcle".
Care to send-out a patch?
-Alexey
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Alexey, All,
On 2019-05-08 13:19 +0000, Alexey Brodkin spake thusly:
Quoted 1 line
From: Yann E. MORIN <[email protected]> On Behalf Of Yann E. MORIN
[--SNIP--]
Quoted 20 lines
Quoted 20 lines
I'm not too fond of this, but what about the following:
arch/arch.mk.arc new file +3
-0@@ -0,0 +1,3 @@ +ifeq ($(BR2_arcle),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic +endiftoolchain/toolchain-wrapper.mk +0
-0@@ -17,6 +17,7 @@ TOOLCHAIN_WRAPPER_ARGS = $($(PKG)_TOOLCHAIN_WRAPPER_ARGS) TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'
Quoted 7 lines
toolchain/toolchain-wrapper.mk TOOLCHAIN_WRAPPER_ARGS = · line 23
Quoted 4 lines
toolchain/toolchain-wrapper.mk +1
-0TOOLCHAIN_WRAPPER_OPTS = \ + $(ARCH_TOOLCHAIN_WRAPPER_OPTS) \ $(call qstrip,$(BR2_SSP_OPTION)) \ $(call qstrip,$(BR2_TARGET_OPTIMIZATION))That looks good to me with only one change: prefer generic "
BR2_arc" instead of little-endian only "BR2_arcle".
Yes, of course, it was just a quicky to demo what I was thinking...
Quoted 1 line
Care to send-out a patch?
Aw... But *you* are the arc guy! ;-)
OK, will do.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Hi Yann,
Quoted 41 lines
-----Original Message-----
From: Yann E. MORIN <[email protected]>
Sent: Wednesday, May 8, 2019 5:31 PM
To: Alexey Brodkin <[email protected]>
Cc: Thomas Petazzoni <[email protected]>; buildroot at busybox.net; ARC Buildroot mailing list <[email protected]>; Arnout Vandecappelle <[email protected]>
Subject: Re: [arc-buildroot] [Buildroot] [PATCH] linux-tools/perf: RespectTARGET_CFLAGSAlexey, All,
On 2019-05-08 13:19 +0000, Alexey Brodkin spake thusly:
Quoted 1 line
From: Yann E. MORIN <[email protected]> On Behalf Of Yann E. MORIN
[--SNIP--]
Quoted 20 lines
Quoted 20 lines
I'm not too fond of this, but what about the following:
arch/arch.mk.arc new file +3
-0@@ -0,0 +1,3 @@ +ifeq ($(BR2_arcle),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic +endiftoolchain/toolchain-wrapper.mk +0
-0@@ -17,6 +17,7 @@ TOOLCHAIN_WRAPPER_ARGS = $($(PKG)_TOOLCHAIN_WRAPPER_ARGS) TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'Quoted 7 lines
toolchain/toolchain-wrapper.mk TOOLCHAIN_WRAPPER_ARGS = · line 23
Quoted 4 lines
toolchain/toolchain-wrapper.mk +1
-0TOOLCHAIN_WRAPPER_OPTS = \ + $(ARCH_TOOLCHAIN_WRAPPER_OPTS) \ $(call qstrip,$(BR2_SSP_OPTION)) \ $(call qstrip,$(BR2_TARGET_OPTIMIZATION))That looks good to me with only one change: prefer generic "
BR2_arc" instead of little-endian only "BR2_arcle".
Quoted 7 lines
Yes, of course, it was just a quicky to demo what I was thinking...
Quoted 1 line
Care to send-out a patch?
Aw... But *you* are the arc guy! ;-)
OK, will do.
I'm all for sending it myself but it will be like I'm stealing your nice idea - nothing more that that.
Want me to do that instead?
-Alexey
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
Alexey, All,
On 2019-05-08 14:54 +0000, Alexey Brodkin spake thusly:
[--SNIP--]
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Care to send-out a patch?
Aw... But *you* are the arc guy! ;-)
OK, will do.I'm all for sending it myself but it will be like I'm stealing your nice idea - nothing more that that.
Want me to do that instead?
I've done the patches localy already, I just need a bit of time to test then and send the series.
I shall not promise anything, but maybe in the evening/night.
BTW, are all ARC cores impacted, or only the 7x0d ?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 linux-tools/perf: Respect TARGET_CFLAGS
In reply to Alexey BrodkinAlexey, All,
On 2019-04-18 12:39 +0300, Alexey Brodkin spake thusly:
Quoted 6 lines
perf uses its own build-system and doesn't respect externally set flags. Let's force it to use target flags as perf utility is nothing but an ordinary user-space application.
This among other things is required to build perf for ARC700 for which we pass "-matomic" via
TARGET_ABI, see [1] for more details.
As was discussed in the thread, the proper option is now passed in via the wrapper and arch-specific CFLAGS:
https://git.buildroot.org/buildroot/commit/?id=4281288d2d568d5ce748a0e66e0872f54fbe956c https://git.buildroot.org/buildroot/commit/?id=c568b4f37fa6d7f51e6d14d33d7eb75dfe26d7bf
Thanks!
Regards,
Yann E. MORIN.
Quoted 26 lines
[1] https://patchwork.ozlabs.org/patch/1087471/
Signed-off-by Alexey Brodkin <[email protected]>--- package/linux-tools/linux-tool-perf.mk.in | 1 + 1 file changed, 1 insertion(+)package/linux-tools/linux-tool-perf.mk.in +1
-0@@ -19,6 +19,7 @@ PERF_MAKE_FLAGS = \ JOBS=$(PARALLEL_JOBS) \ ARCH=$(PERF_ARCH) \ DESTDIR=$(TARGET_DIR) \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ prefix=/usr \ WERROR=0 \ NO_LIBAUDIT=1 \Signature · 6 lines
2.16.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'