package/llvm: Support for RISC-V on the LLVM package
PATCH 1/2 package/llvm: Support for RISC-V on the LLVM package
The initial support for the LLVM package did not include RISC-V, and needed to be added.
There is a new configuration parameter added (BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) for dealing with the fact that the LLVM target and the architecture have different naming for RISC-V. While the target for RISC-V is "RISCV" irrespective of the ISA being 32 or 64 bits, the architecture does contain the number of bits leading to "riscv32" and "riscv64".
For previously supported architectures the naming for target and architecture matched and thus this parameter had not been needed, but it is now needed for RISC-V.
--- package/llvm/Config.in | 10 ++++++++++ package/llvm/llvm.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
package/llvm/Config.in +10 -0
@@ -4,12 +4,22 @@ config BR2_PACKAGE_LLVM_ARCH_SUPPORTS default y if BR2_x86_64 default y if BR2_aarch64 default y if BR2_arm || BR2_armeb + default y if BR2_riscv config BR2_PACKAGE_LLVM_TARGET_ARCH string default "AArch64" if BR2_aarch64 default "ARM" if BR2_arm || BR2_armeb default "X86" if BR2_i386 || BR2_x86_64 + default "riscv32" if BR2_riscv && !BR2_ARCH_IS_64 + default "riscv64" if BR2_riscv && BR2_ARCH_IS_64 + +config BR2_PACKAGE_LLVM_TARGETS_TO_BUILD + string + default "AArch64" if BR2_aarch64 + default "ARM" if BR2_arm || BR2_armeb + default "X86" if BR2_i386 || BR2_x86_64 + default "RISCV" if BR2_riscv config BR2_PACKAGE_LLVM bool "llvm"
package/llvm/llvm.mk +1 -1
@@ -42,7 +42,7 @@ HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH)) # Build backend for target architecture. This include backends like AMDGPU. -LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) +LLVM_TARGETS_TO_BUILD = $(BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))"
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 arch/riscv: Added support for RISC-V vector extension on the architecture menu.
This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon).
--- arch/Config.in.riscv | 7 +++++++ arch/arch.mk.riscv | 4 ++++ 2 files changed, 11 insertions(+)
arch/Config.in.riscv +7 -0
@@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVD config BR2_RISCV_ISA_RVC bool +config BR2_RISCV_ISA_RVV + bool + choice prompt "Target Architecture Variant" default BR2_riscv_g
@@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVD config BR2_RISCV_ISA_CUSTOM_RVC bool "Compressed Instructions (C)" select BR2_RISCV_ISA_RVC + +config BR2_RISCV_ISA_CUSTOM_RVV + bool "Vector Instructions (V)" + select BR2_RISCV_ISA_RVV endif choice
arch/arch.mk.riscv +4 -0
@@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y) GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c endif +ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif + endif
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] arch/riscv: Added support for RISC-V vector extension on the architecture menu.
Hello Abel,
Le 23/07/2022 à 23:54, Abel Bernabeu a écrit :
Quoted 2 lines
This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon).
It seems that is the same series as v1:
http://patchwork.ozlabs.org/project/buildroot/list/?series=307848&state=*
See 22.5.5. "Patch revision changelog" section for help.
https://nightly.buildroot.org/manual.html#submitting-patches
Quoted 22 lines
Signed-off-by Abel Bernabeu <[email protected]>--- arch/Config.in.riscv | 7 +++++++ arch/arch.mk.riscv | 4 ++++ 2 files changed, 11 insertions(+)arch/Config.in.riscv +3
-0@@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVD config BR2_RISCV_ISA_RVC bool +config BR2_RISCV_ISA_RVV + bool + choice prompt "Target Architecture Variant" default BR2_riscv_g
arch/Config.in.riscv config BR2_RISCV_ISA_CUSTOM_RVD · line 70
Quoted 5 lines
arch/Config.in.riscv +2
-0@@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVD config BR2_RISCV_ISA_CUSTOM_RVC bool "Compressed Instructions (C)" select BR2_RISCV_ISA_RVC + +config BR2_RISCV_ISA_CUSTOM_RVV
This option must depends on gcc-12.
Best regards,
Romain
Quoted 10 lines
arch/Config.in.riscv +2
-0+ bool "Vector Instructions (V)" + select BR2_RISCV_ISA_RVV endif choicearch/arch.mk.riscv +0
-0
arch/arch.mk.riscv endif · line 34
Quoted 9 lines
arch/arch.mk.riscv +4
-0@@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y) GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c endif +ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif + endif
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] arch/riscv: Added support for RISC-V vector extension on the architecture menu.
Quoted 29 lines · Romain Naour
Hello Abel,
Le 23/07/2022 à 23:54, Abel Bernabeu a écrit :
Quoted 2 lines
This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon).
It seems that is the same series as v1:
http://patchwork.ozlabs.org/project/buildroot/list/?series=307848&state=*
See 22.5.5. "Patch revision changelog" section for help.
https://nightly.buildroot.org/manual.html#submitting-patches
Quoted 15 lines
Signed-off-by Abel Bernabeu <[email protected]>--- arch/Config.in.riscv | 7 +++++++ arch/arch.mk.riscv | 4 ++++ 2 files changed, 11 insertions(+)arch/Config.in.riscv +0
-0@@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVD config BR2_RISCV_ISA_RVC bool
Quoted 14 lines
arch/Config.in.riscv config BR2_RISCV_ISA_CUSTOM_RVD · line 70
Quoted 12 lines
arch/Config.in.riscv +5
-0+config BR2_RISCV_ISA_RVV + bool + choice prompt "Target Architecture Variant" default BR2_riscv_g@@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVD config BR2_RISCV_ISA_CUSTOM_RVC bool "Compressed Instructions (C)" select BR2_RISCV_ISA_RVC + +config BR2_RISCV_ISA_CUSTOM_RVVThis option must depends on gcc-12.
No, it's the other way round: it should force GCC 12, by selectingBR2_ARCH_NEEDS_GCC_AT_LEAST_12.
Regards,
Arnout
Quoted 22 lines
Best regards,
RomainQuoted 18 lines
arch/Config.in.riscv +2
-0+ bool "Vector Instructions (V)" + select BR2_RISCV_ISA_RVV endif choicearch/arch.mk.riscv +4
-0@@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y) GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c endif +ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif +
Quoted 6 lines
arch/arch.mk.riscv endif · line 34
Quoted 1 line
arch/arch.mk.riscv +0
-0endif_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] arch/riscv: Added support for RISC-V vector extension on the architecture menu.
Le 24/07/2022 à 11:25, Arnout Vandecappelle a écrit :
Quoted 46 lines · Romain Naour
Quoted 34 lines
Hello Abel,
Le 23/07/2022 à 23:54, Abel Bernabeu a écrit :
Quoted 2 lines
This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon).
It seems that is the same series as v1:
http://patchwork.ozlabs.org/project/buildroot/list/?series=307848&state=*
See 22.5.5. "Patch revision changelog" section for help.
https://nightly.buildroot.org/manual.html#submitting-patches
Quoted 20 lines
Signed-off-by Abel Bernabeu <[email protected]>---
arch/Config.in.riscv| 7 +++++++
arch/arch.mk.riscv | 4 ++++2 files changed, 11 insertions(+)arch/Config.in.riscv +0
-0@@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVDconfig
BR2_RISCV_ISA_RVC
bool
+configBR2_RISCV_ISA_RVV
+ bool
+
choice
prompt "Target Architecture Variant"
defaultBR2_riscv_gQuoted 8 lines
arch/Config.in.riscv config BR2_RISCV_ISA_CUSTOM_RVD · line 70
Quoted 6 lines
arch/Config.in.riscv +0
-0@@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVDconfig
BR2_RISCV_ISA_CUSTOM_RVC
bool "Compressed Instructions (C)"
selectBR2_RISCV_ISA_RVCarch/Config.in.riscv +2
-0+ +config BR2_RISCV_ISA_CUSTOM_RVVThis option must depends on gcc-12.
Quoted 2 lines
No, it's the other way round: it should force GCC 12, by selecting
BR2_ARCH_NEEDS_GCC_AT_LEAST_12.
Indeed, Thomas commented on this yesterday [1]
[1] http://lists.busybox.net/pipermail/buildroot/2022-July/646698.html
Best regards,
Romain
Quoted 30 lines
Regards,
ArnoutQuoted 26 lines
Best regards,
RomainQuoted 16 lines
+ bool "Vector Instructions (V)"
+ selectBR2_RISCV_ISA_RVV
endif
choicearch/arch.mk.riscv +0
-0@@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y)
GCC_TARGET_ARCH:= $(GCC_TARGET_ARCH)c
endifarch/arch.mk.riscv +4
-0+ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif +Quoted 1 line
endif
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] arch/riscv: Added support for RISC-V vector extension on the architecture menu.
Thanks, will do as suggested (forcing GCC 12 or newer when using the option).
Quoted 51 lines · Romain Naour
Quoted 5 lines · Arnout Vandecappelle
Quoted 2 lines · Romain Naour
Hello Abel,
Quoted 7 lines
Quoted 7 lines · Abel Bernabeu
Quoted 2 lines
This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon).
It seems that is the same series as v1:
http://patchwork.ozlabs.org/project/buildroot/list/?series=307848&state=*
Quoted 34 lines
Quoted 25 lines
See 22.5.5. "Patch revision changelog" section for help.
https://nightly.buildroot.org/manual.html#submitting-patches
Quoted 20 lines
Signed-off-by Abel Bernabeu <[email protected]>--- arch/Config.in.riscv | 7 +++++++ arch/arch.mk.riscv | 4 ++++ 2 files changed, 11 insertions(+)arch/Config.in.riscv +2
-0@@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVD config BR2_RISCV_ISA_RVC bool +config BR2_RISCV_ISA_RVV + bool + choice prompt "Target Architecture Variant" default BR2_riscv_gQuoted 8 lines
arch/Config.in.riscv config BR2_RISCV_ISA_CUSTOM_RVD · line 70
Quoted 6 lines
arch/Config.in.riscv +2
-0@@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVD config BR2_RISCV_ISA_CUSTOM_RVC bool "Compressed Instructions (C)" select BR2_RISCV_ISA_RVC + +config BR2_RISCV_ISA_CUSTOM_RVVThis option must depends on gcc-12.
Quoted 2 lines
No, it's the other way round: it should force GCC 12, by selecting
BR2_ARCH_NEEDS_GCC_AT_LEAST_12.
Quoted 40 lines
Indeed, Thomas commented on this yesterday [1]
[1] http://lists.busybox.net/pipermail/buildroot/2022-July/646698.html
Best regards,
RomainQuoted 30 lines
Regards,
ArnoutQuoted 26 lines
Best regards,
RomainQuoted 9 lines
arch/Config.in.riscv +2
-0+ bool "Vector Instructions (V)" + select BR2_RISCV_ISA_RVV endif choicearch/arch.mk.riscv +0
-0arch/arch.mk.riscv endif · line 33
Quoted 8 lines
arch/arch.mk.riscv +4
-0@@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y) GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c endif +ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif + endif_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 14 lines · On Sat, 23 Jul 2022 23:54:47 +0200 Abel Bernabeu <[email protected]> wrote:
The initial support for the LLVM package did not include RISC-V, and needed to be added.
There is a new configuration parameter added (
BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) for dealing with the fact that the LLVM target and the architecture have different naming for RISC-V. While the target for RISC-V is "RISCV" irrespective of the ISA being 32 or 64 bits, the architecture does contain the number of bits leading to "riscv32" and "riscv64".For previously supported architectures the naming for target and architecture matched and thus this parameter had not been needed, but it is now needed for RISC-V.
Quoted 5 lines
Signed-off-by Abel Bernabeu <[email protected]>--- package/llvm/Config.in | 10 ++++++++++ package/llvm/llvm.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
I have simplified the RISCV quirk by moving it to the llvm.mk file:
# Build backend for target architecture. This include backends like # AMDGPU. We need to special case RISCV.
ifneq ($(filter riscv%,$(LLVM_TARGET_ARCH)),) LLVM_TARGETS_TO_BUILD = RISCV
elseLLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH)
endif
Applied with this change, thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thanks Thomas!
Quoted 33 lines · Thomas Petazzoni
Quoted 14 lines · On Sat, 23 Jul 2022 23:54:47 +0200 Abel Bernabeu <[email protected]> wrote:
The initial support for the LLVM package did not include RISC-V, and needed to be added.
There is a new configuration parameter added (
BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) for dealing with the fact that the LLVM target and the architecture have different naming for RISC-V. While the target for RISC-V is "RISCV" irrespective of the ISA being 32 or 64 bits, the architecture does contain the number of bits leading to "riscv32" and "riscv64".For previously supported architectures the naming for target and architecture matched and thus this parameter had not been needed, but it is now needed for RISC-V.
Quoted 5 lines
Signed-off-by Abel Bernabeu <[email protected]>--- package/llvm/Config.in | 10 ++++++++++ package/llvm/llvm.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)I have simplified the RISCV quirk by moving it to the llvm.mk file:
# Build backend for target architecture. This include backends like # AMDGPU. We need to special case RISCV.
ifneq ($(filter riscv%,$(LLVM_TARGET_ARCH)),)LLVM_TARGETS_TO_BUILD= RISCV
elseLLVM_TARGETS_TO_BUILD= $(LLVM_TARGET_ARCH)
endif
Quoted 8 lines
Applied with this change, thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot