Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC 00/12] add hexagon architecture
@ 2024-10-25 14:07 Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 01/12] arch: add hexagon architecture support Brian Cain
                   ` (12 more replies)
  0 siblings, 13 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

I'm sending this RFC for discussion and high-level suggestions.  Since
I'm still quite new to buildroot, I'm hoping to learn how to better/more
idiomatically design this patch series.

Thanks in advance for any review.

Note that while the rootfs appears so far to be as-expected, outstanding
kernel/hypervisor bugs remain under investigation.  I'd like to use buildroot
to simplify collaboration among contributors.

Brian Cain (12):
  arch: add hexagon architecture support
  toolchain/toolchain-external: add hexagon toolchain support
  toolchain/toolchain-external: add hexagon support for
    toolchain-wrapper
  toolchain/toolchain-external: add support for clang
  toolchain/toolchain-external: skip "-march=" for hexagon
  linux: add support for hexagon clang
  arch: add hexagon ARCH definition
  package/hexagonMVM: new package
  board/qcom/sa8775: add support for qcom sa8775-cdsp0
  configs: add hexagon QEMU config
  DEVELOPERS: add myself as developer for hexagon
  package: disable -ztext for hexagon

 DEVELOPERS                                    |  8 ++
 arch/Config.in                                | 10 +++
 arch/Config.in.hexagon                        | 69 +++++++++++++++++
 board/qcom/sa8775/post_build.sh               |  9 +++
 configs/qcom_dsp_qemu_defconfig               | 44 +++++++++++
 configs/qcom_sa8775_cdsp0_defconfig           | 35 +++++++++
 linux/linux.hash                              |  1 +
 linux/linux.mk                                | 10 +++
 package/Config.in                             |  1 +
 package/Makefile.in                           | 26 +++++--
 package/hexagonMVM/Config.in                  |  8 ++
 package/hexagonMVM/hexagonMVM.hash            |  5 ++
 package/hexagonMVM/hexagonMVM.mk              | 27 +++++++
 toolchain/Config.in                           | 54 +++++++++++++
 toolchain/helpers.mk                          | 16 ++++
 toolchain/toolchain-external/Config.in        |  6 ++
 .../pkg-toolchain-external.mk                 | 42 ++++++++--
 .../Config.in.options                         | 76 +++++++++++++++++++
 .../toolchain-external-hexagon/Config.in      |  7 ++
 .../Config.in.options                         | 14 ++++
 .../toolchain-external-hexagon.hash           |  6 ++
 .../toolchain-external-hexagon.mk             | 14 ++++
 22 files changed, 478 insertions(+), 10 deletions(-)
 create mode 100644 arch/Config.in.hexagon
 create mode 100755 board/qcom/sa8775/post_build.sh
 create mode 100644 configs/qcom_dsp_qemu_defconfig
 create mode 100644 configs/qcom_sa8775_cdsp0_defconfig
 create mode 100644 package/hexagonMVM/Config.in
 create mode 100644 package/hexagonMVM/hexagonMVM.hash
 create mode 100644 package/hexagonMVM/hexagonMVM.mk
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 01/12] arch: add hexagon architecture support
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 02/12] toolchain/toolchain-external: add hexagon toolchain support Brian Cain
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 arch/Config.in         | 10 +++++++
 arch/Config.in.hexagon | 63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 arch/Config.in.hexagon

diff --git a/arch/Config.in b/arch/Config.in
index e57f4b2baa..fe863e50a7 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -254,6 +254,12 @@ config BR2_xtensa
 	  http://en.wikipedia.org/wiki/Xtensa
 	  http://www.tensilica.com/
 
+config BR2_hexagon
+	bool "Hexagon"
+	select BR2_USE_MMU
+	help
+	  Hexagon is a Qualcomm DSP processor.
+
 endchoice
 
 # For some architectures or specific cores, our internal toolchain
@@ -429,6 +435,10 @@ if BR2_xtensa
 source "arch/Config.in.xtensa"
 endif
 
+if BR2_hexagon
+source "arch/Config.in.hexagon"
+endif
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/arch/Config.in.hexagon b/arch/Config.in.hexagon
new file mode 100644
index 0000000000..9a7cb62278
--- /dev/null
+++ b/arch/Config.in.hexagon
@@ -0,0 +1,63 @@
+# hexagon cpu features
+config BR2_HEXAGON_CPU_HAS_HVX
+	bool
+
+choice
+	prompt "Target Architecture Variant"
+	default BR2_HEXAGON_v65
+	help
+	  Specific CPU variant to use
+
+config BR2_HEXAGON_v5
+	bool "v5"
+config BR2_HEXAGON_v55
+	bool "v55"
+config BR2_HEXAGON_v60
+	bool "v60"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v61
+	bool "v61"
+config BR2_HEXAGON_v62
+	bool "v62"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v65
+	bool "v65"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v66
+	bool "v66"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v68
+	bool "v68"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v69
+	bool "v69"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v71
+	bool "v71"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v73
+	bool "v73"
+	select BR2_HEXAGON_CPU_HAS_HVX
+endchoice
+
+config BR2_ARCH
+	default "hexagon"
+
+config BR2_ENDIAN
+	default "LITTLE"
+
+config BR2_READELF_ARCH_NAME
+	default "Qualcomm Hexagon"
+
+config BR2_GCC_TARGET_CPU
+	default "hexagonv5"	if BR2_HEXAGON_v5
+	default "hexagonv55"	if BR2_HEXAGON_v55
+	default "hexagonv60"	if BR2_HEXAGON_v60
+	default "hexagonv61"	if BR2_HEXAGON_v61
+	default "hexagonv62"	if BR2_HEXAGON_v62
+	default "hexagonv65"	if BR2_HEXAGON_v65
+	default "hexagonv66"	if BR2_HEXAGON_v66
+	default "hexagonv68"	if BR2_HEXAGON_v68
+	default "hexagonv69"	if BR2_HEXAGON_v69
+	default "hexagonv71"	if BR2_HEXAGON_v71
+	default "hexagonv73"	if BR2_HEXAGON_v73
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 02/12] toolchain/toolchain-external: add hexagon toolchain support
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 01/12] arch: add hexagon architecture support Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 03/12] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 toolchain/toolchain-external/Config.in             |  6 ++++++
 .../toolchain-external-hexagon/Config.in           |  7 +++++++
 .../toolchain-external-hexagon/Config.in.options   | 14 ++++++++++++++
 .../toolchain-external-hexagon.hash                |  6 ++++++
 .../toolchain-external-hexagon.mk                  | 14 ++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index e91aa16326..7bd5309671 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -29,6 +29,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in"
 # MIPS
 source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in"
 
+# Hexagon
+source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in"
+
 # Bootlin toolchains, available for virtually all architectures
 source "toolchain/toolchain-external/toolchain-external-bootlin/Config.in"
 
@@ -123,6 +126,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in.opt
 # ARM big-endian
 source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in.options"
 
+# Hexagon
+source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options"
+
 # MIPS
 source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in.options"
 
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/Config.in b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
new file mode 100644
index 0000000000..256eeb87dc
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
@@ -0,0 +1,7 @@
+comment "Toolchains available for Hexagon DSP"
+
+config BR2_TOOLCHAIN_EXTERNAL_HEXAGON
+	bool "Clang/LLVM Hexagon Toolchain"
+	depends on BR2_HOSTARCH = "x86_64" || "aarch64"
+	select BR2_TOOLCHAIN_EXTERNAL_CLANG
+	select BR2_TOOLCHAIN_EXTERNAL_MUSL
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
new file mode 100644
index 0000000000..cb4d6d5420
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
@@ -0,0 +1,14 @@
+
+if BR2_TOOLCHAIN_EXTERNAL_HEXAGON
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+	default "hexagon-unknown-linux-musl"
+
+config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
+	default "toolchain-external-hexagon"
+
+# This feature is not well-tested:
+config BR2_TOOLCHAIN_SUPPORTS_PIE
+	default "n"
+
+endif
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
new file mode 100644
index 0000000000..c4c9b3cf36
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
@@ -0,0 +1,6 @@
+# From https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.2/SHA256SUMS:
+sha256  082ce7e7b2955a79be4198123a6ff743fddaed6e2da4f0a1974f0153478fb372  clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl.tar.xz
+sha256  c06958b1a6d73e32cc3fc08b5ec15ea3e1f41180defe3142c91e06e05ad70f0b  clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl_aarch64-linux-gnu.tar.xz
+sha256  2c91bcca2d1645987723af7916184f81f287b7b94ab837dd429c8233899ce54d  clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl_aarch64-windows-gnu.tar.xz
+sha256  1e5ef2a070255a917acbce644d4977fc0c19f82105c375f5260bb573cd4bbf0f  clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl_x86_64-linux-musl.tar.xz
+sha256  f758e9e19ceac201ddd869a9aff6ffe623339e91329f7daf90960cf6218af278  clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl_x86_64-windows-gnu.tar.xz
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk
new file mode 100644
index 0000000000..f8df9c020c
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# toolchain-external-hexagon
+#
+################################################################################
+
+TOOLCHAIN_EXTERNAL_HEXAGON_VERSION = 19.1.2
+TOOLCHAIN_EXTERNAL_HEXAGON_SITE= https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/$(TOOLCHAIN_EXTERNAL_HEXAGON_VERSION)
+TOOLCHAIN_EXTERNAL_HEXAGON_SOURCE = clang+llvm-$(TOOLCHAIN_EXTERNAL_HEXAGON_VERSION)-cross-$(TOOLCHAIN_EXTERNAL_PREFIX).tar.xz
+
+# No trampoline support in lld yet, so for now:
+TOOLCHAIN_EXTERNAL_HEXAGON_CFLAGS += -mlong-calls
+
+$(eval $(toolchain-external-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 03/12] toolchain/toolchain-external: add hexagon support for toolchain-wrapper
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 01/12] arch: add hexagon architecture support Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 02/12] toolchain/toolchain-external: add hexagon toolchain support Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 04/12] toolchain/toolchain-external: add support for clang Brian Cain
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 .../toolchain-external/pkg-toolchain-external.mk      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index c08bf0a653..d45f2c54de 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -150,8 +150,14 @@ endef
 endif
 
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
+ifeq ($(BR2_hexagon),y)
+TOOLCHAIN_EXTERNAL_LIBS += libc.so libclang_rt.builtins-hexagon.so*
+TOOLCHAIN_EXTERNAL_LIBS += libc++.so* libc++abi.so* libunwind.so*
+TOOLCHAIN_EXTERNAL_LIBS += ld-musl-*.so*
+else
 TOOLCHAIN_EXTERNAL_LIBS += libc.so
 endif
+endif
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
 TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
@@ -283,7 +289,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
 		*-ar|*-ranlib|*-nm) \
 			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
 			;; \
-		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc) \
+		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc|*clang) \
 			ln -sf toolchain-wrapper $$base; \
 			;; \
 		*gdb|*gdbtui) \
@@ -465,6 +471,9 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	else \
 		ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
 	fi ; \
+	if test "$(BR2_hexagon)" = "y"; then \
+		SUPPORT_LIB_DIR=$(TOOLCHAIN_EXTERNAL_BIN)/../target/$(TOOLCHAIN_EXTERNAL_PREFIX); \
+	fi ; \
 	$(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \
 	$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
 endef
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 04/12] toolchain/toolchain-external: add support for clang
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (2 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 03/12] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 05/12] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 package/Makefile.in                           | 24 ++++--
 toolchain/Config.in                           | 54 +++++++++++++
 toolchain/helpers.mk                          | 16 ++++
 .../pkg-toolchain-external.mk                 | 29 ++++++-
 .../Config.in.options                         | 76 +++++++++++++++++++
 5 files changed, 190 insertions(+), 9 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 829636900b..b54fe123ba 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -231,14 +231,28 @@ ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7),y)
 TARGET_GCC_WRAPPERS_PREFIX = gcc-
 endif
 
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
+TARGET_CC_SUFFIX=clang
+TARGET_CXX_SUFFIX=clang++
+TARGET_AS_SUFFIX=llvm-mc
+TARGET_LD_SUFFIX=clang
+TARGET_PREPROCESSOR=clang -E
+else
+TARGET_CC_SUFFIX=gcc
+TARGET_CXX_SUFFIX=g++
+TARGET_AS_SUFFIX=as
+TARGET_LD_SUFFIX=ld
+TARGET_PREPROCESSOR=cpp
+endif
+
 # Define TARGET_xx variables for all common binutils/gcc
 TARGET_AR       = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)ar
-TARGET_AS       = $(TARGET_CROSS)as
-TARGET_CC       = $(TARGET_CROSS)gcc
-TARGET_CPP      = $(TARGET_CROSS)cpp
-TARGET_CXX      = $(TARGET_CROSS)g++
+TARGET_AS       = $(TARGET_CROSS)$(TARGET_AS_SUFFIX)
+TARGET_CC       = $(TARGET_CROSS)$(TARGET_CC_SUFFIX)
+TARGET_CPP      = $(TARGET_CROSS)$(TARGET_PREPROCESSOR)
+TARGET_CXX      = $(TARGET_CROSS)$(TARGET_CXX_SUFFIX)
 TARGET_FC       = $(TARGET_CROSS)gfortran
-TARGET_LD       = $(TARGET_CROSS)ld
+TARGET_LD       = $(TARGET_CROSS)$(TARGET_LD_SUFFIX)
 TARGET_NM       = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)nm
 TARGET_RANLIB   = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)ranlib
 TARGET_READELF  = $(TARGET_CROSS)readelf
diff --git a/toolchain/Config.in b/toolchain/Config.in
index c2522aca7f..1466425ce2 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -837,6 +837,60 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST
 	default "4.4"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
 	default "4.3"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
 
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+	bool
+
+# This order guarantees that the highest version is set, as kconfig
+# stops affecting a value on the first matching default.
+config BR2_TOOLCHAIN_CLANG_AT_LEAST
+	string
+	default "4.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+	default "5.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+	default "6.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+	default "7.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+	default "9.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+	default "10.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+	default "11.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+	default "12.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+	default "13.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+	default "14.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+	default "15.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+	default "16.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+	default "17.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+	default "18.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+	default "19.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	default "20.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+
 config BR2_TOOLCHAIN_HAS_MNAN_OPTION
 	bool
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index f3fdaaec07..f4462db483 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -224,6 +224,22 @@ check_glibc_rpc_feature = \
 		exit 1 ; \
 	fi
 
+check_clang_version = \
+	expected_version="$(strip $2)" ; \
+	exit 0; \
+	real_version=`$(TOOLCHAIN_EXTERNAL_BIN)/llvm-config --version;`; \
+	if [ -z "$${expected_version}" ]; then \
+		printf "Internal error, __$${2}__ vs __$${expected_version}__ clang version unknown (no CLANG_AT_LEAST_X_Y selected)\n"; \
+		printf "real ver: __$${real_version}__\n"; \
+		exit 1 ; \
+	fi; \
+	real_version=`$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-llvm-config --version;`; \
+	if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \
+	printf "Incorrect selection of clang version: expected %s.x, got %s\n" \
+			"$${expected_version}" "$${real_version}" ; \
+		exit 1 ; \
+	fi
+
 #
 # Check the correctness of a glibc external toolchain configuration.
 #  1. Check that the C library selected in Buildroot matches the one
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index d45f2c54de..3948ad1107 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -90,12 +90,28 @@ endif
 TOOLCHAIN_EXTERNAL_SUFFIX = \
 	$(if $(wildcard $(TOOLCHAIN_EXTERNAL_BIN)/*.br_real),.br_real)
 
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
+TARGET_CC_SUFFIX=clang
+TARGET_CXX_SUFFIX=clang++
+TARGET_BINUTILS_PREFIX=llvm-
+TARGET_LD_SUFFIX=clang
+else
+TARGET_CC_SUFFIX=gcc
+TARGET_CXX_SUFFIX=g++
+TARGET_BINUTILS_PREFIX=
+TARGET_LD_SUFFIX=ld
+endif
+
 TOOLCHAIN_EXTERNAL_CROSS = $(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
-TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)gcc$(TOOLCHAIN_EXTERNAL_SUFFIX)
-TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)g++$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)$(TARGET_CC_SUFFIX)$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)$(TARGET_CXX_SUFFIX)$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_GDC = $(TOOLCHAIN_EXTERNAL_CROSS)gdc$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_FC = $(TOOLCHAIN_EXTERNAL_CROSS)gfortran$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_READELF = $(TOOLCHAIN_EXTERNAL_CROSS)readelf
+TOOLCHAIN_EXTERNAL_LLVM_CONFIG = $(TOOLCHAIN_EXTERNAL_CROSS)llvm-config$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_CLANG_VERSION = \
+    `$(TOOLCHAIN_EXTERNAL_LLVM_CONFIG) --version | \
+     sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
 
 # Normal handling of downloaded toolchain tarball extraction.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
@@ -595,8 +611,13 @@ define $(2)_CONFIGURE_CMDS
 		$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC)),\
 		$$(call qstrip,$$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)),\
 		$$(if $$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM),loose,strict)); \
-	$$(call check_gcc_version,$$(TOOLCHAIN_EXTERNAL_CC),\
-		$$(call qstrip,$$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \
+	if test "$(BR2_TOOLCHAIN_EXTERNAL_GCC)" = "y" ; then \
+		$(call check_gcc_version,$(TOOLCHAIN_EXTERNAL_CC),\
+			$(call qstrip,$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \
+	else \
+		$(call check_clang_version,$(TOOLCHAIN_EXTERNAL_CC),\
+			$(call qstrip,$(BR2_TOOLCHAIN_CLANG_AT_LEAST))); \
+	fi ; \
 	if test "$$(BR2_arm)" = "y" ; then \
 		$$(call check_arm_abi,\
 			"$$(TOOLCHAIN_EXTERNAL_CC) $$(TOOLCHAIN_EXTERNAL_CFLAGS)") ; \
diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
index fcffeb6b77..0dbf317b92 100644
--- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
+++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
@@ -40,8 +40,25 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 	  so you can leave this option at default value if you use them
 	  as external toolchain.
 
+choice
+	bool "External toolchain Compiler"
+	default BR2_TOOLCHAIN_EXTERNAL_GCC
+	help
+	  Select between gcc and clang
+
+config BR2_TOOLCHAIN_EXTERNAL_GCC
+	bool "gcc"
+	select BR2_TOOLCHAIN_USES_GCC
+
+config BR2_TOOLCHAIN_EXTERNAL_CLANG
+	bool "clang"
+	select BR2_TOOLCHAIN_USES_CLANG
+
+endchoice
+
 choice
 	bool "External toolchain gcc version"
+	depends on BR2_TOOLCHAIN_EXTERNAL_GCC
 	help
 	  Set to the gcc version that is used by your external
 	  toolchain.
@@ -146,6 +163,65 @@ endchoice
 comment "GCC older than 4.8 is not tested by Buildroot. Use at your own risk."
 	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 
+choice
+	bool "External toolchain clang version"
+	default BR2_TOOLCHAIN_EXTERNAL_CLANG_4_0
+	depends on BR2_TOOLCHAIN_EXTERNAL_CLANG
+	help
+	  Set to the clang version that is used by your external
+	  toolchain.
+
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_4_0
+	bool "4.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_5_0
+	bool "5.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_6_0
+	bool "6.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_7_0
+	bool "7.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_9_0
+	bool "9.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_10_0
+	bool "10.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_11_0
+	bool "11.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_12_0
+	bool "12.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_13_0
+	bool "13.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_14_0
+	bool "14.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_15_0
+	bool "15.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_16_0
+	bool "16.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_17_0
+	bool "17.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_18_0
+	bool "18.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0
+	bool "19.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_20_0
+	bool "20.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+
+endchoice
+
 choice
 	bool "External toolchain kernel headers series"
 	default BR2_TOOLCHAIN_EXTERNAL_HEADERS_REALLY_OLD
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 05/12] toolchain/toolchain-external: skip "-march=" for hexagon
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (3 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 04/12] toolchain/toolchain-external: add support for clang Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 06/12] linux: add support for hexagon clang Brian Cain
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

For hexagon targets, clang rejects "-march" with:

    hexagon-unknown-linux-musl-clang: error: unsupported option '-march=' for target 'hexagon-unknown-linux-musl'

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 3948ad1107..8a7c4a5c1e 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -210,9 +210,11 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -m64
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_64
 endif
 ifneq ($(GCC_TARGET_ARCH),)
+ifneq ($(BR2_hexagon),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -march=$(GCC_TARGET_ARCH)
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(GCC_TARGET_ARCH)"'
 endif
+endif
 ifneq ($(GCC_TARGET_CPU),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mcpu=$(GCC_TARGET_CPU)
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_CPU='"$(GCC_TARGET_CPU)"'
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 06/12] linux: add support for hexagon clang
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (4 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 05/12] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 07/12] arch: add hexagon ARCH definition Brian Cain
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 linux/linux.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 469a80db9f..f5d2a9e763 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -170,6 +170,16 @@ LINUX_MAKE_FLAGS = \
 	REGENERATE_PARSERS=1 \
 	DEPMOD=$(HOST_DIR)/sbin/depmod
 
+ifeq ($(BR2_hexagon),y)
+LINUX_MAKE_FLAGS += \
+	AS=$(TARGET_CROSS)clang \
+	CC=$(TARGET_CROSS)clang \
+	LD=ld.lld \
+	LLVM_IAS=1 \
+	LLVM=1 \
+	$()
+endif
+
 ifeq ($(BR2_REPRODUCIBLE),y)
 LINUX_MAKE_ENV += \
 	KBUILD_BUILD_VERSION=1 \
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 07/12] arch: add hexagon ARCH definition
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (5 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 06/12] linux: add support for hexagon clang Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 08/12] package/hexagonMVM: new package Brian Cain
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 arch/Config.in.hexagon | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/Config.in.hexagon b/arch/Config.in.hexagon
index 9a7cb62278..4cf1e59e68 100644
--- a/arch/Config.in.hexagon
+++ b/arch/Config.in.hexagon
@@ -43,6 +43,12 @@ endchoice
 config BR2_ARCH
 	default "hexagon"
 
+config BR2_GCC_TARGET_ARCH
+	default "hexagon"
+
+config BR2_NORMALIZED_ARCH
+	default "hexagon"
+
 config BR2_ENDIAN
 	default "LITTLE"
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 08/12] package/hexagonMVM: new package
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (6 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 07/12] arch: add hexagon ARCH definition Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 09/12] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

MiniVM is a virtual machine used by the Linux kernel for
the hexagon architecture.

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 package/Config.in                  |  1 +
 package/hexagonMVM/Config.in       |  8 ++++++++
 package/hexagonMVM/hexagonMVM.hash |  5 +++++
 package/hexagonMVM/hexagonMVM.mk   | 27 +++++++++++++++++++++++++++
 4 files changed, 41 insertions(+)
 create mode 100644 package/hexagonMVM/Config.in
 create mode 100644 package/hexagonMVM/hexagonMVM.hash
 create mode 100644 package/hexagonMVM/hexagonMVM.mk

diff --git a/package/Config.in b/package/Config.in
index b43e11b806..97c15c274f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2816,6 +2816,7 @@ menu "System tools"
 	source "package/ftop/Config.in"
 	source "package/getent/Config.in"
 	source "package/gkrellm/Config.in"
+	source "package/hexagonMVM/Config.in"
 	source "package/htop/Config.in"
 	source "package/ibm-sw-tpm2/Config.in"
 	source "package/initscripts/Config.in"
diff --git a/package/hexagonMVM/Config.in b/package/hexagonMVM/Config.in
new file mode 100644
index 0000000000..b00666188b
--- /dev/null
+++ b/package/hexagonMVM/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HEXAGONMVM
+	bool "Hexagon MiniVM"
+	depends on BR2_hexagon && BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	help
+	  Hexagon VM implementation.  This virtual machine can be used
+	  to boot linux or other operating systems / programs.
+
+	  https://github.com/quic/hexagonMVM
diff --git a/package/hexagonMVM/hexagonMVM.hash b/package/hexagonMVM/hexagonMVM.hash
new file mode 100644
index 0000000000..a1830939d3
--- /dev/null
+++ b/package/hexagonMVM/hexagonMVM.hash
@@ -0,0 +1,5 @@
+
+#
+# Locally computed
+sha256  e5e3ba941af491cab37ece5db85eb7422db9dd0d13464ea528dbf2c01c24b5f0  LICENSE
+sha256  a2ad5745e597d8401f696cba27eaaedac4dd43ebe0835f11daf90a8e8c307fa7  0.1.3.tar.gz
diff --git a/package/hexagonMVM/hexagonMVM.mk b/package/hexagonMVM/hexagonMVM.mk
new file mode 100644
index 0000000000..33e45792e0
--- /dev/null
+++ b/package/hexagonMVM/hexagonMVM.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# Hexagon MiniVM
+#
+################################################################################
+
+HEXAGONMVM_VERSION = 0.1.3
+HEXAGONMVM_SOURCE = $(HEXAGONMVM_VERSION).tar.gz
+HEXAGONMVM_SITE = $(call github,quic,hexagonMVM,v$(HEXAGONMVM_VERSION))
+
+HEXAGONMVM_LICENSE = BSD-3-Clause
+HEXAGONMVM_LICENSE_FILES = LICENSE
+
+HEXAGONMVM_DEPENDENCIES =
+HEXAGONMVM_INSTALL_IMAGES = YES
+
+HEXAGONMVM_CFLAGS=-fno-pie -fno-pic
+
+define HEXAGONMVM_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" -C $(@D) minivm
+endef
+
+define HEXAGONMVM_INSTALL_IMAGES_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" bindir=$(BINARIES_DIR) -C $(@D) install
+endef
+
+$(eval $(generic-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 09/12] board/qcom/sa8775: add support for qcom sa8775-cdsp0
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (7 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 08/12] package/hexagonMVM: new package Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 10/12] configs: add hexagon QEMU config Brian Cain
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 board/qcom/sa8775/post_build.sh     |  9 ++++++++
 configs/qcom_sa8775_cdsp0_defconfig | 35 +++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100755 board/qcom/sa8775/post_build.sh
 create mode 100644 configs/qcom_sa8775_cdsp0_defconfig

diff --git a/board/qcom/sa8775/post_build.sh b/board/qcom/sa8775/post_build.sh
new file mode 100755
index 0000000000..af13225d58
--- /dev/null
+++ b/board/qcom/sa8775/post_build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+TARGETDIR=$1
+
+cat <<EOF >> "${TARGETDIR}/etc/fstab"
+devpts   /dev/pts              devpts  gid=5,mode=620  0 0
+/dev/vda /mnt/persist ext2 defaults 0 0
+debugfs  /sys/kernel/debug      debugfs  defaults  0 2
+EOF
diff --git a/configs/qcom_sa8775_cdsp0_defconfig b/configs/qcom_sa8775_cdsp0_defconfig
new file mode 100644
index 0000000000..e0b49869ca
--- /dev/null
+++ b/configs/qcom_sa8775_cdsp0_defconfig
@@ -0,0 +1,35 @@
+BR2_hexagon=y
+BR2_HEXAGON_v73=y
+BR2_STATIC_LIBS=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+BR2_TOOLCHAIN_EXTERNAL_CLANG=y
+BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+BR2_TOOLCHAIN_EXTERNAL_URL="https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.2/clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl.tar.xz"
+BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="x86_64-linux-gnu/bin"
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="hexagon-unknown-linux-musl"
+BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0=y
+BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_7=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
+BR2_TOOLCHAIN_EXTERNAL_CXX=y
+
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qcom/sa8775/post_build.sh"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_BZIP2=y
+BR2_PACKAGE_ZLIB=y
+BR2_PACKAGE_LOCKDEV=n
+BR2_PACKAGE_LIBEVENT=n
+BR2_PACKAGE_ATFTP=n
+BR2_PACKAGE_DROPBEAR=y
+BR2_PACKAGE_LSH=y
+
+BR2_PACKAGE_LUA=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_ZSH=y
+
+BR2_PACKAGE_HEXAGONMVM=y
+BR2_PACKAGE_XINETD=n
+BR2_PACKAGE_COREUTILS=y
+BR2_TARGET_ROOTFS_TAR_GZIP=y
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 10/12] configs: add hexagon QEMU config
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (8 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 09/12] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 11/12] DEVELOPERS: add myself as developer for hexagon Brian Cain
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 configs/qcom_dsp_qemu_defconfig | 44 +++++++++++++++++++++++++++++++++
 linux/linux.hash                |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 configs/qcom_dsp_qemu_defconfig

diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
new file mode 100644
index 0000000000..f9a976fb91
--- /dev/null
+++ b/configs/qcom_dsp_qemu_defconfig
@@ -0,0 +1,44 @@
+BR2_hexagon=y
+BR2_HEXAGON_v73=y
+BR2_SHARED_LIBS=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+BR2_TOOLCHAIN_EXTERNAL_CLANG=y
+BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+BR2_TOOLCHAIN_EXTERNAL_URL="https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.2/clang+llvm-19.1.2-cross-hexagon-unknown-linux-musl.tar.xz"
+BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="x86_64-linux-gnu/bin"
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="hexagon-unknown-linux-musl"
+BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0=y
+BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_7=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
+BR2_TOOLCHAIN_EXTERNAL_CXX=y
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qcom/sa8775/post_build.sh"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_BZIP2=y
+BR2_PACKAGE_ZLIB=y
+BR2_PACKAGE_LOCKDEV=n
+BR2_PACKAGE_LIBEVENT=n
+BR2_PACKAGE_ATFTP=n
+BR2_PACKAGE_DROPBEAR=y
+BR2_PACKAGE_LSH=y
+
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_ZSH=y
+
+BR2_PACKAGE_LIQUID_DSP=y
+BR2_PACKAGE_GNURADIO_FFT=y
+
+BR2_PACKAGE_XINETD=n
+BR2_PACKAGE_COREUTILS=y
+BR2_PACKAGE_HEXAGONMVM=y
+BR2_TARGET_ROOTFS_TAR_GZIP=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="bcain/boot_qemu_v6.11"
+BR2_LINUX_KERNEL_DEFCONFIG="qemu"
+
diff --git a/linux/linux.hash b/linux/linux.hash
index 5233de2b0b..ca5581d474 100644
--- a/linux/linux.hash
+++ b/linux/linux.hash
@@ -11,6 +11,7 @@ sha256  4e27cdf999359876a0ff489bff6ece7ba5798ff37c2289db0c9e9422a9014162  linux-
 # Locally computed
 sha256  fb0edc3c18e47d2b6974cb0880a0afb5c3fa08f50ee87dfdf24349405ea5f8ae  linux-cip-5.10.162-cip24.tar.gz
 sha256  b5539243f187e3d478d76d44ae13aab83952c94b885ad889df6fa9997e16a441  linux-cip-5.10.162-cip24-rt10.tar.gz
+sha256  a97a6fdc814b57b15107139978369d4efd1474142911e8f76b050874cc9ee3e4  linux-bcain_boot_qemu_v6.11-git4.tar.gz
 
 # Licenses hashes
 sha256  fb5a425bd3b3cd6071a3a9aff9909a859e7c1158d54d32e07658398cd67eb6a0  COPYING
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 11/12] DEVELOPERS: add myself as developer for hexagon
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (9 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 10/12] configs: add hexagon QEMU config Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-10-25 14:07 ` [Buildroot] [RFC 12/12] package: disable -ztext " Brian Cain
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 DEVELOPERS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 9afd19d406..81f9c0ad8f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3483,3 +3483,11 @@ F:	package/quazip/
 F:	package/shapelib/
 F:	package/simple-mail/
 F:	package/tinc/
+
+N:	Brian Cain <bcain@quicinc.com>
+F:	arch/Config.in.hexagon
+F:	board/qcom/
+F:	configs/qcom_sa8775_cdsp0_defconfig
+F:	configs/qcom_dsp_qemu_defconfig
+F:	package/hexagonMVM
+F:	toolchain/toolchain-external/toolchain-external-hexagon/
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC 12/12] package: disable -ztext for hexagon
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (10 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 11/12] DEVELOPERS: add myself as developer for hexagon Brian Cain
@ 2024-10-25 14:07 ` Brian Cain
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
  12 siblings, 0 replies; 44+ messages in thread
From: Brian Cain @ 2024-10-25 14:07 UTC (permalink / raw)
  To: buildroot; +Cc: Brian Cain

Without this commit, autotools compiler tests often fail with:

    hexagon-unknown-linux-musl-clang: error: unknown argument: '-ztext'

... but that's probably because we specified clang as LD and not lld.

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 package/Makefile.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index b54fe123ba..1f1b429462 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -171,8 +171,10 @@ TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 # "-z" to be passed and the "text" keyword to be dropped otherwise. Both
 # gcc and ld supports that, so it probably won't cause us problems.
 ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_STATIC_LIBS),y:)
+ifneq ($(BR2_hexagon),y)
 TARGET_LDFLAGS += -ztext
 endif
+endif
 
 # By design, _FORTIFY_SOURCE requires gcc optimization to be enabled.
 # Therefore, we need to pass _FORTIFY_SOURCE and the optimization level
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 00/14] add hexagon architecture
  2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
                   ` (11 preceding siblings ...)
  2024-10-25 14:07 ` [Buildroot] [RFC 12/12] package: disable -ztext " Brian Cain
@ 2024-12-19  5:30 ` Brian Cain
  2024-12-19  5:30   ` [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support Brian Cain via buildroot
                     ` (14 more replies)
  12 siblings, 15 replies; 44+ messages in thread
From: Brian Cain @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Status: rootfs build succeeds, limited testing so far.

Changes from RFC v1:
- Updated to 19.1.5 toolchain to fix some compiler driver+linker bugs
- switched QEMU config to BR2_SHARED_LIBS in order to enable more packages
- added workarounds to avoid the problems that occur w/SHARED

I'm sharing this series with the list for the sake of discussion about
how the approach taken could improve.  It's likely not quite ready for
upstreaming yet.

Brian Cain (14):
  arch: add hexagon architecture support
  toolchain/toolchain-external: add hexagon toolchain support
  toolchain/toolchain-external: add hexagon support for
    toolchain-wrapper
  toolchain/toolchain-external: add support for clang
  toolchain/toolchain-external: skip "-march=" for hexagon
  linux: add support for hexagon clang
  arch: add hexagon ARCH definition
  package/hexagonMVM: new package
  board/qcom/sa8775: add support for qcom sa8775-cdsp0
  configs: add hexagon QEMU config
  DEVELOPERS: add myself as developer for hexagon
  toolchain: disable PIE for hexagon
  configs: switch hexagon QEMU to SHARED
  package: disable -ztext

 DEVELOPERS                                    |  8 ++
 arch/Config.in                                | 10 +++
 arch/Config.in.hexagon                        | 69 +++++++++++++++++
 board/qcom/sa8775/post_build.sh               |  9 +++
 configs/qcom_dsp_qemu_defconfig               | 49 ++++++++++++
 configs/qcom_sa8775_cdsp0_defconfig           | 35 +++++++++
 linux/linux.hash                              |  1 +
 linux/linux.mk                                | 10 +++
 package/Config.in                             |  1 +
 package/Makefile.in                           | 28 +++++--
 package/hexagonMVM/Config.in                  |  8 ++
 package/hexagonMVM/hexagonMVM.hash            |  5 ++
 package/hexagonMVM/hexagonMVM.mk              | 27 +++++++
 toolchain/Config.in                           | 56 +++++++++++++-
 toolchain/helpers.mk                          | 16 ++++
 toolchain/toolchain-external/Config.in        |  6 ++
 .../pkg-toolchain-external.mk                 | 42 ++++++++--
 .../Config.in.options                         | 76 +++++++++++++++++++
 .../toolchain-external-hexagon/Config.in      |  7 ++
 .../Config.in.options                         | 10 +++
 .../toolchain-external-hexagon.hash           |  6 ++
 .../toolchain-external-hexagon.mk             | 11 +++
 22 files changed, 479 insertions(+), 11 deletions(-)
 create mode 100644 arch/Config.in.hexagon
 create mode 100755 board/qcom/sa8775/post_build.sh
 create mode 100644 configs/qcom_dsp_qemu_defconfig
 create mode 100644 configs/qcom_sa8775_cdsp0_defconfig
 create mode 100644 package/hexagonMVM/Config.in
 create mode 100644 package/hexagonMVM/hexagonMVM.hash
 create mode 100644 package/hexagonMVM/hexagonMVM.mk
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 10:54     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support Brian Cain via buildroot
                     ` (13 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 arch/Config.in         | 10 +++++++
 arch/Config.in.hexagon | 63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 arch/Config.in.hexagon

diff --git a/arch/Config.in b/arch/Config.in
index e57f4b2baa..fe863e50a7 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -254,6 +254,12 @@ config BR2_xtensa
 	  http://en.wikipedia.org/wiki/Xtensa
 	  http://www.tensilica.com/
 
+config BR2_hexagon
+	bool "Hexagon"
+	select BR2_USE_MMU
+	help
+	  Hexagon is a Qualcomm DSP processor.
+
 endchoice
 
 # For some architectures or specific cores, our internal toolchain
@@ -429,6 +435,10 @@ if BR2_xtensa
 source "arch/Config.in.xtensa"
 endif
 
+if BR2_hexagon
+source "arch/Config.in.hexagon"
+endif
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
diff --git a/arch/Config.in.hexagon b/arch/Config.in.hexagon
new file mode 100644
index 0000000000..9a7cb62278
--- /dev/null
+++ b/arch/Config.in.hexagon
@@ -0,0 +1,63 @@
+# hexagon cpu features
+config BR2_HEXAGON_CPU_HAS_HVX
+	bool
+
+choice
+	prompt "Target Architecture Variant"
+	default BR2_HEXAGON_v65
+	help
+	  Specific CPU variant to use
+
+config BR2_HEXAGON_v5
+	bool "v5"
+config BR2_HEXAGON_v55
+	bool "v55"
+config BR2_HEXAGON_v60
+	bool "v60"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v61
+	bool "v61"
+config BR2_HEXAGON_v62
+	bool "v62"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v65
+	bool "v65"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v66
+	bool "v66"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v68
+	bool "v68"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v69
+	bool "v69"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v71
+	bool "v71"
+	select BR2_HEXAGON_CPU_HAS_HVX
+config BR2_HEXAGON_v73
+	bool "v73"
+	select BR2_HEXAGON_CPU_HAS_HVX
+endchoice
+
+config BR2_ARCH
+	default "hexagon"
+
+config BR2_ENDIAN
+	default "LITTLE"
+
+config BR2_READELF_ARCH_NAME
+	default "Qualcomm Hexagon"
+
+config BR2_GCC_TARGET_CPU
+	default "hexagonv5"	if BR2_HEXAGON_v5
+	default "hexagonv55"	if BR2_HEXAGON_v55
+	default "hexagonv60"	if BR2_HEXAGON_v60
+	default "hexagonv61"	if BR2_HEXAGON_v61
+	default "hexagonv62"	if BR2_HEXAGON_v62
+	default "hexagonv65"	if BR2_HEXAGON_v65
+	default "hexagonv66"	if BR2_HEXAGON_v66
+	default "hexagonv68"	if BR2_HEXAGON_v68
+	default "hexagonv69"	if BR2_HEXAGON_v69
+	default "hexagonv71"	if BR2_HEXAGON_v71
+	default "hexagonv73"	if BR2_HEXAGON_v73
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
  2024-12-19  5:30   ` [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 10:58     ` Thomas Petazzoni
  2024-12-19  5:30   ` [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain via buildroot
                     ` (12 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 toolchain/toolchain-external/Config.in                |  6 ++++++
 .../toolchain-external-hexagon/Config.in              |  7 +++++++
 .../toolchain-external-hexagon/Config.in.options      | 10 ++++++++++
 .../toolchain-external-hexagon.hash                   |  6 ++++++
 .../toolchain-external-hexagon.mk                     | 11 +++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index e91aa16326..7bd5309671 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -29,6 +29,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in"
 # MIPS
 source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in"
 
+# Hexagon
+source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in"
+
 # Bootlin toolchains, available for virtually all architectures
 source "toolchain/toolchain-external/toolchain-external-bootlin/Config.in"
 
@@ -123,6 +126,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in.opt
 # ARM big-endian
 source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in.options"
 
+# Hexagon
+source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options"
+
 # MIPS
 source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in.options"
 
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/Config.in b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
new file mode 100644
index 0000000000..256eeb87dc
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
@@ -0,0 +1,7 @@
+comment "Toolchains available for Hexagon DSP"
+
+config BR2_TOOLCHAIN_EXTERNAL_HEXAGON
+	bool "Clang/LLVM Hexagon Toolchain"
+	depends on BR2_HOSTARCH = "x86_64" || "aarch64"
+	select BR2_TOOLCHAIN_EXTERNAL_CLANG
+	select BR2_TOOLCHAIN_EXTERNAL_MUSL
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
new file mode 100644
index 0000000000..84611fdd9a
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
@@ -0,0 +1,10 @@
+
+if BR2_TOOLCHAIN_EXTERNAL_HEXAGON
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+	default "hexagon-unknown-linux-musl"
+
+config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
+	default "toolchain-external-hexagon"
+
+endif
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
new file mode 100644
index 0000000000..acaa7bbe24
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
@@ -0,0 +1,6 @@
+# From https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.5/SHA256SUMS:
+sha256 55b41922318f6331590ab7baa7f5dbdd99c109327a9c44a52c5e9878fab148c1  clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl.tar.zst
+sha256 7dd6137d3e6f1516f9b2cf252ef3ca6b5b5b1f24e27423c69d88c32d51d6b483  clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl_aarch64-linux-gnu.tar.zst
+sha256 91795d124c81d27c3829404627a2a06dab0a8683078ac898520d4a81e8853958  clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl_aarch64-windows-gnu.tar.zst
+sha256 f41736f98d6d1d6f03ce6e2b6a032dca9c8d7eba126ca21acce9df7b695c41b0  clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl_x86_64-linux-musl.tar.zst
+sha256 3cacc3cd0e5e531d91a9c70953d6793523c9b954e901a56d02c6b926cbca8690  clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl_x86_64-windows-gnu.tar.zst
diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk
new file mode 100644
index 0000000000..59e763a2e4
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk
@@ -0,0 +1,11 @@
+################################################################################
+#
+# toolchain-external-hexagon
+#
+################################################################################
+
+TOOLCHAIN_EXTERNAL_HEXAGON_VERSION = 19.1.5
+TOOLCHAIN_EXTERNAL_HEXAGON_SITE= https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/$(TOOLCHAIN_EXTERNAL_HEXAGON_VERSION)
+TOOLCHAIN_EXTERNAL_HEXAGON_SOURCE = clang+llvm-$(TOOLCHAIN_EXTERNAL_HEXAGON_VERSION)-cross-$(TOOLCHAIN_EXTERNAL_PREFIX).tar.zst
+
+$(eval $(toolchain-external-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
  2024-12-19  5:30   ` [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support Brian Cain via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:01     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 04/14] toolchain/toolchain-external: add support for clang Brian Cain via buildroot
                     ` (11 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 .../toolchain-external/pkg-toolchain-external.mk      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index c08bf0a653..d45f2c54de 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -150,8 +150,14 @@ endef
 endif
 
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
+ifeq ($(BR2_hexagon),y)
+TOOLCHAIN_EXTERNAL_LIBS += libc.so libclang_rt.builtins-hexagon.so*
+TOOLCHAIN_EXTERNAL_LIBS += libc++.so* libc++abi.so* libunwind.so*
+TOOLCHAIN_EXTERNAL_LIBS += ld-musl-*.so*
+else
 TOOLCHAIN_EXTERNAL_LIBS += libc.so
 endif
+endif
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
 TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
@@ -283,7 +289,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
 		*-ar|*-ranlib|*-nm) \
 			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
 			;; \
-		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc) \
+		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc|*clang) \
 			ln -sf toolchain-wrapper $$base; \
 			;; \
 		*gdb|*gdbtui) \
@@ -465,6 +471,9 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	else \
 		ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
 	fi ; \
+	if test "$(BR2_hexagon)" = "y"; then \
+		SUPPORT_LIB_DIR=$(TOOLCHAIN_EXTERNAL_BIN)/../target/$(TOOLCHAIN_EXTERNAL_PREFIX); \
+	fi ; \
 	$(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \
 	$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
 endef
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 04/14] toolchain/toolchain-external: add support for clang
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (2 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain via buildroot
                     ` (10 subsequent siblings)
  14 siblings, 0 replies; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 package/Makefile.in                           | 24 ++++--
 toolchain/Config.in                           | 54 +++++++++++++
 toolchain/helpers.mk                          | 16 ++++
 .../pkg-toolchain-external.mk                 | 29 ++++++-
 .../Config.in.options                         | 76 +++++++++++++++++++
 5 files changed, 190 insertions(+), 9 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 829636900b..0d60e76bff 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -231,14 +231,28 @@ ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7),y)
 TARGET_GCC_WRAPPERS_PREFIX = gcc-
 endif
 
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
+TARGET_CC_SUFFIX=clang
+TARGET_CXX_SUFFIX=clang++
+TARGET_AS_SUFFIX=llvm-mc
+TARGET_LD_SUFFIX=ld.lld
+TARGET_PREPROCESSOR=clang -E
+else
+TARGET_CC_SUFFIX=gcc
+TARGET_CXX_SUFFIX=g++
+TARGET_AS_SUFFIX=as
+TARGET_LD_SUFFIX=ld
+TARGET_PREPROCESSOR=cpp
+endif
+
 # Define TARGET_xx variables for all common binutils/gcc
 TARGET_AR       = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)ar
-TARGET_AS       = $(TARGET_CROSS)as
-TARGET_CC       = $(TARGET_CROSS)gcc
-TARGET_CPP      = $(TARGET_CROSS)cpp
-TARGET_CXX      = $(TARGET_CROSS)g++
+TARGET_AS       = $(TARGET_CROSS)$(TARGET_AS_SUFFIX)
+TARGET_CC       = $(TARGET_CROSS)$(TARGET_CC_SUFFIX)
+TARGET_CPP      = $(TARGET_CROSS)$(TARGET_PREPROCESSOR)
+TARGET_CXX      = $(TARGET_CROSS)$(TARGET_CXX_SUFFIX)
 TARGET_FC       = $(TARGET_CROSS)gfortran
-TARGET_LD       = $(TARGET_CROSS)ld
+TARGET_LD       = $(TARGET_CROSS)$(TARGET_LD_SUFFIX)
 TARGET_NM       = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)nm
 TARGET_RANLIB   = $(TARGET_CROSS)$(TARGET_GCC_WRAPPERS_PREFIX)ranlib
 TARGET_READELF  = $(TARGET_CROSS)readelf
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 87160af3d7..4354fde340 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -842,6 +842,60 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST
 	default "4.4"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
 	default "4.3"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
 
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	bool
+config BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+	bool
+
+# This order guarantees that the highest version is set, as kconfig
+# stops affecting a value on the first matching default.
+config BR2_TOOLCHAIN_CLANG_AT_LEAST
+	string
+	default "4.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+	default "5.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+	default "6.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+	default "7.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+	default "9.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+	default "10.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+	default "11.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+	default "12.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+	default "13.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+	default "14.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+	default "15.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+	default "16.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+	default "17.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+	default "18.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+	default "19.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	default "20.0"	if BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+
 config BR2_TOOLCHAIN_HAS_MNAN_OPTION
 	bool
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index f3fdaaec07..f4462db483 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -224,6 +224,22 @@ check_glibc_rpc_feature = \
 		exit 1 ; \
 	fi
 
+check_clang_version = \
+	expected_version="$(strip $2)" ; \
+	exit 0; \
+	real_version=`$(TOOLCHAIN_EXTERNAL_BIN)/llvm-config --version;`; \
+	if [ -z "$${expected_version}" ]; then \
+		printf "Internal error, __$${2}__ vs __$${expected_version}__ clang version unknown (no CLANG_AT_LEAST_X_Y selected)\n"; \
+		printf "real ver: __$${real_version}__\n"; \
+		exit 1 ; \
+	fi; \
+	real_version=`$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-llvm-config --version;`; \
+	if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \
+	printf "Incorrect selection of clang version: expected %s.x, got %s\n" \
+			"$${expected_version}" "$${real_version}" ; \
+		exit 1 ; \
+	fi
+
 #
 # Check the correctness of a glibc external toolchain configuration.
 #  1. Check that the C library selected in Buildroot matches the one
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index d45f2c54de..cc36b0bcfd 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -90,12 +90,28 @@ endif
 TOOLCHAIN_EXTERNAL_SUFFIX = \
 	$(if $(wildcard $(TOOLCHAIN_EXTERNAL_BIN)/*.br_real),.br_real)
 
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
+TARGET_CC_SUFFIX=clang
+TARGET_CXX_SUFFIX=clang++
+TARGET_BINUTILS_PREFIX=llvm-
+TARGET_LD_SUFFIX=ld.lld
+else
+TARGET_CC_SUFFIX=gcc
+TARGET_CXX_SUFFIX=g++
+TARGET_BINUTILS_PREFIX=
+TARGET_LD_SUFFIX=ld
+endif
+
 TOOLCHAIN_EXTERNAL_CROSS = $(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
-TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)gcc$(TOOLCHAIN_EXTERNAL_SUFFIX)
-TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)g++$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)$(TARGET_CC_SUFFIX)$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)$(TARGET_CXX_SUFFIX)$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_GDC = $(TOOLCHAIN_EXTERNAL_CROSS)gdc$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_FC = $(TOOLCHAIN_EXTERNAL_CROSS)gfortran$(TOOLCHAIN_EXTERNAL_SUFFIX)
 TOOLCHAIN_EXTERNAL_READELF = $(TOOLCHAIN_EXTERNAL_CROSS)readelf
+TOOLCHAIN_EXTERNAL_LLVM_CONFIG = $(TOOLCHAIN_EXTERNAL_CROSS)llvm-config$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_CLANG_VERSION = \
+    `$(TOOLCHAIN_EXTERNAL_LLVM_CONFIG) --version | \
+     sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
 
 # Normal handling of downloaded toolchain tarball extraction.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
@@ -595,8 +611,13 @@ define $(2)_CONFIGURE_CMDS
 		$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC)),\
 		$$(call qstrip,$$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)),\
 		$$(if $$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM),loose,strict)); \
-	$$(call check_gcc_version,$$(TOOLCHAIN_EXTERNAL_CC),\
-		$$(call qstrip,$$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \
+	if test "$(BR2_TOOLCHAIN_EXTERNAL_GCC)" = "y" ; then \
+		$(call check_gcc_version,$(TOOLCHAIN_EXTERNAL_CC),\
+			$(call qstrip,$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \
+	else \
+		$(call check_clang_version,$(TOOLCHAIN_EXTERNAL_CC),\
+			$(call qstrip,$(BR2_TOOLCHAIN_CLANG_AT_LEAST))); \
+	fi ; \
 	if test "$$(BR2_arm)" = "y" ; then \
 		$$(call check_arm_abi,\
 			"$$(TOOLCHAIN_EXTERNAL_CC) $$(TOOLCHAIN_EXTERNAL_CFLAGS)") ; \
diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
index 2dc04747b3..cdf6c8f5db 100644
--- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
+++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
@@ -40,8 +40,25 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 	  so you can leave this option at default value if you use them
 	  as external toolchain.
 
+choice
+	bool "External toolchain Compiler"
+	default BR2_TOOLCHAIN_EXTERNAL_GCC
+	help
+	  Select between gcc and clang
+
+config BR2_TOOLCHAIN_EXTERNAL_GCC
+	bool "gcc"
+	select BR2_TOOLCHAIN_USES_GCC
+
+config BR2_TOOLCHAIN_EXTERNAL_CLANG
+	bool "clang"
+	select BR2_TOOLCHAIN_USES_CLANG
+
+endchoice
+
 choice
 	bool "External toolchain gcc version"
+	depends on BR2_TOOLCHAIN_EXTERNAL_GCC
 	help
 	  Set to the gcc version that is used by your external
 	  toolchain.
@@ -146,6 +163,65 @@ endchoice
 comment "GCC older than 4.8 is not tested by Buildroot. Use at your own risk."
 	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 
+choice
+	bool "External toolchain clang version"
+	default BR2_TOOLCHAIN_EXTERNAL_CLANG_4_0
+	depends on BR2_TOOLCHAIN_EXTERNAL_CLANG
+	help
+	  Set to the clang version that is used by your external
+	  toolchain.
+
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_4_0
+	bool "4.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_4_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_5_0
+	bool "5.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_5_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_6_0
+	bool "6.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_6_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_7_0
+	bool "7.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_7_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_9_0
+	bool "9.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_9_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_10_0
+	bool "10.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_10_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_11_0
+	bool "11.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_11_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_12_0
+	bool "12.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_12_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_13_0
+	bool "13.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_13_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_14_0
+	bool "14.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_14_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_15_0
+	bool "15.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_15_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_16_0
+	bool "16.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_16_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_17_0
+	bool "17.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_17_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_18_0
+	bool "18.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_18_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0
+	bool "19.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+config BR2_TOOLCHAIN_EXTERNAL_CLANG_20_0
+	bool "20.0"
+	select BR2_TOOLCHAIN_CLANG_AT_LEAST_20_0
+
+endchoice
+
 choice
 	bool "External toolchain kernel headers series"
 	default BR2_TOOLCHAIN_EXTERNAL_HEADERS_REALLY_OLD
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (3 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 04/14] toolchain/toolchain-external: add support for clang Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:03     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang Brian Cain via buildroot
                     ` (9 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

For hexagon targets, clang rejects "-march" with:

    hexagon-unknown-linux-musl-clang: error: unsupported option '-march=' for target 'hexagon-unknown-linux-musl'

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index cc36b0bcfd..44891e638f 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -210,9 +210,11 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -m64
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_64
 endif
 ifneq ($(GCC_TARGET_ARCH),)
+ifneq ($(BR2_hexagon),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -march=$(GCC_TARGET_ARCH)
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(GCC_TARGET_ARCH)"'
 endif
+endif
 ifneq ($(GCC_TARGET_CPU),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mcpu=$(GCC_TARGET_CPU)
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_CPU='"$(GCC_TARGET_CPU)"'
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (4 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:04     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition Brian Cain via buildroot
                     ` (8 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 linux/linux.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 1d3d8fffa6..f6385856d6 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -170,6 +170,16 @@ LINUX_MAKE_FLAGS = \
 	REGENERATE_PARSERS=1 \
 	DEPMOD=$(HOST_DIR)/sbin/depmod
 
+ifeq ($(BR2_hexagon),y)
+LINUX_MAKE_FLAGS += \
+	AS=$(TARGET_CROSS)clang \
+	CC=$(TARGET_CROSS)clang \
+	LD=$(TARGET_CROSS)ld.lld \
+	LLVM_IAS=1 \
+	LLVM=1 \
+	$()
+endif
+
 ifeq ($(BR2_REPRODUCIBLE),y)
 LINUX_MAKE_ENV += \
 	KBUILD_BUILD_VERSION=1 \
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (5 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:05     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package Brian Cain via buildroot
                     ` (7 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 arch/Config.in.hexagon | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/Config.in.hexagon b/arch/Config.in.hexagon
index 9a7cb62278..4cf1e59e68 100644
--- a/arch/Config.in.hexagon
+++ b/arch/Config.in.hexagon
@@ -43,6 +43,12 @@ endchoice
 config BR2_ARCH
 	default "hexagon"
 
+config BR2_GCC_TARGET_ARCH
+	default "hexagon"
+
+config BR2_NORMALIZED_ARCH
+	default "hexagon"
+
 config BR2_ENDIAN
 	default "LITTLE"
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (6 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:08     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
                     ` (6 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

MiniVM is a virtual machine used by the Linux kernel for
the hexagon architecture.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 package/Config.in                  |  1 +
 package/hexagonMVM/Config.in       |  8 ++++++++
 package/hexagonMVM/hexagonMVM.hash |  5 +++++
 package/hexagonMVM/hexagonMVM.mk   | 27 +++++++++++++++++++++++++++
 4 files changed, 41 insertions(+)
 create mode 100644 package/hexagonMVM/Config.in
 create mode 100644 package/hexagonMVM/hexagonMVM.hash
 create mode 100644 package/hexagonMVM/hexagonMVM.mk

diff --git a/package/Config.in b/package/Config.in
index 5fa344c321..87d2ecfb9c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2828,6 +2828,7 @@ menu "System tools"
 	source "package/ftop/Config.in"
 	source "package/getent/Config.in"
 	source "package/gkrellm/Config.in"
+	source "package/hexagonMVM/Config.in"
 	source "package/htop/Config.in"
 	source "package/ibm-sw-tpm2/Config.in"
 	source "package/initscripts/Config.in"
diff --git a/package/hexagonMVM/Config.in b/package/hexagonMVM/Config.in
new file mode 100644
index 0000000000..b00666188b
--- /dev/null
+++ b/package/hexagonMVM/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HEXAGONMVM
+	bool "Hexagon MiniVM"
+	depends on BR2_hexagon && BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0
+	help
+	  Hexagon VM implementation.  This virtual machine can be used
+	  to boot linux or other operating systems / programs.
+
+	  https://github.com/quic/hexagonMVM
diff --git a/package/hexagonMVM/hexagonMVM.hash b/package/hexagonMVM/hexagonMVM.hash
new file mode 100644
index 0000000000..3e1ae8e2b4
--- /dev/null
+++ b/package/hexagonMVM/hexagonMVM.hash
@@ -0,0 +1,5 @@
+
+#
+# Locally computed
+sha256  e5e3ba941af491cab37ece5db85eb7422db9dd0d13464ea528dbf2c01c24b5f0  LICENSE
+sha256  5345cd83b18b6b8f44d06a54bd1a518d447c311dc1c3ba7b45ffa16785e66e1b  0.2.0.tar.gz
diff --git a/package/hexagonMVM/hexagonMVM.mk b/package/hexagonMVM/hexagonMVM.mk
new file mode 100644
index 0000000000..7b3529c14c
--- /dev/null
+++ b/package/hexagonMVM/hexagonMVM.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# Hexagon MiniVM
+#
+################################################################################
+
+HEXAGONMVM_VERSION = 0.2.0
+HEXAGONMVM_SOURCE = $(HEXAGONMVM_VERSION).tar.gz
+HEXAGONMVM_SITE = $(call github,quic,hexagonMVM,v$(HEXAGONMVM_VERSION))
+
+HEXAGONMVM_LICENSE = BSD-3-Clause
+HEXAGONMVM_LICENSE_FILES = LICENSE
+
+HEXAGONMVM_DEPENDENCIES =
+HEXAGONMVM_INSTALL_IMAGES = YES
+
+HEXAGONMVM_CFLAGS=-fno-pie -fno-pic
+
+define HEXAGONMVM_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" -C $(@D) minivm
+endef
+
+define HEXAGONMVM_INSTALL_IMAGES_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" bindir=$(BINARIES_DIR) -C $(@D) install
+endef
+
+$(eval $(generic-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (7 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain
  2025-02-05 11:28     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config Brian Cain via buildroot
                     ` (5 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 board/qcom/sa8775/post_build.sh     |  9 ++++++++
 configs/qcom_sa8775_cdsp0_defconfig | 35 +++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100755 board/qcom/sa8775/post_build.sh
 create mode 100644 configs/qcom_sa8775_cdsp0_defconfig

diff --git a/board/qcom/sa8775/post_build.sh b/board/qcom/sa8775/post_build.sh
new file mode 100755
index 0000000000..af13225d58
--- /dev/null
+++ b/board/qcom/sa8775/post_build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+TARGETDIR=$1
+
+cat <<EOF >> "${TARGETDIR}/etc/fstab"
+devpts   /dev/pts              devpts  gid=5,mode=620  0 0
+/dev/vda /mnt/persist ext2 defaults 0 0
+debugfs  /sys/kernel/debug      debugfs  defaults  0 2
+EOF
diff --git a/configs/qcom_sa8775_cdsp0_defconfig b/configs/qcom_sa8775_cdsp0_defconfig
new file mode 100644
index 0000000000..f9363c930f
--- /dev/null
+++ b/configs/qcom_sa8775_cdsp0_defconfig
@@ -0,0 +1,35 @@
+BR2_hexagon=y
+BR2_HEXAGON_v73=y
+BR2_STATIC_LIBS=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+BR2_TOOLCHAIN_EXTERNAL_CLANG=y
+BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+BR2_TOOLCHAIN_EXTERNAL_URL="https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.5/clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl.tar.zst"
+BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="x86_64-linux-gnu/bin"
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="hexagon-unknown-linux-musl"
+BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0=y
+BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_7=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
+BR2_TOOLCHAIN_EXTERNAL_CXX=y
+
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qcom/sa8775/post_build.sh"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_BZIP2=y
+BR2_PACKAGE_ZLIB=y
+BR2_PACKAGE_LOCKDEV=n
+BR2_PACKAGE_LIBEVENT=n
+BR2_PACKAGE_ATFTP=n
+BR2_PACKAGE_DROPBEAR=y
+BR2_PACKAGE_LSH=y
+
+BR2_PACKAGE_LUA=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_ZSH=y
+
+BR2_PACKAGE_HEXAGONMVM=y
+BR2_PACKAGE_XINETD=n
+BR2_PACKAGE_COREUTILS=y
+BR2_TARGET_ROOTFS_TAR_GZIP=y
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (8 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:26     ` Thomas Petazzoni
  2024-12-19  5:30   ` [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon Brian Cain via buildroot
                     ` (4 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 configs/qcom_dsp_qemu_defconfig | 44 +++++++++++++++++++++++++++++++++
 linux/linux.hash                |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 configs/qcom_dsp_qemu_defconfig

diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
new file mode 100644
index 0000000000..cc9b7157ad
--- /dev/null
+++ b/configs/qcom_dsp_qemu_defconfig
@@ -0,0 +1,44 @@
+BR2_hexagon=y
+BR2_HEXAGON_v73=y
+BR2_STATIC_LIBS=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+BR2_TOOLCHAIN_EXTERNAL_CLANG=y
+BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+BR2_TOOLCHAIN_EXTERNAL_URL="https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.5/clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl.tar.zst"
+BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="x86_64-linux-gnu/bin"
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="hexagon-unknown-linux-musl"
+BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0=y
+BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_7=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
+BR2_TOOLCHAIN_EXTERNAL_CXX=y
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qcom/sa8775/post_build.sh"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_BZIP2=y
+BR2_PACKAGE_ZLIB=y
+BR2_PACKAGE_LOCKDEV=n
+BR2_PACKAGE_LIBEVENT=n
+BR2_PACKAGE_ATFTP=n
+BR2_PACKAGE_DROPBEAR=y
+BR2_PACKAGE_LSH=y
+
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_ZSH=y
+
+BR2_PACKAGE_LIQUID_DSP=y
+BR2_PACKAGE_GNURADIO_FFT=y
+
+BR2_PACKAGE_XINETD=n
+BR2_PACKAGE_COREUTILS=y
+BR2_PACKAGE_HEXAGONMVM=y
+BR2_TARGET_ROOTFS_TAR_GZIP=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="bcain/boot_qemu_v6.11"
+BR2_LINUX_KERNEL_DEFCONFIG="qemu"
+
diff --git a/linux/linux.hash b/linux/linux.hash
index ccf6235166..3c5eaea676 100644
--- a/linux/linux.hash
+++ b/linux/linux.hash
@@ -9,6 +9,7 @@ sha256  0d0ffae5bf0e6f9c6a1ce42da2bc2a8696ca55721c103497eb1245be8cc04b20  linux-
 # Locally computed
 sha256  fb0edc3c18e47d2b6974cb0880a0afb5c3fa08f50ee87dfdf24349405ea5f8ae  linux-cip-5.10.162-cip24.tar.gz
 sha256  b5539243f187e3d478d76d44ae13aab83952c94b885ad889df6fa9997e16a441  linux-cip-5.10.162-cip24-rt10.tar.gz
+sha256  a97a6fdc814b57b15107139978369d4efd1474142911e8f76b050874cc9ee3e4  linux-bcain_boot_qemu_v6.11-git4.tar.gz
 
 # Licenses hashes
 sha256  fb5a425bd3b3cd6071a3a9aff9909a859e7c1158d54d32e07658398cd67eb6a0  COPYING
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (9 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:28     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 12/14] toolchain: disable PIE " Brian Cain
                     ` (3 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 DEVELOPERS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 047dc4a88f..6f111b7294 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3449,3 +3449,11 @@ F:	package/quazip/
 F:	package/shapelib/
 F:	package/simple-mail/
 F:	package/tinc/
+
+N:	Brian Cain <brian.cain@oss.qualcomm.com>
+F:	arch/Config.in.hexagon
+F:	board/qcom/
+F:	configs/qcom_sa8775_cdsp0_defconfig
+F:	configs/qcom_dsp_qemu_defconfig
+F:	package/hexagonMVM/
+F:	toolchain/toolchain-external/toolchain-external-hexagon/
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 12/14] toolchain: disable PIE for hexagon
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (10 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain
  2025-02-05 11:29     ` Thomas Petazzoni
  2024-12-19  5:30   ` [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED Brian Cain via buildroot
                     ` (2 subsequent siblings)
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Without this change, dav1d fails to detect atomics:

    Command line: `/local/mnt/workspace/upstream/obj_br_qemu/host/bin/hexagon-unknown-linux-musl-clang /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpvgk6hjv0/testfile.c -o /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpvgk6hjv0/output.obj -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -g0 -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -std=c99 -D_GNU_SOURCE` -> 1
    stderr:
    hexagon-unknown-linux-musl-clang: error: argument unused during compilation: '-pie' [-Werror,-Wunused-command-line-argument]
    -----------
    Checking if "GCC-style atomics" compiles: NO

Because the toolchain wrapper adds linker args to compiler invocations and
-Werror=unused-command-line-argument is enabled, it fails here.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 toolchain/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 4354fde340..e650236e06 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -34,7 +34,7 @@ config BR2_TOOLCHAIN_USES_MUSL
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_STATIC_LIBS
+	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_STATIC_LIBS && !BR2_hexagon
 
 choice
 	prompt "Toolchain type"
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (11 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 12/14] toolchain: disable PIE " Brian Cain
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:30     ` Thomas Petazzoni via buildroot
  2024-12-19  5:30   ` [Buildroot] [RFC v2 14/14] package: disable -ztext Brian Cain via buildroot
  2025-02-05 10:49   ` [Buildroot] [RFC v2 00/14] add hexagon architecture Thomas Petazzoni via buildroot
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

While we're making this change, set RELRO=NONE because clang rejects
linker args when passed to compiler invocation (from the toolchain-wrapper):

    Command line: `/local/mnt/workspace/upstream/obj_br_qemu/host/bin/hexagon-unknown-linux-musl-clang /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpe68fyhas/testfile.c -o /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpe68fyhas/output.obj -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -g0 -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -std=c99 -D_GNU_SOURCE` -> 1
    stderr:
    hexagon-unknown-linux-musl-clang: error: -Wl,-z,now: 'linker' input unused [-Werror,-Wunused-command-line-argument]
    hexagon-unknown-linux-musl-clang: error: -Wl,-z,relro: 'linker' input unused [-Werror,-Wunused-command-line-argument]

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 configs/qcom_dsp_qemu_defconfig | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
index cc9b7157ad..dbfc8f1adf 100644
--- a/configs/qcom_dsp_qemu_defconfig
+++ b/configs/qcom_dsp_qemu_defconfig
@@ -1,6 +1,6 @@
 BR2_hexagon=y
 BR2_HEXAGON_v73=y
-BR2_STATIC_LIBS=y
+BR2_SHARED_LIBS=y
 BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
 BR2_TOOLCHAIN_EXTERNAL_CLANG=y
@@ -28,11 +28,16 @@ BR2_PACKAGE_BASH=y
 BR2_PACKAGE_ZSH=y
 
 BR2_PACKAGE_LIQUID_DSP=y
+BR2_PACKAGE_DAV1D=y
+BR2_PACKAGE_CMAKE=y
+BR2_PACKAGE_LUA=y
 BR2_PACKAGE_GNURADIO_FFT=y
 
+BR2_RELRO_NONE=y
+
 BR2_PACKAGE_XINETD=n
 BR2_PACKAGE_COREUTILS=y
-BR2_PACKAGE_HEXAGONMVM=y
+BR2_PACKAGE_HEXAGONMVM=n
 BR2_TARGET_ROOTFS_TAR_GZIP=y
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [RFC v2 14/14] package: disable -ztext
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (12 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED Brian Cain via buildroot
@ 2024-12-19  5:30   ` Brian Cain via buildroot
  2025-02-05 11:33     ` Thomas Petazzoni
  2025-02-05 10:49   ` [Buildroot] [RFC v2 00/14] add hexagon architecture Thomas Petazzoni via buildroot
  14 siblings, 1 reply; 44+ messages in thread
From: Brian Cain via buildroot @ 2024-12-19  5:30 UTC (permalink / raw)
  To: buildroot, thomas.petazzoni; +Cc: brian.cain

Disable -ztext argument because it causes a failure when ncurses does
feature testing of the toolchain:

    configure:1931: $? = 1
    configure:1951: checking for C compiler default output
    configure:1954: /local/mnt/workspace/upstream/obj_br_qemu/host/bin/hexagon-unknown-linux-musl-clang -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -ztext conftest.c  >&5
    hexagon-unknown-linux-musl-clang: error: unknown argument: '-ztext'
    configure:1957: $? = 1
    configure: failed program was:
    #line 1935 "configure"
    #include "confdefs.h"

    int
    main (void)
    {

      ;
      return 0;
    }
    configure:1980: error: C compiler cannot create executables

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 package/Makefile.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index 0d60e76bff..e4da9d2ff6 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -171,8 +171,12 @@ TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 # "-z" to be passed and the "text" keyword to be dropped otherwise. Both
 # gcc and ld supports that, so it probably won't cause us problems.
 ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
+TARGET_LDFLAGS += -Wl,-ztext
+else
 TARGET_LDFLAGS += -ztext
 endif
+endif
 
 # By design, _FORTIFY_SOURCE requires gcc optimization to be enabled.
 # Therefore, we need to pass _FORTIFY_SOURCE and the optimization level
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 00/14] add hexagon architecture
  2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
                     ` (13 preceding siblings ...)
  2024-12-19  5:30   ` [Buildroot] [RFC v2 14/14] package: disable -ztext Brian Cain via buildroot
@ 2025-02-05 10:49   ` Thomas Petazzoni via buildroot
  2025-03-10  0:44     ` Brian Cain via buildroot
  14 siblings, 1 reply; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 10:49 UTC (permalink / raw)
  To: Brian Cain; +Cc: buildroot

Hello Brian,

On Wed, 18 Dec 2024 21:30:39 -0800
Brian Cain <brian.cain@oss.qualcomm.com> wrote:

> I'm sharing this series with the list for the sake of discussion about
> how the approach taken could improve.  It's likely not quite ready for
> upstreaming yet.

Thanks for this series. Could you share some more details about the
Hexagon architecture, what is its current usage and use cases, roadmap?
Indeed, adding support for a new architecture in Buildroot means that
our autobuilders will try building all packages for this architecture,
which will certainly raise a large number of issues, which you will
have to address as a maintainer of this CPU architecture. How committed
are you to this effort?

This is even more significant as your proposal is to support this
architecture with Clang as a compiler, which will certainly break a LOT
of packages, causing even more troubles.

So what you're proposing here is certainly very interesting, but it's a
really large endeavor, and we need to understand whether you'll still
be around in 6 or 12 months to support this and address issues.

I'm going to reply to the individual patches with some more comments,
but I think this top-level discussion is the most important.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support
  2024-12-19  5:30   ` [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support Brian Cain via buildroot
@ 2025-02-05 10:54     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 10:54 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:40 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

A non-empty commit log would be useful here, at least to introduce the
CPU architecture main characteristics, use-cases, why Buildroot matters
for this CPU architecture, etc.

> ---
>  arch/Config.in         | 10 +++++++
>  arch/Config.in.hexagon | 63 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 73 insertions(+)
>  create mode 100644 arch/Config.in.hexagon

Please add yourself as the maintainer of  this CPU architecture in the
DEVELOPERS as part of this patch. I see you did it in a separate patch,
but we like to have changes in the DEVELOPERS file together with the
commit adding the changes.

> 
> diff --git a/arch/Config.in b/arch/Config.in
> index e57f4b2baa..fe863e50a7 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -254,6 +254,12 @@ config BR2_xtensa
>  	  http://en.wikipedia.org/wiki/Xtensa
>  	  http://www.tensilica.com/
>  
> +config BR2_hexagon

Please comply with alphabetic ordering of the CPU architectures.

> +	bool "Hexagon"
> +	select BR2_USE_MMU
> +	help
> +	  Hexagon is a Qualcomm DSP processor.
> +
>  endchoice

Another issue is that right after applying this patch, Buildroot allows
me to build an internal toolchain for this architecture (with upstream
gcc, binutils, glibc/uclibc/musl). My understanding is that this most
likely won't work, so it needs to be somehow disabled. So you need your
architecture to select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT so that
building with a Buildroot toolchain is not offered.

To be honest, I am not sure we want to support an architecture that can
only be built using an external toolchain.

Also, does Hexagon has support in gcc/binutils ? Adding this new
architecture *and* supporting it only with Clang is really doing two
big things at once, which is only going to complicate stuff a lot.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support
  2024-12-19  5:30   ` [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support Brian Cain via buildroot
@ 2025-02-05 10:58     ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2025-02-05 10:58 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

Hello Brian,

On Wed, 18 Dec 2024 21:30:41 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  toolchain/toolchain-external/Config.in                |  6 ++++++
>  .../toolchain-external-hexagon/Config.in              |  7 +++++++
>  .../toolchain-external-hexagon/Config.in.options      | 10 ++++++++++
>  .../toolchain-external-hexagon.hash                   |  6 ++++++
>  .../toolchain-external-hexagon.mk                     | 11 +++++++++++
>  5 files changed, 40 insertions(+)

Please update the DEVELOPERS file as part of this commit.

>  create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in
>  create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options
>  create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash
>  create mode 100644 toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk

I believe the toolchain should be perhaps be named
toolchain-external-linaro-hexagon toolchain. Indeed,
toolchain-external-hexagon is too generic, and could be a name for
*any* hexagon toolchain.

> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index e91aa16326..7bd5309671 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -29,6 +29,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in"
>  # MIPS
>  source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in"
>  
> +# Hexagon
> +source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in"
> +
>  # Bootlin toolchains, available for virtually all architectures
>  source "toolchain/toolchain-external/toolchain-external-bootlin/Config.in"
>  
> @@ -123,6 +126,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in.opt
>  # ARM big-endian
>  source "toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in.options"
>  
> +# Hexagon
> +source "toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options"
> +
>  # MIPS
>  source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in.options"
>  
> diff --git a/toolchain/toolchain-external/toolchain-external-hexagon/Config.in b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
> new file mode 100644
> index 0000000000..256eeb87dc
> --- /dev/null
> +++ b/toolchain/toolchain-external/toolchain-external-hexagon/Config.in
> @@ -0,0 +1,7 @@
> +comment "Toolchains available for Hexagon DSP"
> +
> +config BR2_TOOLCHAIN_EXTERNAL_HEXAGON
> +	bool "Clang/LLVM Hexagon Toolchain"
> +	depends on BR2_HOSTARCH = "x86_64" || "aarch64"
> +	select BR2_TOOLCHAIN_EXTERNAL_CLANG

As of commit PATCH 02, this Config.in symbol doesn't exist, so you need
to adjust the order of the patches so that it gets added earlier.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper
  2024-12-19  5:30   ` [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain via buildroot
@ 2025-02-05 11:01     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:01 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

Hello,

On Wed, 18 Dec 2024 21:30:42 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

This commit needs a non-empty commit message. Also, I don't think this
commit is really hexagon related, but more Clang related.

> diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index c08bf0a653..d45f2c54de 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -150,8 +150,14 @@ endef
>  endif
>  
>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
> +ifeq ($(BR2_hexagon),y)
> +TOOLCHAIN_EXTERNAL_LIBS += libc.so libclang_rt.builtins-hexagon.so*
> +TOOLCHAIN_EXTERNAL_LIBS += libc++.so* libc++abi.so* libunwind.so*
> +TOOLCHAIN_EXTERNAL_LIBS += ld-musl-*.so*

None of this is hexagon related, to this exception of
libclang_rt.builtins-hexagon.so*. So this should be organized properly,
with I guess libc++.so* libc++abi.so* being added when
BR2_TOOLCHAIN_EXTERNAL_CLANG=y. Perhaps
libclang_rt.builtins-$(BR2_ARCH).so* as well.

I'm not sure about libunwind.so*. Also unclear why ld-musl-*.so* is
needed here, and not for other musl toolchains. To be clarified.

> +else
>  TOOLCHAIN_EXTERNAL_LIBS += libc.so
>  endif
> +endif
>  
>  ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
>  TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
> @@ -283,7 +289,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
>  		*-ar|*-ranlib|*-nm) \
>  			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
>  			;; \
> -		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc) \
> +		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc|*clang) \

Related to clang support.

>  			ln -sf toolchain-wrapper $$base; \
>  			;; \
>  		*gdb|*gdbtui) \
> @@ -465,6 +471,9 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
>  	else \
>  		ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
>  	fi ; \
> +	if test "$(BR2_hexagon)" = "y"; then \
> +		SUPPORT_LIB_DIR=$(TOOLCHAIN_EXTERNAL_BIN)/../target/$(TOOLCHAIN_EXTERNAL_PREFIX); \
> +	fi ; \

Is this really hexagon specific? Or specific to Clang? Or specific to
the particular external toolchain? I'm pretty sure the BR2_hexagon
condition is incorrect here.

Are there other Clang external toolchains, for other CPU architectures,
that we could use to test what is generic Clang stuff vs. what is
perhaps Hexagon-specific?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon
  2024-12-19  5:30   ` [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain via buildroot
@ 2025-02-05 11:03     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:03 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:44 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index cc36b0bcfd..44891e638f 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -210,9 +210,11 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -m64
>  TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_64
>  endif
>  ifneq ($(GCC_TARGET_ARCH),)
> +ifneq ($(BR2_hexagon),y)
>  TOOLCHAIN_EXTERNAL_CFLAGS += -march=$(GCC_TARGET_ARCH)
>  TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(GCC_TARGET_ARCH)"'
>  endif

Why is this needed? You don't set BR2_GCC_TARGET_ARCH in
arch/Config.in.hexagon, so GCC_TARGET_ARCH should I believe be empty,
and therefore this code should not kick-in.

If not, please clarify, and please have a non-empty commit log.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang
  2024-12-19  5:30   ` [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang Brian Cain via buildroot
@ 2025-02-05 11:04     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:04 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:45 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> +ifeq ($(BR2_hexagon),y)

Not exagon related, but related to clang.

> +LINUX_MAKE_FLAGS += \
> +	AS=$(TARGET_CROSS)clang \
> +	CC=$(TARGET_CROSS)clang \
> +	LD=$(TARGET_CROSS)ld.lld \

What about AS=$(TARGET_AS), CC=$(TARGET_CC) and LD=$(TARGET_LD)
instead, and have those variables properly defined in
package/Makefile.in?

> +	LLVM_IAS=1 \
> +	LLVM=1 \
> +	$()

What is this lingering $() ?

Also, needs a non-empty commit message.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition
  2024-12-19  5:30   ` [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition Brian Cain via buildroot
@ 2025-02-05 11:05     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:05 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:46 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  arch/Config.in.hexagon | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/Config.in.hexagon b/arch/Config.in.hexagon
> index 9a7cb62278..4cf1e59e68 100644
> --- a/arch/Config.in.hexagon
> +++ b/arch/Config.in.hexagon
> @@ -43,6 +43,12 @@ endchoice
>  config BR2_ARCH
>  	default "hexagon"
>  
> +config BR2_GCC_TARGET_ARCH
> +	default "hexagon"

Ah, that's why you get a non-empty $(GCC_TARGET_ARCH) in PATCH 05/14.
If you don't want any -march value, drop this variable.

> +config BR2_NORMALIZED_ARCH
> +	default "hexagon"

Should go in PATCH 01/14, together with the introduction of
arch/Config.in.hexagon.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package
  2024-12-19  5:30   ` [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package Brian Cain via buildroot
@ 2025-02-05 11:08     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:08 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

Hello,

On Wed, 18 Dec 2024 21:30:47 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> MiniVM is a virtual machine used by the Linux kernel for
> the hexagon architecture.

Is it "MiniVM" or hexagonMVM ? Also, with your definition, I'm really
unclear about what hexagonMVM really is. Is it a VM that runs under
Linux? Or the VM under which Linux runs? Or?

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  package/Config.in                  |  1 +
>  package/hexagonMVM/Config.in       |  8 ++++++++
>  package/hexagonMVM/hexagonMVM.hash |  5 +++++
>  package/hexagonMVM/hexagonMVM.mk   | 27 +++++++++++++++++++++++++++
>  4 files changed, 41 insertions(+)

Package name should be lower-case. Maybe hexagon-mvm.

Please update the DEVELOPERS file in this file.

> diff --git a/package/hexagonMVM/Config.in b/package/hexagonMVM/Config.in
> new file mode 100644
> index 0000000000..b00666188b
> --- /dev/null
> +++ b/package/hexagonMVM/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_HEXAGONMVM
> +	bool "Hexagon MiniVM"
> +	depends on BR2_hexagon && BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0

BR2_TOOLCHAIN_CLANG_AT_LEAST_19_0 doesn't exist as of this commit, so
you have a patch ordering issue.

> +	help
> +	  Hexagon VM implementation.  This virtual machine can be used
> +	  to boot linux or other operating systems / programs.

Ah so its the VM under which Linux runs?

> +
> +	  https://github.com/quic/hexagonMVM
> diff --git a/package/hexagonMVM/hexagonMVM.hash b/package/hexagonMVM/hexagonMVM.hash
> new file mode 100644
> index 0000000000..3e1ae8e2b4
> --- /dev/null
> +++ b/package/hexagonMVM/hexagonMVM.hash
> @@ -0,0 +1,5 @@
> +
> +#

Minor: drop those two lines.

> +# Locally computed
> +sha256  e5e3ba941af491cab37ece5db85eb7422db9dd0d13464ea528dbf2c01c24b5f0  LICENSE
> +sha256  5345cd83b18b6b8f44d06a54bd1a518d447c311dc1c3ba7b45ffa16785e66e1b  0.2.0.tar.gz

Tarball first, license file afterwards. The tarball name is not good,
but I'll comment on that later.

> diff --git a/package/hexagonMVM/hexagonMVM.mk b/package/hexagonMVM/hexagonMVM.mk
> new file mode 100644
> index 0000000000..7b3529c14c
> --- /dev/null
> +++ b/package/hexagonMVM/hexagonMVM.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# Hexagon MiniVM
> +#
> +################################################################################
> +
> +HEXAGONMVM_VERSION = 0.2.0
> +HEXAGONMVM_SOURCE = $(HEXAGONMVM_VERSION).tar.gz

Drop this line, it will give the tarball a proper name.

> +HEXAGONMVM_SITE = $(call github,quic,hexagonMVM,v$(HEXAGONMVM_VERSION))
> +
> +HEXAGONMVM_LICENSE = BSD-3-Clause
> +HEXAGONMVM_LICENSE_FILES = LICENSE
> +
> +HEXAGONMVM_DEPENDENCIES =

If there are no dependencies, just keep it empty.

> +HEXAGONMVM_INSTALL_IMAGES = YES
> +
> +HEXAGONMVM_CFLAGS=-fno-pie -fno-pic

Spaces around = sign. Why aren't those flags in the package
makefile/build-system already?

> +define HEXAGONMVM_BUILD_CMDS
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" -C $(@D) minivm
> +endef
> +
> +define HEXAGONMVM_INSTALL_IMAGES_CMDS
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(HEXAGONMVM_CFLAGS)" bindir=$(BINARIES_DIR) -C $(@D) install
> +endef
> +
> +$(eval $(generic-package))

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config
  2024-12-19  5:30   ` [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config Brian Cain via buildroot
@ 2025-02-05 11:26     ` Thomas Petazzoni
  2025-03-04 21:16       ` Brian Cain via buildroot
  0 siblings, 1 reply; 44+ messages in thread
From: Thomas Petazzoni @ 2025-02-05 11:26 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

Hello Brian,

On Wed, 18 Dec 2024 21:30:49 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Nice to see that there is Qemu support! Is this supported in upstream
Qemu?

> diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
> new file mode 100644
> index 0000000000..cc9b7157ad
> --- /dev/null
> +++ b/configs/qcom_dsp_qemu_defconfig
> @@ -0,0 +1,44 @@
> +BR2_hexagon=y
> +BR2_HEXAGON_v73=y
> +BR2_STATIC_LIBS=y

This is changed in a follow-up patch, which isn't good, please use the
correct setting from the start.

> +BR2_TOOLCHAIN_EXTERNAL=y
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y

Why don't you use the toolchain-external-hexagon package here?

> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
> +BR2_ROOTFS_DEVICE_CREATION_STATIC=y

We really want to use the default for this.

> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> +BR2_PACKAGE_BZIP2=y
> +BR2_PACKAGE_ZLIB=y
> +BR2_PACKAGE_LOCKDEV=n
> +BR2_PACKAGE_LIBEVENT=n
> +BR2_PACKAGE_ATFTP=n
> +BR2_PACKAGE_DROPBEAR=y
> +BR2_PACKAGE_LSH=y
> +
> +BR2_PACKAGE_BASH=y
> +BR2_PACKAGE_ZSH=y
> +
> +BR2_PACKAGE_LIQUID_DSP=y
> +BR2_PACKAGE_GNURADIO_FFT=y
> +
> +BR2_PACKAGE_XINETD=n
> +BR2_PACKAGE_COREUTILS=y
> +BR2_PACKAGE_HEXAGONMVM=y

Please remove all of this custom package selection, except
BR2_PACKAGE_HEXAGONMVM=y maybe if it's really needed for the platform
to boot.

> +BR2_TARGET_ROOTFS_TAR_GZIP=y
> +BR2_TARGET_ROOTFS_INITRAMFS=y
> +
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_GIT=y
> +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git"
> +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="bcain/boot_qemu_v6.11"

Is this a branch or a target? We don't want to use a branch.

> +BR2_LINUX_KERNEL_DEFCONFIG="qemu"
> +

Also, please add a board/qemu/ directory for this configuration, with a
readme.txt. In particular, the readme.txt should include the exact Qemu
command line to use to boot the system.


> diff --git a/linux/linux.hash b/linux/linux.hash
> index ccf6235166..3c5eaea676 100644
> --- a/linux/linux.hash
> +++ b/linux/linux.hash
> @@ -9,6 +9,7 @@ sha256  0d0ffae5bf0e6f9c6a1ce42da2bc2a8696ca55721c103497eb1245be8cc04b20  linux-
>  # Locally computed
>  sha256  fb0edc3c18e47d2b6974cb0880a0afb5c3fa08f50ee87dfdf24349405ea5f8ae  linux-cip-5.10.162-cip24.tar.gz
>  sha256  b5539243f187e3d478d76d44ae13aab83952c94b885ad889df6fa9997e16a441  linux-cip-5.10.162-cip24-rt10.tar.gz
> +sha256  a97a6fdc814b57b15107139978369d4efd1474142911e8f76b050874cc9ee3e4  linux-bcain_boot_qemu_v6.11-git4.tar.gz

Nope, you cannot "pollute" linux/linux.hash with your custom hash. Look
at other defconfigs, they use BR2_GLOBAL_PATCH_DIRECTORY to provide
additional hash files.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0
  2024-12-19  5:30   ` [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
@ 2025-02-05 11:28     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:28 UTC (permalink / raw)
  To: Brian Cain; +Cc: buildroot

Hello Brian,

On Wed, 18 Dec 2024 21:30:48 -0800
Brian Cain <brian.cain@oss.qualcomm.com> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Needs a non-empty commit log with some details about what this platform
is.

> diff --git a/board/qcom/sa8775/post_build.sh b/board/qcom/sa8775/post_build.sh
> new file mode 100755
> index 0000000000..af13225d58
> --- /dev/null
> +++ b/board/qcom/sa8775/post_build.sh
> @@ -0,0 +1,9 @@
> +#!/bin/bash
> +
> +TARGETDIR=$1

Not needed, just use ${TARGET_DIR} which is passed in the environment.

> +
> +cat <<EOF >> "${TARGETDIR}/etc/fstab"
> +devpts   /dev/pts              devpts  gid=5,mode=620  0 0
> +/dev/vda /mnt/persist ext2 defaults 0 0
> +debugfs  /sys/kernel/debug      debugfs  defaults  0 2
> +EOF

Why is this needed in the first place?

Also, the way you do it (always appending) means that if you run "make;
make; make" in Buildroot, you will have those 3 lines added 3 times,
which isn't good.

> diff --git a/configs/qcom_sa8775_cdsp0_defconfig b/configs/qcom_sa8775_cdsp0_defconfig
> new file mode 100644
> index 0000000000..f9363c930f
> --- /dev/null
> +++ b/configs/qcom_sa8775_cdsp0_defconfig
> @@ -0,0 +1,35 @@
> +BR2_hexagon=y
> +BR2_HEXAGON_v73=y
> +BR2_STATIC_LIBS=y

You can't use shared libraries?

> +BR2_TOOLCHAIN_EXTERNAL=y
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y

Use the toolchain-external-hexagon package.

> +BR2_TOOLCHAIN_EXTERNAL_CLANG=y
> +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> +BR2_TOOLCHAIN_EXTERNAL_URL="https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/19.1.5/clang+llvm-19.1.5-cross-hexagon-unknown-linux-musl.tar.zst"
> +BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="x86_64-linux-gnu/bin"
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="hexagon-unknown-linux-musl"
> +BR2_TOOLCHAIN_EXTERNAL_CLANG_19_0=y
> +BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_7=y
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> +BR2_TOOLCHAIN_EXTERNAL_CXX=y
> +
> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
> +BR2_ROOTFS_DEVICE_CREATION_STATIC=y

Use the default for /dev management.

> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/qcom/sa8775/post_build.sh"
> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> +BR2_PACKAGE_BZIP2=y
> +BR2_PACKAGE_ZLIB=y
> +BR2_PACKAGE_LOCKDEV=n
> +BR2_PACKAGE_LIBEVENT=n
> +BR2_PACKAGE_ATFTP=n
> +BR2_PACKAGE_DROPBEAR=y
> +BR2_PACKAGE_LSH=y
> +
> +BR2_PACKAGE_LUA=y
> +BR2_PACKAGE_BASH=y
> +BR2_PACKAGE_ZSH=y
> +
> +BR2_PACKAGE_HEXAGONMVM=y
> +BR2_PACKAGE_XINETD=n
> +BR2_PACKAGE_COREUTILS=y

Keep the default package selection.

> +BR2_TARGET_ROOTFS_TAR_GZIP=y

How is the rootfs then used?

All defconfigs must have a matching readme.txt file somewhere in board/
that explains how to practically use, and most notably how to make use
of the build results.

Also, make sure to update the DEVELOPERS file as part of this patch for
the newly added files.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon
  2024-12-19  5:30   ` [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon Brian Cain via buildroot
@ 2025-02-05 11:28     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:28 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:50 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> +N:	Brian Cain <brian.cain@oss.qualcomm.com>
> +F:	arch/Config.in.hexagon
> +F:	board/qcom/
> +F:	configs/qcom_sa8775_cdsp0_defconfig
> +F:	configs/qcom_dsp_qemu_defconfig
> +F:	package/hexagonMVM/
> +F:	toolchain/toolchain-external/toolchain-external-hexagon/

As discussed in my reply to other patches, this should be spread
between each patch adding the different files.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 12/14] toolchain: disable PIE for hexagon
  2024-12-19  5:30   ` [Buildroot] [RFC v2 12/14] toolchain: disable PIE " Brian Cain
@ 2025-02-05 11:29     ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2025-02-05 11:29 UTC (permalink / raw)
  To: Brian Cain; +Cc: buildroot

On Wed, 18 Dec 2024 21:30:51 -0800
Brian Cain <brian.cain@oss.qualcomm.com> wrote:

> Without this change, dav1d fails to detect atomics:
> 
>     Command line: `/local/mnt/workspace/upstream/obj_br_qemu/host/bin/hexagon-unknown-linux-musl-clang /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpvgk6hjv0/testfile.c -o /local/mnt/workspace/upstream/obj_br_qemu/build/dav1d-1.5.0/build/meson-private/tmpvgk6hjv0/output.obj -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -g0 -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -std=c99 -D_GNU_SOURCE` -> 1
>     stderr:
>     hexagon-unknown-linux-musl-clang: error: argument unused during compilation: '-pie' [-Werror,-Wunused-command-line-argument]
>     -----------
>     Checking if "GCC-style atomics" compiles: NO
> 
> Because the toolchain wrapper adds linker args to compiler invocations and
> -Werror=unused-command-line-argument is enabled, it fails here.
> 
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  toolchain/Config.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index 4354fde340..e650236e06 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -34,7 +34,7 @@ config BR2_TOOLCHAIN_USES_MUSL
>  	select BR2_TOOLCHAIN_HAS_THREADS
>  	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
>  	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
> -	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_STATIC_LIBS
> +	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_STATIC_LIBS && !BR2_hexagon

Isn't that rather related to the fact that Clang is used?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED
  2024-12-19  5:30   ` [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED Brian Cain via buildroot
@ 2025-02-05 11:30     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-02-05 11:30 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:52 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
> index cc9b7157ad..dbfc8f1adf 100644
> --- a/configs/qcom_dsp_qemu_defconfig
> +++ b/configs/qcom_dsp_qemu_defconfig
> @@ -1,6 +1,6 @@
>  BR2_hexagon=y
>  BR2_HEXAGON_v73=y
> -BR2_STATIC_LIBS=y
> +BR2_SHARED_LIBS=y

Put this in the initial patch introducing the defconfig.

>  BR2_TOOLCHAIN_EXTERNAL=y
>  BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
>  BR2_TOOLCHAIN_EXTERNAL_CLANG=y
> @@ -28,11 +28,16 @@ BR2_PACKAGE_BASH=y
>  BR2_PACKAGE_ZSH=y
>  
>  BR2_PACKAGE_LIQUID_DSP=y
> +BR2_PACKAGE_DAV1D=y
> +BR2_PACKAGE_CMAKE=y
> +BR2_PACKAGE_LUA=y

No custom packages in upstream defconfigs: they are supposed to be minimal.

>  BR2_PACKAGE_GNURADIO_FFT=y
>  
> +BR2_RELRO_NONE=y

If relro breaks with Clang, then the option needs to have a dependency
on !clang.

>  BR2_PACKAGE_XINETD=n
>  BR2_PACKAGE_COREUTILS=y
> -BR2_PACKAGE_HEXAGONMVM=y
> +BR2_PACKAGE_HEXAGONMVM=n

Spurious change?

>  BR2_TARGET_ROOTFS_TAR_GZIP=y
>  BR2_TARGET_ROOTFS_INITRAMFS=y

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 14/14] package: disable -ztext
  2024-12-19  5:30   ` [Buildroot] [RFC v2 14/14] package: disable -ztext Brian Cain via buildroot
@ 2025-02-05 11:33     ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2025-02-05 11:33 UTC (permalink / raw)
  To: Brian Cain via buildroot; +Cc: Brian Cain

On Wed, 18 Dec 2024 21:30:53 -0800
Brian Cain via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  package/Makefile.in | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 0d60e76bff..e4da9d2ff6 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -171,8 +171,12 @@ TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
>  # "-z" to be passed and the "text" keyword to be dropped otherwise. Both
>  # gcc and ld supports that, so it probably won't cause us problems.
>  ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_STATIC_LIBS),y:)
> +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CLANG),y)
> +TARGET_LDFLAGS += -Wl,-ztext
> +else
>  TARGET_LDFLAGS += -ztext

The problem with -Wl,-ztext, at least with gcc toolchains is that sometimes
the $(TARGET_LDFLAGS) get passed to the linker directly, and the linker
(at least from binutils) doesn't understand -Wl,-ztext, it only
understand -ztext. See Buildroot commit
bd035872be9948515ee50ae034bda4a2e044ff22.

Of course, perhaps things are different with the linker used in Clang
toolchains, I don't know.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config
  2025-02-05 11:26     ` Thomas Petazzoni
@ 2025-03-04 21:16       ` Brian Cain via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Brian Cain via buildroot @ 2025-03-04 21:16 UTC (permalink / raw)
  To: Thomas Petazzoni, Brian Cain via buildroot


On 2/5/2025 5:26 AM, Thomas Petazzoni wrote:
> Hello Brian,
>
> On Wed, 18 Dec 2024 21:30:49 -0800
> Brian Cain via buildroot <buildroot@buildroot.org> wrote:
>
>> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> Nice to see that there is Qemu support! Is this supported in upstream
> Qemu?


Not yet - there's a downstream fork in github.com/quic/qemu/ and patches 
under review for upstream.


>> diff --git a/configs/qcom_dsp_qemu_defconfig b/configs/qcom_dsp_qemu_defconfig
>> new file mode 100644
>> index 0000000000..cc9b7157ad
>> --- /dev/null
>> +++ b/configs/qcom_dsp_qemu_defconfig
>> @@ -0,0 +1,44 @@
>> +BR2_hexagon=y
>> +BR2_HEXAGON_v73=y
>> +BR2_STATIC_LIBS=y
> This is changed in a follow-up patch, which isn't good, please use the
> correct setting from the start.
>
>> +BR2_TOOLCHAIN_EXTERNAL=y
>> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> Why don't you use the toolchain-external-hexagon package here?
>
>> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
>> +BR2_ROOTFS_DEVICE_CREATION_STATIC=y
> We really want to use the default for this.
>
>> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
>> +BR2_PACKAGE_BZIP2=y
>> +BR2_PACKAGE_ZLIB=y
>> +BR2_PACKAGE_LOCKDEV=n
>> +BR2_PACKAGE_LIBEVENT=n
>> +BR2_PACKAGE_ATFTP=n
>> +BR2_PACKAGE_DROPBEAR=y
>> +BR2_PACKAGE_LSH=y
>> +
>> +BR2_PACKAGE_BASH=y
>> +BR2_PACKAGE_ZSH=y
>> +
>> +BR2_PACKAGE_LIQUID_DSP=y
>> +BR2_PACKAGE_GNURADIO_FFT=y
>> +
>> +BR2_PACKAGE_XINETD=n
>> +BR2_PACKAGE_COREUTILS=y
>> +BR2_PACKAGE_HEXAGONMVM=y
> Please remove all of this custom package selection, except
> BR2_PACKAGE_HEXAGONMVM=y maybe if it's really needed for the platform
> to boot.
>
>> +BR2_TARGET_ROOTFS_TAR_GZIP=y
>> +BR2_TARGET_ROOTFS_INITRAMFS=y
>> +
>> +BR2_LINUX_KERNEL=y
>> +BR2_LINUX_KERNEL_CUSTOM_GIT=y
>> +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git"
>> +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="bcain/boot_qemu_v6.11"
> Is this a branch or a target? We don't want to use a branch.
>
>> +BR2_LINUX_KERNEL_DEFCONFIG="qemu"
>> +
> Also, please add a board/qemu/ directory for this configuration, with a
> readme.txt. In particular, the readme.txt should include the exact Qemu
> command line to use to boot the system.
>
>
>> diff --git a/linux/linux.hash b/linux/linux.hash
>> index ccf6235166..3c5eaea676 100644
>> --- a/linux/linux.hash
>> +++ b/linux/linux.hash
>> @@ -9,6 +9,7 @@ sha256  0d0ffae5bf0e6f9c6a1ce42da2bc2a8696ca55721c103497eb1245be8cc04b20  linux-
>>   # Locally computed
>>   sha256  fb0edc3c18e47d2b6974cb0880a0afb5c3fa08f50ee87dfdf24349405ea5f8ae  linux-cip-5.10.162-cip24.tar.gz
>>   sha256  b5539243f187e3d478d76d44ae13aab83952c94b885ad889df6fa9997e16a441  linux-cip-5.10.162-cip24-rt10.tar.gz
>> +sha256  a97a6fdc814b57b15107139978369d4efd1474142911e8f76b050874cc9ee3e4  linux-bcain_boot_qemu_v6.11-git4.tar.gz
> Nope, you cannot "pollute" linux/linux.hash with your custom hash. Look
> at other defconfigs, they use BR2_GLOBAL_PATCH_DIRECTORY to provide
> additional hash files.

Sorry!  I should have been clearer about this series - it's definitely 
not ready to land as-is.  Thanks for taking your time to review these 
patches and I'll address your comments.

These "bcain" references are for the sake of others who might like to 
reproduce the configuration.  I will not include references to my kernel 
tree for inclusion in buildroot. :)


> Thanks!
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [RFC v2 00/14] add hexagon architecture
  2025-02-05 10:49   ` [Buildroot] [RFC v2 00/14] add hexagon architecture Thomas Petazzoni via buildroot
@ 2025-03-10  0:44     ` Brian Cain via buildroot
  0 siblings, 0 replies; 44+ messages in thread
From: Brian Cain via buildroot @ 2025-03-10  0:44 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot


On 2/5/2025 4:49 AM, Thomas Petazzoni wrote:
> Hello Brian,
>
> On Wed, 18 Dec 2024 21:30:39 -0800
> Brian Cain <brian.cain@oss.qualcomm.com> wrote:
>
>> I'm sharing this series with the list for the sake of discussion about
>> how the approach taken could improve.  It's likely not quite ready for
>> upstreaming yet.
> Thanks for this series. Could you share some more details about the
> Hexagon architecture, what is its current usage and use cases, roadmap?
> Indeed, adding support for a new architecture in Buildroot means that
> our autobuilders will try building all packages for this architecture,
> which will certainly raise a large number of issues, which you will
> have to address as a maintainer of this CPU architecture. How committed
> are you to this effort?
>
> This is even more significant as your proposal is to support this
> architecture with Clang as a compiler, which will certainly break a LOT
> of packages, causing even more troubles.
>
> So what you're proposing here is certainly very interesting, but it's a
> really large endeavor, and we need to understand whether you'll still
> be around in 6 or 12 months to support this and address issues.


You bring up good points.  The use cases for the hexagon architecture 
are so far: DSPs in Qualcomm SoCs.  They're used as energy-efficient 
computation offload, audio devices, sensors, cell modems and more.

The roadmap is not clear to me - my team's role is primarily focused on 
developer tools.  And unfortunately buildroot and linux support for this 
architecture may not be a commercial priority (yet?).  But my team is 
interested in promoting it and exploring the capability.  I'll help 
raise and/or fix bugs in the packages that are uncovered by building 
with clang (as well with clang, LLVM bugs exposed by the packages, if any).

I'm not planning to go anywhere :)

At the same time, it feels like we're really just scratching the 
surface.  So first off we'll mitigate the issues you raised and revisit 
things after that, if it's okay w/you.


> I'm going to reply to the individual patches with some more comments,
> but I think this top-level discussion is the most important.
>
> Thanks!
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2025-03-10  1:29 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 14:07 [Buildroot] [RFC 00/12] add hexagon architecture Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 01/12] arch: add hexagon architecture support Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 02/12] toolchain/toolchain-external: add hexagon toolchain support Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 03/12] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 04/12] toolchain/toolchain-external: add support for clang Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 05/12] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 06/12] linux: add support for hexagon clang Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 07/12] arch: add hexagon ARCH definition Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 08/12] package/hexagonMVM: new package Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 09/12] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 10/12] configs: add hexagon QEMU config Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 11/12] DEVELOPERS: add myself as developer for hexagon Brian Cain
2024-10-25 14:07 ` [Buildroot] [RFC 12/12] package: disable -ztext " Brian Cain
2024-12-19  5:30 ` [Buildroot] [RFC v2 00/14] add hexagon architecture Brian Cain
2024-12-19  5:30   ` [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support Brian Cain via buildroot
2025-02-05 10:54     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support Brian Cain via buildroot
2025-02-05 10:58     ` Thomas Petazzoni
2024-12-19  5:30   ` [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper Brian Cain via buildroot
2025-02-05 11:01     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 04/14] toolchain/toolchain-external: add support for clang Brian Cain via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon Brian Cain via buildroot
2025-02-05 11:03     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang Brian Cain via buildroot
2025-02-05 11:04     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition Brian Cain via buildroot
2025-02-05 11:05     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package Brian Cain via buildroot
2025-02-05 11:08     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0 Brian Cain
2025-02-05 11:28     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config Brian Cain via buildroot
2025-02-05 11:26     ` Thomas Petazzoni
2025-03-04 21:16       ` Brian Cain via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon Brian Cain via buildroot
2025-02-05 11:28     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 12/14] toolchain: disable PIE " Brian Cain
2025-02-05 11:29     ` Thomas Petazzoni
2024-12-19  5:30   ` [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED Brian Cain via buildroot
2025-02-05 11:30     ` Thomas Petazzoni via buildroot
2024-12-19  5:30   ` [Buildroot] [RFC v2 14/14] package: disable -ztext Brian Cain via buildroot
2025-02-05 11:33     ` Thomas Petazzoni
2025-02-05 10:49   ` [Buildroot] [RFC v2 00/14] add hexagon architecture Thomas Petazzoni via buildroot
2025-03-10  0:44     ` Brian Cain via buildroot

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