[COPY] --- T2-COPYRIGHT-BEGIN --- [COPY] t2/package/*/wasi-compiler-rt/wasi-compiler-rt.desc [COPY] Copyright (C) 2008 - 2026 The T2 SDE Project [COPY] SPDX-License-Identifier: GPL-2.0 [COPY] --- T2-COPYRIGHT-END --- [I] Compiler runtime libraries [T] A simple library that provides an implementation of the low-level [T] target-specific hooks required by code generation and other runtime [T] components. For example, when compiling for a 32-bit target, converting [T] a double to a 64-bit unsigned integer is compiling into a runtime call [T] to the "__fixunsdfdi" function. [U] https://compiler-rt.llvm.org [A] University of Illinois/NCSA [A] Chris Lattner [M] René Rebe [C] extra/development [F] CROSS NO-LTO [R] - alpha hppa hppa64 ia64 [L] BSD [V] 23.1.3 [P] X -----5---9 152.700 [CV-GROUP] llvm-project [D] 23ab38c986a2dfa119c3df4005794672d8691f2b14bf7a75fc0c9d6c llvm-project-23.1.3.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-23.1.3/ CC_WRAPPER_BYPASS=1 # TODO: sync w/ wasi-libc [ $prefix_auto = 1 ] && prefix=opt/wasi && set_confopt runmake=0 srcdir=*/compiler-rt prepare_sources() { cd .. tar $taropt `match_source_file -p llvm-cmake-$ver` ln -svf cmake* cmake } #hook_add preconf 5 prepare_sources . $base/package/*/*/wasi.in export CC=clang CXX=clang++ # LD=clang export CFLAGS="-fno-exceptions --sysroot=$root/opt/wasi" export CXXFLAGS="-fno-exceptions --sysroot=$root/opt/wasi" export DESTDIR=$root cmakeopt= var_append cmakeopt ' ' "-DUNIX=ON \ -DCMAKE_TOOLCHAIN_FILE=$confdir/../wasi-libc/wasi-sdk.cmake \ -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON \ -DCMAKE_STAGING_PREFIX=/opt/wasi" var_append cmakeopt ' ' "-DCOMPILER_RT_BAREMETAL_BUILD=ON \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_HAS_FPIC_FLAG=OFF \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -DCOMPILER_RT_OS_DIR=wasi" # TODO: why does the camke module seach only fail for native builds? atstage native && var_append cmakeopt ' ' -DLLVM_CMAKE_DIR=$(pkgprefix libdir llvm)/cmake build_compiler_rt() { eval cmake -B objs $cmakeopt compiler-rt-*/lib/builtins cmake --build objs cmake --install objs clangver=${ver%%.*} mkdir -p $root/usr/${libdir##*/}/clang/$clangver/lib/wasip1/ cp -arv $root/$prefix/lib/wasi/libclang_rt.builtins-wasm32.a $root/usr/${libdir##*/}/clang/$clangver/lib/wasip1/ if ! atstage native; then mkdir -p $root/TOOLCHAIN/cross/lib/clang/$clangver/lib/wasip1/ cp -arv $root/$prefix/lib/wasi/libclang_rt.builtins-wasm32.a \ $root/TOOLCHAIN/cross/lib/clang/$clangver/lib/wasip1/ fi } hook_add inmake 5 build_compiler_rt