1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/compiler-rt/compiler-rt.conf
3 # Copyright (C) 2009 - 2023 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 atstage native || export DESTDIR="$root"
15 tar $taropt `match_source_file -p cmake` -C ..
16 mv -vf ../cmake-*src ../../cmake
18 hook_add preconf 5 cmake_mod
20 build_minimal_cross() {
21 ${arch_target}-clang -c ../lib/builtins/{muldc3,muldi3,mulsc3,mulxc3,mulsi3}.c
22 ${arch_target}-ar r builtins.a *.o
23 ${arch_target}-clang -fPIC -c ../lib/crt/crt{begin,end}.c
24 mkdir -p $sysroot/usr/lib/linux/
25 install builtins.a $sysroot/usr/lib/linux/libclang_rt.builtins-$arch.a
26 install crt*.o $sysroot/usr/libx32/
28 if atstage toolchain; then
30 hook_add inmake 5 "build_minimal_cross" # -DCOMPILER_RT_BAREMETAL_BUILD=ON ?
33 if [ $SDECFG_LIBC == "musl" ]; then
34 var_append cmakeopt " " "-DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF"
35 var_append cmakeopt " " "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_PROFILER=OFF"
38 #var_append cmakeopt " " "-DCOMPILER_RT_STANDALONE_BUILD=ON"
40 if [ $stagelevel = 1 ]; then
41 # during initial bootstarp we don't have libcxx* yet
42 var_append GCC_WRAPPER_APPEND ' ' '-nostdlib -lc'
43 #var_append cmakeopt " " "-DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON"
44 var_append cmakeopt " " "-DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF"
45 var_append cmakeopt " " "-DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_ORC=OFF"
48 # currently fails even with gcc/glibc
49 var_append cmakeopt " " "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
51 [ "${libdir##*/lib}" ] && var_append cmakeopt " " "-DLLVM_LIBDIR_SUFFIX=${libdir##*/lib}"
52 var_append cmakeopt " " "-DBUILD_SHARED_LIBS=ON .."