ARC toolchian related fixes
cover ARC toolchian related fixes
Hi,
PFA some improvements agan out of my glibc porting work.
Thx,
-Vineet
Vineet Gupta (3):
toolchain,glibc: Allow ARC big endian glibc builds binutils/ARC: move ARC specific code together toolchain/ARC: Enable ability to build with upstream gcc/binutils
arch/Config.in.arc | 4 ++++ package/binutils/Config.in.host | 6 +++--- package/binutils/binutils.mk | 7 ++----- package/gcc/Config.in.host | 4 ++-- toolchain/toolchain-buildroot/Config.in | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/3 toolchain, glibc: Allow ARC big endian glibc builds
From: Vineet Gupta <[email protected]>
Apparently big endian glibc builds just work, if we let the endian header allow that (which prev was #error).
The current ARC glibc version in buildroot arc-2019.09-rc1 already contains that fix.
--- toolchain/toolchain-buildroot/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/toolchain-buildroot/Config.in +1 -1
@@ -48,7 +48,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \ BR2_riscv || BR2_sh || BR2_sparc64 || \ BR2_x86_64 || BR2_microblaze || BR2_nios2 || \ - (BR2_arcle && BR2_ARC_ATOMIC_EXT) || BR2_csky + (BR2_arc && BR2_ARC_ATOMIC_EXT) || BR2_csky depends on BR2_USE_MMU depends on !BR2_STATIC_LIBS depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
Signature · 1 line
2.20.1
Thomas Petazzoni
AppliedPATCH 1/3 toolchain, glibc: Allow ARC big endian glibc builds
Quoted 5 lines · On Fri, 6 Dec 2019 11:39:22 -0800 Vineet Gupta <[email protected]>…
From: Vineet Gupta <[email protected]>
Apparently big endian glibc builds just work, if we let the endian header allow that (which prev was #error).
Quoted 7 lines
The current ARC glibc version in buildroot arc-2019.09-rc1 already contains that fix.
Signed-off-by Vineet Gupta <[email protected]>--- toolchain/toolchain-buildroot/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master with an improved commit title/log. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/3 binutils/ARC: move ARC specific code together
In reply to Vineet GuptaThat way ARC specific version update needs to be done in 1 place only
--- package/binutils/binutils.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
package/binutils/binutils.mk +2 -5
@@ -8,14 +8,11 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1 -else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_arc),y) +BINUTILS_VERSION = arc-2019.09-rc1 BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = y
Signature · 1 line
2.20.1
PATCH 2/3 binutils/ARC: move ARC specific code together
Quoted 14 lines · On Fri, 6 Dec 2019 11:39:23 -0800 Vineet Gupta <[email protected]>…
That way ARC specific version update needs to be done in 1 place only
Signed-off-by Vineet Gupta <[email protected]>--- package/binutils/binutils.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)package/binutils/binutils.mk +0
-0@@ -8,14 +8,11 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
package/binutils/binutils.mk line 14
Quoted 10 lines
package/binutils/binutils.mk +1
-5ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1 -else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_arc),y)
This is not going to work well with your PATCH 3/3 (on which I have comments). Indeed, BR2_arc=y does not necessarily imply that we want to use the ARC-specific binutils version.
You can however use ifeq ($(BR2_BINUTILS_VERSION_ARC),y) instead.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 1/1 binutils/ARC: cleanup
Remove special handling for ARC - as it is not needed for cksy etc.
A nice side benefit is that the ARC specific version now only needs to be specified in single place (vs 3 currently) in binutils/Config.in.host
--- package/binutils/binutils.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
package/binutils/binutils.mk +1 -5
@@ -8,14 +8,10 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1 -else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y) BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = y
Signature · 1 line
2.20.1
PATCH v2 1/1 binutils/ARC: cleanup
Hello Vineet,
Quoted 20 lines · On Tue, 17 Dec 2019 13:32:53 -0800 Vineet Gupta <[email protected]>…
Remove special handling for ARC - as it is not needed for cksy etc.
A nice side benefit is that the ARC specific version now only needs to be specified in single place (vs 3 currently) in binutils/Config.in.host
Signed-off-by Vineet Gupta <[email protected]>--- package/binutils/binutils.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/binutils/binutils.mk +0
-2@@ -8,14 +8,10 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1
package/binutils/binutils.mk line 17
Quoted 10 lines
package/binutils/binutils.mk +1
-3-else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y) BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = y
In fact, I was wrong, this also does not work, in the following situation:
- You're using a pre-compiled external toolchain, so host-binutils is not selected/enabled, so the version selection in package/binutils/Config.in.host is not used, and therefore BR2_BINUTILS_VERSION_ARC cannot be set to 'y'.
- You have binutils enabled for the target.
Then, with your patch, we will no longer select the ARC-specific fork of binutils.
Basically, for the target binutils (just like for target gdb), we don't have any version selection, so we force using one specific version depending on the architecture.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 1/1 binutils/ARC: cleanup
Hi Thomas,
Quoted 43 lines · Thomas Petazzoni
Hello Vineet,
Quoted 20 lines · On Tue, 17 Dec 2019 13:32:53 -0800 Vineet Gupta <[email protected]>…
Remove special handling for ARC - as it is not needed for cksy etc.
A nice side benefit is that the ARC specific version now only needs to be specified in single place (vs 3 currently) in binutils/Config.in.host
Signed-off-by Vineet Gupta <[email protected]>--- package/binutils/binutils.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/binutils/binutils.mk +0
-2@@ -8,14 +8,10 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1package/binutils/binutils.mk line 17
Quoted 10 lines
package/binutils/binutils.mk +1
-3-else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y) BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = yIn fact, I was wrong, this also does not work, in the following situation:
- You're using a pre-compiled external toolchain, so host-binutils is not selected/enabled, so the version selection in package/binutils/Config.in.host is not used, and therefore
BR2_BINUTILS_VERSION_ARCcannot be set to 'y'.
Quoted 8 lines
- You have binutils enabled for the target.
Then, with your patch, we will no longer select the ARC-specific fork of binutils.
Basically, for the target binutils (just like for target gdb), we don't have any version selection, so we force using one specific version depending on the architecture.
Does that mean that other arch in that file (csky) with custom github location is affected with the issue you mentioned above ?
-Vineet
PATCH v2 1/1 binutils/ARC: cleanup
In reply to Thomas PetazzoniHi Thomas,
Quoted 30 lines · Thomas Petazzoni
Hello Vineet,
Quoted 25 lines · On Tue, 17 Dec 2019 13:32:53 -0800 Vineet Gupta…
Remove special handling for ARC - as it is not needed for cksy etc.
A nice side benefit is that the ARC specific version now only needs to be specified in single place (vs 3 currently) in binutils/Config.in.host
--- package/binutils/binutils.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/binutils/binutils.mk +0
-4@@ -8,14 +8,10 @@ # If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) -ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2019.09-rc1 -else BINUTILS_VERSION = 2.32 endif -endif # BINUTILS_VERSION
Quoted 2 lines
package/binutils/binutils.mk line 14
Quoted 2 lines
package/binutils/binutils.mk +1
-1-ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y)
Looks like we need this specific thunk anyways. When I select pristine upstream binutils (not ARC fork @ github), the above forces it to download from github which it should not and will not if the tag/branch has not been mirrored there.
Quoted 25 lines
package/binutils/binutils.mk line 17
Quoted 3 lines
package/binutils/binutils.mk +0
-0BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = yIn fact, I was wrong, this also does not work, in the following situation:
- You're using a pre-compiled external toolchain, so host-binutils is not selected/enabled, so the version selection in package/binutils/Config.in.host is not used, and therefore
BR2_BINUTILS_VERSION_ARCcannot be set to 'y'.- You have binutils enabled for the target.
Then, with your patch, we will no longer select the ARC-specific fork of binutils.
Basically, for the target binutils (just like for target gdb), we don't have any version selection, so we force using one specific version depending on the architecture.
Best regards,
Thomas
PATCH v2 1/1 binutils/ARC: cleanup
Hello Vineet,
Quoted 6 lines · On Thu, 10 Sep 2020 23:21:43 +0000 Vineet Gupta <[email protected]>…
Quoted 2 lines
package/binutils/binutils.mk line 14
Quoted 2 lines
package/binutils/binutils.mk +1
-1-ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y)Looks like we need this specific thunk anyways. When I select pristine upstream binutils (not ARC fork @ github), the above forces it to download from github which it should not and will not if the tag/branch has not been mirrored there.
So I guess you're talking about the situation where a host-binutils is not enabled, and only a target binutils is used. In this case, indeed:
ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)BINUTILS_VERSION = arc-2020.03-release
elseBINUTILS_VERSION = 2.33.1
endif
endif # BINUTILS_VERSION
will kick in and set BINUTILS_VERSION to arc-2020.03-release, which will lead to:
ifeq ($(BINUTILS_VERSION),arc-2020.03-release)BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gzBINUTILS_FROM_GIT = y
endif
being taken into account.
What happens with target binutils is:
(1) If a host-binutils is built (because Buildroot is building the toolchain), then we're using the same version as the host-binutils, which is defined by the choice in package/binutils/Config.in.host.
(2) If not host-binutils is built (because we're using an external toolchain), then there is no version selection: we unconditionally use 2.33.1, except on ARC where we use the special ARC fork.
So I guess the decision to take is: do we want to switch to using the upstream binutils, even for ARC, when no host-binutils is built ?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 1/1 binutils/ARC: cleanup
Quoted 5 lines · Thomas Petazzoni
Hello Vineet,
On Thu, 10 Sep 2020 23:21:43 +0000
Vineet Gupta <[email protected]> wrote:
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
package/binutils/binutils.mk line 14
Quoted 2 lines
package/binutils/binutils.mk +1
-1-ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1) +ifeq ($(BR2_BINUTILS_VERSION_ARC),y)Looks like we need this specific thunk anyways. When I select pristine upstream binutils (not ARC fork @ github), the above forces it to download from github which it should not and will not if the tag/branch has not been mirrored there.
So I guess you're talking about the situation where a host-binutils is not enabled, and only a target binutils is used.
No sorry, I was not. I was trying to build a host binutils off upstream 2.34 and must have some local change to make it download 2.34 off of github ARC fork. I can't reproduce it now.
Quoted 10 lines
In this case, indeed:
ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)BINUTILS_VERSION= arc-2020.03-release
elseBINUTILS_VERSION= 2.33.1
endif
endif #BINUTILS_VERSION
Quoted 8 lines
will kick in and set
BINUTILS_VERSIONto arc-2020.03-release, which will lead to:ifeq ($(BINUTILS_VERSION),arc-2020.03-release)
BINUTILS_SITE= $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))BINUTILS_SOURCE= binutils-gdb-$(BINUTILS_VERSION).tar.gzBINUTILS_FROM_GIT= y
endif
The use of a single release string to decide where to download off of seems a bit fragile. But given we are moving away from fork gradually it seems OK.
Quoted 9 lines
being taken into account.
What happens with target binutils is:
(1) If a host-binutils is built (because Buildroot is building the toolchain), then we're using the same version as the host-binutils, which is defined by the choice in package/binutils/Config.in.host.
Quoted 6 lines
(2) If not host-binutils is built (because we're using an external toolchain), then there is no version selection: we unconditionally use 2.33.1, except on ARC where we use the special ARC fork.
So I guess the decision to take is: do we want to switch to using the upstream binutils, even for ARC, when no host-binutils is built ?
I suppose so. upstream binutils is perhaps an odd commit or two behind the fork, if at all.
I'll pester Alexey to just ditch binutils fork for upstream buildroot.
Quoted 4 lines
Best regards,
Thomas
PATCH 3/3 toolchain/ARC: Enable ability to build with upstream gcc/binutils
In reply to Vineet GuptaWhile ARC upstream gcc/binutils work, they are still trailing behind the more up to date code at github. To help expedite this gap, we want to test the upstreeam versiosn more often, hence this patch. It allows ARC tools to be built of upstream gcc/binutils.
--- arch/Config.in.arc | 4 ++++ package/binutils/Config.in.host | 6 +++--- package/binutils/binutils.mk | 2 +- package/gcc/Config.in.host | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-)
arch/Config.in.arc +4 -0
@@ -59,6 +59,10 @@ config BR2_arc bool default y if BR2_arcle || BR2_arceb +config BR2_arc_gh + bool "ARC github tools" + default y if BR2_arc + config BR2_ENDIAN default "LITTLE" if BR2_arcle default "BIG" if BR2_arceb
package/binutils/Config.in.host +3 -3
@@ -7,8 +7,8 @@ config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI choice prompt "Binutils Version" - default BR2_BINUTILS_VERSION_2_32_X if !BR2_arc && !BR2_csky - default BR2_BINUTILS_VERSION_ARC if BR2_arc + default BR2_BINUTILS_VERSION_2_32_X if !BR2_arc_gh && !BR2_csky + default BR2_BINUTILS_VERSION_ARC if BR2_arc_gh default BR2_BINUTILS_VERSION_CSKY if BR2_csky help Select the version of binutils you wish to use.
@@ -27,7 +27,7 @@ config BR2_BINUTILS_VERSION_2_33_X config BR2_BINUTILS_VERSION_ARC bool "binutils arc (2.31)" - depends on BR2_arc + depends on BR2_arc_gh config BR2_BINUTILS_VERSION_CSKY bool "binutils csky"
package/binutils/binutils.mk +1 -1
@@ -11,7 +11,7 @@ ifeq ($(BINUTILS_VERSION),) BINUTILS_VERSION = 2.32 endif -ifeq ($(BR2_arc),y) +ifeq ($(BR2_arc_gh),y) BINUTILS_VERSION = arc-2019.09-rc1 BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
package/gcc/Config.in.host +2 -2
@@ -2,7 +2,7 @@ comment "GCC Options" choice prompt "GCC compiler Version" - default BR2_GCC_VERSION_ARC if BR2_arc + default BR2_GCC_VERSION_ARC if BR2_arc_gh default BR2_GCC_VERSION_CSKY if BR2_csky default BR2_GCC_VERSION_OR1K if BR2_or1k default BR2_GCC_VERSION_8_X
@@ -12,7 +12,7 @@ choice config BR2_GCC_VERSION_ARC bool "gcc arc (9.x)" # Only supported architecture - depends on BR2_arc + depends on BR2_arc_gh select BR2_TOOLCHAIN_GCC_AT_LEAST_9 config BR2_GCC_VERSION_CSKY
Signature · 1 line
2.20.1
PATCH 3/3 toolchain/ARC: Enable ability to build with upstream gcc/binutils
Quoted 18 lines · On Fri, 6 Dec 2019 11:39:24 -0800 Vineet Gupta <[email protected]>…
While ARC upstream gcc/binutils work, they are still trailing behind the more up to date code at github. To help expedite this gap, we want to test the upstreeam versiosn more often, hence this patch. It allows ARC tools to be built of upstream gcc/binutils.
Signed-off-by Vineet Gupta <[email protected]>--- arch/Config.in.arc | 4 ++++ package/binutils/Config.in.host | 6 +++--- package/binutils/binutils.mk | 2 +- package/gcc/Config.in.host | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-)arch/Config.in.arc +0
-0
arch/Config.in.arc config BR2_arc · line 64
Quoted 6 lines
arch/Config.in.arc +3
-0@@ -59,6 +59,10 @@ config BR2_arc bool default y if BR2_arcle || BR2_arceb +config BR2_arc_gh + bool "ARC github tools" + default y if BR2_arc
That's not how we want to handle this.
Quoted 20 lines
arch/Config.in.arc +1
-0+ config BR2_ENDIAN default "LITTLE" if BR2_arcle default "BIG" if BR2_arcebpackage/binutils/Config.in.host +2
-2@@ -7,8 +7,8 @@ config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI choice prompt "Binutils Version" - default BR2_BINUTILS_VERSION_2_32_X if !BR2_arc && !BR2_csky - default BR2_BINUTILS_VERSION_ARC if BR2_arc + default BR2_BINUTILS_VERSION_2_32_X if !BR2_arc_gh && !BR2_csky + default BR2_BINUTILS_VERSION_ARC if BR2_arc_gh default BR2_BINUTILS_VERSION_CSKY if BR2_csky help Select the version of binutils you wish to use.
package/binutils/Config.in.host config BR2_BINUTILS_VERSION_2_33_X · line 30
Quoted 5 lines
package/binutils/Config.in.host +1
-1@@ -27,7 +27,7 @@ config BR2_BINUTILS_VERSION_2_33_X config BR2_BINUTILS_VERSION_ARC bool "binutils arc (2.31)" - depends on BR2_arc + depends on BR2_arc_gh
For binutils, you can already select any upstream version, or the ARC specific version on ARC. So there is nothing to change here: you can already select either upstream or ARC-specific.
package/gcc/Config.in.host comment "GCC Options"
Quoted 5 lines
package/gcc/Config.in.host +0
-0@@ -2,7 +2,7 @@ comment "GCC Options"
Ditto for gcc, you can already chose any upstream gcc version >= 7.x for ARC, or the ARC-specific version.
So, I don't understand what your patch brings: what you describe in your commit log is already possible today.
The following defconfig is already possible with Buildroot today:
BR2_arcle=y
BR2_archs38=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_BINUTILS_VERSION_2_33_X=y
BR2_GCC_VERSION_9_X=y
It builds an ARC HS38 glibc toolchain with upstream gcc 9.x and upstream binutils 2.33.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com