Skip to contentSkip to conversation

add hexagon architecture

RFC New Brian Cain 4 participants 44 messages Oct 25, 2024 – Mar 10, 2025

lore
Share & tools
lore

Brian Cain

author
#0 lore raw

cover add hexagon architecture

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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#1 lore raw

RFC 1/12 arch: add hexagon architecture support

---
 arch/Config.in         | 10 +++++++
 arch/Config.in.hexagon | 63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 arch/Config.in.hexagon
arch/Config.in +10 -0
index e57f4b2baa..fe863e50a7 100644
@@ -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"
arch/Config.in.hexagon new file +63 -0

63 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#2 lore raw

RFC 2/12 toolchain/toolchain-external: add hexagon toolchain support

In reply to Brian Cain
---
 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
toolchain/toolchain-external/Config.in +6 -0
index e91aa16326..7bd5309671 100644
@@ -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"
 
toolchain/toolchain-external/toolchain-external-hexagon/Config.in new file +7 -0
new file mode 100644
index 0000000000..256eeb87dc
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options new file +14 -0
new file mode 100644
index 0000000000..cb4d6d5420
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash new file +6 -0
new file mode 100644
index 0000000000..c4c9b3cf36
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk new file +14 -0
new file mode 100644
index 0000000000..f8df9c020c
@@ -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))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#3 lore raw

RFC 3/12 toolchain/toolchain-external: add hexagon support for toolchain-wrapper

In reply to Brian Cain
---
 .../toolchain-external/pkg-toolchain-external.mk      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +10 -1
index c08bf0a653..d45f2c54de 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#4 lore raw

RFC 4/12 toolchain/toolchain-external: add support for clang

In reply to Brian Cain
---
 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(-)
package/Makefile.in +19 -5
index 829636900b..b54fe123ba 100644
@@ -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
toolchain/Config.in +54 -0

60 lines not on this page · raw message

toolchain/helpers.mk +16 -0
index f3fdaaec07..f4462db483 100644
@@ -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
toolchain/toolchain-external/pkg-toolchain-external.mk +25 -4
index d45f2c54de..3948ad1107 100644
@@ -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)") ; \
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +76 -0

90 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#5 lore raw

RFC 5/12 toolchain/toolchain-external: skip "-march=" for hexagon

In reply to Brian Cain

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

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

---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)
toolchain/toolchain-external/pkg-toolchain-external.mk +2 -0
index 3948ad1107..8a7c4a5c1e 100644
@@ -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)"'
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#6 lore raw

RFC 6/12 linux: add support for hexagon clang

In reply to Brian Cain
---
 linux/linux.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
linux/linux.mk +10 -0
index 469a80db9f..f5d2a9e763 100644
@@ -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 \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#7 lore raw

RFC 7/12 arch: add hexagon ARCH definition

In reply to Brian Cain
---
 arch/Config.in.hexagon | 6 ++++++
 1 file changed, 6 insertions(+)
arch/Config.in.hexagon +6 -0
index 9a7cb62278..4cf1e59e68 100644
@@ -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"
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#8 lore raw

RFC 8/12 package/hexagonMVM: new package

In reply to Brian Cain

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

---
 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
package/Config.in +1 -0
index b43e11b806..97c15c274f 100644
@@ -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"
package/hexagonMVM/Config.in new file +8 -0
new file mode 100644
index 0000000000..b00666188b
@@ -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
package/hexagonMVM/hexagonMVM.hash new file +5 -0
new file mode 100644
index 0000000000..a1830939d3
@@ -0,0 +1,5 @@
+
+#
+# Locally computed
+sha256  e5e3ba941af491cab37ece5db85eb7422db9dd0d13464ea528dbf2c01c24b5f0  LICENSE
+sha256  a2ad5745e597d8401f696cba27eaaedac4dd43ebe0835f11daf90a8e8c307fa7  0.1.3.tar.gz
package/hexagonMVM/hexagonMVM.mk new file +27 -0
new file mode 100644
index 0000000000..33e45792e0
@@ -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))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#9 lore raw

RFC 9/12 board/qcom/sa8775: add support for qcom sa8775-cdsp0

In reply to Brian Cain
---
 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
board/qcom/sa8775/post_build.sh new file +9 -0
new file mode 100755
index 0000000000..af13225d58
@@ -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
configs/qcom_sa8775_cdsp0_defconfig new file +35 -0
new file mode 100644
index 0000000000..e0b49869ca
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#10 lore raw

RFC 10/12 configs: add hexagon QEMU config

In reply to Brian Cain
---
 configs/qcom_dsp_qemu_defconfig | 44 +++++++++++++++++++++++++++++++++
 linux/linux.hash                |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 configs/qcom_dsp_qemu_defconfig
configs/qcom_dsp_qemu_defconfig new file +44 -0
new file mode 100644
index 0000000000..f9a976fb91
@@ -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"
+
linux/linux.hash +1 -0
index 5233de2b0b..ca5581d474 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#11 lore raw

RFC 11/12 DEVELOPERS: add myself as developer for hexagon

In reply to Brian Cain
---
 DEVELOPERS | 8 ++++++++
 1 file changed, 8 insertions(+)
DEVELOPERS +8 -0
index 9afd19d406..81f9c0ad8f 100644
@@ -3483,3 +3483,11 @@ F:	package/quazip/
 F:	package/shapelib/
 F:	package/simple-mail/
 F:	package/tinc/
+
+N:	Brian Cain <[email protected]>
+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/
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#12 lore raw

RFC 12/12 package: disable -ztext for hexagon

In reply to 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.

---
 package/Makefile.in | 2 ++
 1 file changed, 2 insertions(+)
package/Makefile.in +2 -0
index b54fe123ba..1f1b429462 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

v2 cover add hexagon architecture

In reply to 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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#14 lore raw

RFC v2 9/14 board/qcom/sa8775: add support for qcom sa8775-cdsp0

---
 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
board/qcom/sa8775/post_build.sh new file +9 -0
new file mode 100755
index 0000000000..af13225d58
@@ -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
configs/qcom_sa8775_cdsp0_defconfig new file +35 -0
new file mode 100644
index 0000000000..f9363c930f
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#15 lore raw

Re: [Buildroot] [RFC v2 09/14] board/qcom/sa8775: add support for qcom sa8775-cdsp0

Hello Brian,

Quoted 1 line · On Wed, 18 Dec 2024 21:30:48 -0800 Brian Cain <[email protected]>…

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

board/qcom/sa8775/post_build.sh line 3

Quoted 9 lines
board/qcom/sa8775/post_build.sh new file +3 -0
new file mode 100755
index 0000000000..af13225d58
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+TARGETDIR=$1

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

board/qcom/sa8775/post_build.sh line 9

Quoted 6 lines
board/qcom/sa8775/post_build.sh new file +6 -0
+
+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.

configs/qcom_sa8775_cdsp0_defconfig line 3

Quoted 9 lines
configs/qcom_sa8775_cdsp0_defconfig new file +3 -0
new file mode 100644
index 0000000000..f9363c930f
@@ -0,0 +1,35 @@
+BR2_hexagon=y
+BR2_HEXAGON_v73=y
+BR2_STATIC_LIBS=y

You can't use shared libraries?

configs/qcom_sa8775_cdsp0_defconfig line 5

Quoted 2 lines
configs/qcom_sa8775_cdsp0_defconfig new file +2 -0
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y

Use the toolchain-external-hexagon package.

configs/qcom_sa8775_cdsp0_defconfig line 17

Quoted 12 lines
configs/qcom_sa8775_cdsp0_defconfig new file +12 -0
+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.

Quoted 7 lines
configs/qcom_sa8775_cdsp0_defconfig new file +7 -0
+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

configs/qcom_sa8775_cdsp0_defconfig line 34

Quoted 10 lines
configs/qcom_sa8775_cdsp0_defconfig new file +10 -0
+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.

configs/qcom_sa8775_cdsp0_defconfig line 35

Quoted 1 line
configs/qcom_sa8775_cdsp0_defconfig new file +1 -0
+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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#16 lore raw

RFC v2 1/14 arch: add hexagon architecture support

In reply to Brian Cain
---
 arch/Config.in         | 10 +++++++
 arch/Config.in.hexagon | 63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 arch/Config.in.hexagon
arch/Config.in +10 -0
index e57f4b2baa..fe863e50a7 100644
@@ -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"
arch/Config.in.hexagon new file +63 -0

63 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#17 lore raw

Re: [Buildroot] [RFC v2 01/14] arch: add hexagon architecture support

Quoted 1 line · On Wed, 18 Dec 2024 21:30:40 -0800 Brian Cain via buildroot…

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.

Quoted 5 lines
---
 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.

arch/Config.in config BR2_xtensa · line 257

Quoted 10 lines
arch/Config.in +1 -0
index e57f4b2baa..fe863e50a7 100644
@@ -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.

arch/Config.in config BR2_xtensa · line 263

Quoted 6 lines
arch/Config.in +5 -0
+	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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#18 lore raw

RFC v2 2/14 toolchain/toolchain-external: add hexagon toolchain support

In reply to Brian Cain
---
 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
toolchain/toolchain-external/Config.in +6 -0
index e91aa16326..7bd5309671 100644
@@ -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"
 
toolchain/toolchain-external/toolchain-external-hexagon/Config.in new file +7 -0
new file mode 100644
index 0000000000..256eeb87dc
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/Config.in.options new file +10 -0
new file mode 100644
index 0000000000..84611fdd9a
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.hash new file +6 -0
new file mode 100644
index 0000000000..acaa7bbe24
@@ -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
toolchain/toolchain-external/toolchain-external-hexagon/toolchain-external-hexagon.mk new file +11 -0
new file mode 100644
index 0000000000..59e763a2e4
@@ -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))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#19 lore raw

Re: [Buildroot] [RFC v2 02/14] toolchain/toolchain-external: add hexagon toolchain support

Hello Brian,

Quoted 8 lines · On Wed, 18 Dec 2024 21:30:41 -0800 Brian Cain via buildroot…
---
 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.

Quoted 4 lines
 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.

Quoted 30 lines
toolchain/toolchain-external/Config.in +6 -0
index e91aa16326..7bd5309671 100644
@@ -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"
 
toolchain/toolchain-external/toolchain-external-hexagon/Config.in new file +0 -0
new file mode 100644
index 0000000000..256eeb87dc

toolchain/toolchain-external/toolchain-external-hexagon/Config.in line 6

Quoted 6 lines
toolchain/toolchain-external/toolchain-external-hexagon/Config.in new file +6 -0
@@ -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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#20 lore raw

RFC v2 3/14 toolchain/toolchain-external: add hexagon support for toolchain-wrapper

In reply to Brian Cain
---
 .../toolchain-external/pkg-toolchain-external.mk      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +10 -1
index c08bf0a653..d45f2c54de 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#21 lore raw

Re: [Buildroot] [RFC v2 03/14] toolchain/toolchain-external: add hexagon support for toolchain-wrapper

Hello,

Quoted 1 line · On Wed, 18 Dec 2024 21:30:42 -0800 Brian Cain via buildroot…

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

toolchain/toolchain-external/pkg-toolchain-external.mk endef · line 156

Quoted 12 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +4 -0
index c08bf0a653..d45f2c54de 100644
@@ -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.

toolchain/toolchain-external/pkg-toolchain-external.mk define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER · line 292

Quoted 13 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +3 -1
+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.

toolchain/toolchain-external/pkg-toolchain-external.mk define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS · line 476

Quoted 10 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +3 -0
 			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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#22 lore raw

RFC v2 4/14 toolchain/toolchain-external: add support for clang

In reply to Brian Cain
---
 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(-)
package/Makefile.in +19 -5
index 829636900b..0d60e76bff 100644
@@ -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
toolchain/Config.in +54 -0

60 lines not on this page · raw message

toolchain/helpers.mk +16 -0
index f3fdaaec07..f4462db483 100644
@@ -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
toolchain/toolchain-external/pkg-toolchain-external.mk +25 -4
index d45f2c54de..cc36b0bcfd 100644
@@ -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)") ; \
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +76 -0

90 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#23 lore raw

RFC v2 12/14 toolchain: disable PIE for hexagon

In reply to 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.

---
 toolchain/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/Config.in +1 -1
index 4354fde340..e650236e06 100644
@@ -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"
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#24 lore raw

Re: [Buildroot] [RFC v2 12/14] toolchain: disable PIE for hexagon

Quoted 21 lines · On Wed, 18 Dec 2024 21:30:51 -0800 Brian Cain <[email protected]>…

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.

---
 toolchain/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/Config.in +0 -0
index 4354fde340..e650236e06 100644

toolchain/Config.in config BR2_TOOLCHAIN_USES_MUSL · line 37

Quoted 5 lines
toolchain/Config.in +1 -1
@@ -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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#25 lore raw

RFC v2 5/14 toolchain/toolchain-external: skip "-march=" for hexagon

In reply to Brian Cain

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

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

---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)
toolchain/toolchain-external/pkg-toolchain-external.mk +2 -0
index cc36b0bcfd..44891e638f 100644
@@ -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)"'
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#26 lore raw

Re: [Buildroot] [RFC v2 05/14] toolchain/toolchain-external: skip "-march=" for hexagon

toolchain/toolchain-external/pkg-toolchain-external.mk TOOLCHAIN_EXTERNAL_CFLAGS += -m64 · line 216

Quoted 12 lines · On Wed, 18 Dec 2024 21:30:44 -0800 Brian Cain via buildroot…
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -0
index cc36b0bcfd..44891e638f 100644
@@ -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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#27 lore raw

RFC v2 6/14 linux: add support for hexagon clang

In reply to Brian Cain
---
 linux/linux.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
linux/linux.mk +10 -0
index 1d3d8fffa6..f6385856d6 100644
@@ -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 \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#28 lore raw

Re: [Buildroot] [RFC v2 06/14] linux: add support for hexagon clang

Quoted 1 line · On Wed, 18 Dec 2024 21:30:45 -0800 Brian Cain via buildroot…

+ifeq ($(BR2_hexagon),y)

Not exagon related, but related to clang.

linux/linux.mk LINUX_MAKE_FLAGS = \ · line 177

Quoted 4 lines
linux/linux.mk +4 -0
+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?

linux/linux.mk LINUX_MAKE_FLAGS = \ · line 180

Quoted 3 lines
linux/linux.mk +3 -0
+	LLVM_IAS=1 \
+	LLVM=1 \
+	$()

What is this lingering $() ?

Also, needs a non-empty commit message.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#29 lore raw

RFC v2 7/14 arch: add hexagon ARCH definition

In reply to Brian Cain
---
 arch/Config.in.hexagon | 6 ++++++
 1 file changed, 6 insertions(+)
arch/Config.in.hexagon +6 -0
index 9a7cb62278..4cf1e59e68 100644
@@ -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"
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#30 lore raw

Re: [Buildroot] [RFC v2 07/14] arch: add hexagon ARCH definition

Quoted 10 lines · On Wed, 18 Dec 2024 21:30:46 -0800 Brian Cain via buildroot…
---
 arch/Config.in.hexagon | 6 ++++++
 1 file changed, 6 insertions(+)
arch/Config.in.hexagon +0 -0
index 9a7cb62278..4cf1e59e68 100644

arch/Config.in.hexagon endchoice · line 47

Quoted 5 lines
arch/Config.in.hexagon +2 -0
@@ -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.

arch/Config.in.hexagon endchoice · line 50

Quoted 2 lines
arch/Config.in.hexagon +2 -0
+config BR2_NORMALIZED_ARCH
+	default "hexagon"

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

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#31 lore raw

RFC v2 8/14 package/hexagonMVM: new package

In reply to Brian Cain

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

---
 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
package/Config.in +1 -0
index 5fa344c321..87d2ecfb9c 100644
@@ -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"
package/hexagonMVM/Config.in new file +8 -0
new file mode 100644
index 0000000000..b00666188b
@@ -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
package/hexagonMVM/hexagonMVM.hash new file +5 -0
new file mode 100644
index 0000000000..3e1ae8e2b4
@@ -0,0 +1,5 @@
+
+#
+# Locally computed
+sha256  e5e3ba941af491cab37ece5db85eb7422db9dd0d13464ea528dbf2c01c24b5f0  LICENSE
+sha256  5345cd83b18b6b8f44d06a54bd1a518d447c311dc1c3ba7b45ffa16785e66e1b  0.2.0.tar.gz
package/hexagonMVM/hexagonMVM.mk new file +27 -0
new file mode 100644
index 0000000000..7b3529c14c
@@ -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))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#32 lore raw

Re: [Buildroot] [RFC v2 08/14] package/hexagonMVM: new package

Hello,

Quoted 2 lines · On Wed, 18 Dec 2024 21:30:47 -0800 Brian Cain via buildroot…

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?

Quoted 7 lines
---
 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.

package/hexagonMVM/Config.in line 3

Quoted 9 lines
package/hexagonMVM/Config.in new file +3 -0
new file mode 100644
index 0000000000..b00666188b
@@ -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.

package/hexagonMVM/Config.in line 6

Quoted 3 lines
package/hexagonMVM/Config.in new file +3 -0
+	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?

package/hexagonMVM/hexagonMVM.hash line 2

Quoted 10 lines
package/hexagonMVM/Config.in new file +2 -0
+
+	  https://github.com/quic/hexagonMVM
package/hexagonMVM/hexagonMVM.hash new file +2 -0
new file mode 100644
index 0000000000..3e1ae8e2b4
@@ -0,0 +1,5 @@
+
+#

Minor: drop those two lines.

package/hexagonMVM/hexagonMVM.hash line 5

Quoted 3 lines
package/hexagonMVM/hexagonMVM.hash new file +3 -0
+# 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.

Quoted 6 lines
package/hexagonMVM/hexagonMVM.mk new file +0 -0
new file mode 100644
index 0000000000..7b3529c14c

package/hexagonMVM/hexagonMVM.mk line 8

Quoted 8 lines
package/hexagonMVM/hexagonMVM.mk new file +8 -0
@@ -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.

package/hexagonMVM/hexagonMVM.mk line 14

Quoted 6 lines
package/hexagonMVM/hexagonMVM.mk new file +6 -0
+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.

package/hexagonMVM/hexagonMVM.mk line 17

Quoted 3 lines
package/hexagonMVM/hexagonMVM.mk new file +3 -0
+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?

package/hexagonMVM/hexagonMVM.mk line 27

Quoted 9 lines
package/hexagonMVM/hexagonMVM.mk new file +9 -0
+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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#33 lore raw

RFC v2 10/14 configs: add hexagon QEMU config

In reply to Brian Cain
---
 configs/qcom_dsp_qemu_defconfig | 44 +++++++++++++++++++++++++++++++++
 linux/linux.hash                |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 configs/qcom_dsp_qemu_defconfig
configs/qcom_dsp_qemu_defconfig new file +44 -0
new file mode 100644
index 0000000000..cc9b7157ad
@@ -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"
+
linux/linux.hash +1 -0
index ccf6235166..3c5eaea676 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#34 lore raw

Re: [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config

Hello Brian,

Quoted 1 line · On Wed, 18 Dec 2024 21:30:49 -0800 Brian Cain via buildroot…

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

configs/qcom_dsp_qemu_defconfig line 3

Quoted 9 lines
configs/qcom_dsp_qemu_defconfig new file +3 -0
new file mode 100644
index 0000000000..cc9b7157ad
@@ -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.

configs/qcom_dsp_qemu_defconfig line 5

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y

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

configs/qcom_dsp_qemu_defconfig line 16

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y

We really want to use the default for this.

Quoted 8 lines
configs/qcom_dsp_qemu_defconfig new file +8 -0
+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

configs/qcom_dsp_qemu_defconfig line 35

Quoted 10 lines
configs/qcom_dsp_qemu_defconfig new file +10 -0
+
+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.

configs/qcom_dsp_qemu_defconfig line 42

Quoted 7 lines
configs/qcom_dsp_qemu_defconfig new file +7 -0
+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.

configs/qcom_dsp_qemu_defconfig line 44

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+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.

linux/linux.hash sha256 0d0ffae5bf0e6f9c6a1ce42da2bc2a8696ca55721c103497eb1245be8cc04b20 linux- · line 12

Quoted 9 lines
linux/linux.hash +1 -0
index ccf6235166..3c5eaea676 100644
@@ -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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#35 lore raw

Re: [Buildroot] [RFC v2 10/14] configs: add hexagon QEMU config

Quoted 8 lines · Thomas Petazzoni

Hello Brian,

Quoted 1 line · On Wed, 18 Dec 2024 21:30:49 -0800 Brian Cain via buildroot…

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.

Quoted 58 lines

configs/qcom_dsp_qemu_defconfig line 3

Quoted 9 lines
configs/qcom_dsp_qemu_defconfig new file +3 -0
new file mode 100644
index 0000000000..cc9b7157ad
@@ -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.

configs/qcom_dsp_qemu_defconfig line 5

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y

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

configs/qcom_dsp_qemu_defconfig line 16

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_STATIC=y

We really want to use the default for this.

Quoted 8 lines
configs/qcom_dsp_qemu_defconfig new file +8 -0
+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

configs/qcom_dsp_qemu_defconfig line 35

Quoted 10 lines
configs/qcom_dsp_qemu_defconfig new file +10 -0
+
+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.

configs/qcom_dsp_qemu_defconfig line 42

Quoted 7 lines
configs/qcom_dsp_qemu_defconfig new file +7 -0
+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.

configs/qcom_dsp_qemu_defconfig line 44

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig new file +2 -0
+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.

Quoted 12 lines

linux/linux.hash sha256 0d0ffae5bf0e6f9c6a1ce42da2bc2a8696ca55721c103497eb1245be8cc04b20 linux- · line 12

Quoted 9 lines
linux/linux.hash +1 -0
index ccf6235166..3c5eaea676 100644
@@ -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. :)

Quoted 3 lines

Thanks!

Thomas

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#36 lore raw

RFC v2 11/14 DEVELOPERS: add myself as developer for hexagon

In reply to Brian Cain
---
 DEVELOPERS | 8 ++++++++
 1 file changed, 8 insertions(+)
DEVELOPERS +8 -0
index 047dc4a88f..6f111b7294 100644
@@ -3449,3 +3449,11 @@ F:	package/quazip/
 F:	package/shapelib/
 F:	package/simple-mail/
 F:	package/tinc/
+
+N:	Brian Cain <[email protected]>
+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/
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#37 lore raw

Re: [Buildroot] [RFC v2 11/14] DEVELOPERS: add myself as developer for hexagon

DEVELOPERS F: package/quazip/ · line 3459

Quoted 7 lines · On Wed, 18 Dec 2024 21:30:50 -0800 Brian Cain via buildroot…
DEVELOPERS +7 -0
+N:	Brian Cain <[email protected]>
+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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#38 lore raw

RFC v2 13/14 configs: switch hexagon QEMU to SHARED

In reply to 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]

---
 configs/qcom_dsp_qemu_defconfig | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
configs/qcom_dsp_qemu_defconfig +7 -2
index cc9b7157ad..dbfc8f1adf 100644
@@ -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
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#39 lore raw

Re: [Buildroot] [RFC v2 13/14] configs: switch hexagon QEMU to SHARED

configs/qcom_dsp_qemu_defconfig line 3

Quoted 9 lines · On Wed, 18 Dec 2024 21:30:52 -0800 Brian Cain via buildroot…
configs/qcom_dsp_qemu_defconfig +1 -1
index cc9b7157ad..dbfc8f1adf 100644
@@ -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.

configs/qcom_dsp_qemu_defconfig BR2_PACKAGE_BASH=y · line 33

Quoted 10 lines
configs/qcom_dsp_qemu_defconfig +3 -0
 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.

configs/qcom_dsp_qemu_defconfig BR2_PACKAGE_BASH=y · line 36

Quoted 3 lines
configs/qcom_dsp_qemu_defconfig +1 -0
 BR2_PACKAGE_GNURADIO_FFT=y
 
+BR2_RELRO_NONE=y

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

configs/qcom_dsp_qemu_defconfig BR2_PACKAGE_BASH=y · line 40

Quoted 4 lines
configs/qcom_dsp_qemu_defconfig +1 -1
 BR2_PACKAGE_XINETD=n
 BR2_PACKAGE_COREUTILS=y
-BR2_PACKAGE_HEXAGONMVM=y
+BR2_PACKAGE_HEXAGONMVM=n

Spurious change?

configs/qcom_dsp_qemu_defconfig BR2_PACKAGE_BASH=y · line 42

Quoted 2 lines
configs/qcom_dsp_qemu_defconfig +0 -0
 BR2_TARGET_ROOTFS_TAR_GZIP=y
 BR2_TARGET_ROOTFS_INITRAMFS=y

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#40 lore raw

RFC v2 14/14 package: disable -ztext

In reply to 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
---
 package/Makefile.in | 4 ++++
 1 file changed, 4 insertions(+)
package/Makefile.in +4 -0
index 0d60e76bff..e4da9d2ff6 100644
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#41 lore raw

Re: [Buildroot] [RFC v2 14/14] package: disable -ztext

Quoted 10 lines · On Wed, 18 Dec 2024 21:30:53 -0800 Brian Cain via buildroot…
---
 package/Makefile.in | 4 ++++
 1 file changed, 4 insertions(+)
package/Makefile.in +0 -0
index 0d60e76bff..e4da9d2ff6 100644

package/Makefile.in TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) · line 177

Quoted 7 lines
package/Makefile.in +3 -0
@@ -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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#42 lore raw
In reply to Brian Cain

Hello Brian,

Quoted 3 lines · On Wed, 18 Dec 2024 21:30:39 -0800 Brian Cain <[email protected]>…

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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#43 lore raw
Quoted 16 lines · Thomas Petazzoni

Hello Brian,

Quoted 3 lines · On Wed, 18 Dec 2024 21:30:39 -0800 Brian Cain <[email protected]>…

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?

Quoted 7 lines

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.

Quoted 6 lines

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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot