Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
From 4e1af872f819782bd233ab21953ab92cf36ff9c3 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Mon, 9 Mar 2026 19:07:10 +0100
Subject: [PATCH] [libc] Fix detection of cfloat128
Building compiler-rt with aarch64-buildroot-linux-gnu-gcc 15.2 causes a
build error:
compiler-rt-22.1.0/cmake/Modules/../../libc/src/__support/CPP/type_traits/is_complex.h:44:31:
error: 'cfloat128' was not declared in this scope; did you mean 'float128'? [-Wtemplate-body]
According to https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Floating-Types.html
__float128 is not available on aarch64.
Analyzing the gcc defines for aarch64 seems to prove it:
$ aarch64-buildroot-linux-gnu-gcc -v
Target: aarch64-buildroot-linux-gnu
gcc version 15.2.0 (Buildroot 2026.02-114-gdadec9da56)
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep __GCC_IEC_559_COMPLEX
#define __GCC_IEC_559_COMPLEX 2
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep __STDC_IEC_60559_COMPLEX__
#define __STDC_IEC_60559_COMPLEX__ 201404L
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep -i float128
$
In contrast gcc for x86_64:
$ x86_64-buildroot-linux-gnu-gcc -v
Target: x86_64-buildroot-linux-gnu
gcc version 15.2.0 (Buildroot 2026.02-112-gd12ac02486)
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep __GCC_IEC_559_COMPLEX
#define __GCC_IEC_559_COMPLEX 2
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep __STDC_IEC_60559_COMPLEX__
#define __STDC_IEC_60559_COMPLEX__ 201404L
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep -i float128
#define __SIZEOF_FLOAT128__ 16
This patch changes the or-condition to an and-condition for
__STDC_IEC_60559_COMPLEX__ and __SIZEOF_FLOAT128__.
Upstream: https://github.com/llvm/llvm-project/pull/185486
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
libc/include/llvm-libc-macros/cfloat128-macros.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/include/llvm-libc-macros/cfloat128-macros.h b/libc/include/llvm-libc-macros/cfloat128-macros.h
index 5f28cfa21aae..ff4aa530685d 100644
--- a/libc/include/llvm-libc-macros/cfloat128-macros.h
+++ b/libc/include/llvm-libc-macros/cfloat128-macros.h
@@ -27,7 +27,7 @@
#define LIBC_TYPES_HAS_CFLOAT128
#endif
#elif defined(__GNUC__)
-#if (defined(__STDC_IEC_60559_COMPLEX__) || defined(__SIZEOF_FLOAT128__)) && \
+#if (defined(__STDC_IEC_60559_COMPLEX__) && defined(__SIZEOF_FLOAT128__)) && \
(__GNUC__ >= 13 || (!defined(__cplusplus)))
#define LIBC_TYPES_HAS_CFLOAT128
#endif
--
2.47.3

View File

@@ -0,0 +1,19 @@
config BR2_PACKAGE_COMPILER_RT
bool "compiler-rt"
depends on BR2_PACKAGE_LLVM
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_15
depends on BR2_TOOLCHAIN_USES_GLIBC # asan lib requires
depends on BR2_HOST_GCC_AT_LEAST_7 # host-clang
select BR2_PACKAGE_LIBXCRYPT
select BR2_HOST_CMAKE_AT_LEAST_3_20 # cmake required version at least 3.20
help
A collection of runtime libraries primarily used by clang and
llvm to provide builtins, sanitizer runtimes, and profiling
at runtime.
https://compiler-rt.llvm.org/
comment "compiler-rt requires llvm to be enabled, a glibc toolchain, gcc >= 15, host gcc >= 7"
depends on !BR2_PACKAGE_LLVM
depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_HOST_GCC_AT_LEAST_7 \
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_15

View File

@@ -0,0 +1 @@
../llvm-project.hash

View File

@@ -0,0 +1,41 @@
################################################################################
#
# compiler-rt
#
################################################################################
COMPILER_RT_VERSION = $(LLVM_PROJECT_VERSION)
COMPILER_RT_SITE = $(LLVM_PROJECT_SITE)
COMPILER_RT_SOURCE = $(LLVM_PROJECT_SOURCE)
COMPILER_RT_DL_SUBDIR = llvm-project
COMPILER_RT_LICENSE = NCSA MIT
COMPILER_RT_LICENSE_FILES = LICENSE.TXT
COMPILER_RT_CPE_ID_VENDOR = llvm
COMPILER_RT_DEPENDENCIES = host-clang libxcrypt llvm
COMPILER_RT_SUBDIR = compiler-rt
COMPILER_RT_SUPPORTS_IN_SOURCE_BUILD = NO
COMPILER_RT_INSTALL_STAGING = YES
COMPILER_RT_INSTALL_TARGET = NO
COMPILER_RT_CONF_OPTS = \
-DCOMPILER_RT_STANDALONE_BUILD=ON \
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) \
-DLLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config \
-DCMAKE_MODULE_PATH=$(HOST_DIR)/lib/cmake/llvm \
-DLLVM_COMMON_CMAKE_UTILS=$(HOST_DIR)/lib/cmake/llvm
# The installation of the target runtime libraries defaults to DESTDIR, however
# host-clang resources directory needs a link so Clang can find the runtime
# libraries in the same location they would be if built as part of the Clang
# build. The "resources" directory is loosely documented and seems to be
# assumed, as compiler-rt is usually build at the same time as Clang and not
# standalone.
define COMPILER_RT_SETUP_RUNTIME_LIBS
mkdir -p $(HOST_DIR)/lib/clang/$(CLANG_VERSION_MAJOR)/lib
ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/lib/linux $(HOST_DIR)/lib/clang/$(CLANG_VERSION_MAJOR)/lib/linux
ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/share $(HOST_DIR)/lib/clang/$(CLANG_VERSION_MAJOR)/share
endef
COMPILER_RT_POST_INSTALL_STAGING_HOOKS += COMPILER_RT_SETUP_RUNTIME_LIBS
$(eval $(cmake-package))