Clean up the source tree from toolchain building scripts
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/push/lint Pipeline was successful Details

This commit is contained in:
Sameer Rahmani 2023-05-12 18:34:24 +01:00
parent 9c9a925a52
commit a011bb330a
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
6 changed files with 0 additions and 397 deletions

View File

@ -1,83 +0,0 @@
# Serene Programming Language
#
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file sets up a CMakeCache for a LLVM toolchain build
set(CMAKE_CXX_STANDARD 17)
#Enable LLVM projects and runtimes
set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld;lldb;mlir" CACHE STRING "")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
# Distributions should never be built using the BUILD_SHARED_LIBS CMake option.
# That option exists for optimizing developer workflow only. Due to design and
# implementation decisions, LLVM relies on global data which can end up being
# duplicated across shared libraries resulting in bugs. As such this is not a
# safe way to distribute LLVM or LLVM-based tools.
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
#set(LLVM_BUILD_STATIC ON CACHE BOOL "")
set(LLVM_BUILD_LLVM_DYLIB OFF CACHE BOOL "")
set(LLVM_ENABLE_EH ON CACHE BOOL "")
set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
set(LIBCLANG_BUILD_STATIC ON CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
# Create the builtin libs of compiler-rt
set(COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
set(COMPILER_RT_BUILD_STANDALONE_LIBATOMIC OFF CACHE BOOL "")
set(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN OFF CACHE BOOL "")
set(COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
set(COMPILER_RT_USE_LIBCXX ON CACHE BOOL "Enable compiler-rt to use libc++ from the source tree")
set(LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "")
set(LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "")
set(LIBCXX_DEFAULT_ABI_LIBRARY "libcxxabi" CACHE STRING "")
set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(LIBCXX_CXX_ABI libcxxabi CACHE BOOL "")
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
set(LIBCXXABI_ENABLE_EXCEPTIONS ON CACHE BOOL "")
set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL
"Build libc++abi with definitions for operator new/delete. These are normally
defined in libc++abi, but it is also possible to define them in libc++, in
which case the definition in libc++abi should be turned off.")
set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
set(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY ON CACHE BOOL " ")
set(LIBCXX_HAS_GCC_LIB OFF CACHE BOOL "")
set(LIBCXX_ENABLE_EXCEPTIONS ON CACHE BOOL "")
set(LIBCXX_ENABLE_RTTI ON CACHE BOOL "")
set(LIBCXX_ENABLE_THREADS ON CACHE BOOL "")
set(LLVM_EXTERNAL_PROJECTS iwyu ON CACHE STRING "")
# Only build the native target in stage1 since it is a throwaway build.
set(LLVM_TARGETS_TO_BUILD ${TARGET_ARCHS} CACHE STRING "")
# Optimize the stage1 compiler, but don't LTO it because that wastes time.
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
# Setting up the stage2 LTO option needs to be done on the stage1 build so that
# the proper LTO library dependencies can be connected.
#set(LLVM_ENABLE_LTO OFF CACHE BOOL "")
# Since LLVM_ENABLE_LTO is ON we need a LTO capable linker
set(LLVM_ENABLE_LLD ON CACHE BOOL "")

View File

@ -1,124 +0,0 @@
# This file sets up a CMakeCache for a Fuchsia toolchain build.
set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")
#set(PACKAGE_VENDOR "serene-stage.0" CACHE STRING "")
message(STATUS "Set 'install_dir' to $ENV{install_dir}")
set(_SERENE_ENABLE_PROJECTS "clang;lld")
set(CMAKE_INSTALL_PREFIX $ENV{install_dir} CACHE STRING "")
#set(CMAKE_PREFIX_PATH $ENV{install_dir} CACHE STRING "")
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
set(LLVM_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "")
set(LLVM_ENABLE_OCAMLDOC OFF CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
set(LLVM_TOOL_LLVM_LTO2_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_LLVM_LTO_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_LTO_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_REMARKS_SHLIB_BUILD OFF CACHE BOOL "")
set(CLANG_BUILD_TOOLS OFF CACHE BOOL "")
set(CLANG_INCLUDE_DOCS OFF CACHE BOOL "")
set(CLANG_TOOL_CLANG_IMPORT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_CLANG_LINKER_WRAPPER_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_C_INDEX_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_ARCMT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_C_ARCMT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_LIBCLANG_BUILD OFF CACHE BOOL "")
set(LLVM_ENABLE_ZSTD OFF CACHE BOOL "")
set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
#set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
#set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")
#set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
#set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
#set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
#set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
#set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
#set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
set(LLVM_ENABLE_EH ON CACHE BOOL "")
set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
set(LIBUNWIND_INSTALL_LIBRARY ON CACHE BOOL "")
set(LIBUNWIND_USE_COMPILER_RT OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
set(LIBCXXABI_INSTALL_LIBRARY ON CACHE BOOL "")
set(LIBCXXABI_USE_COMPILER_RT OFF CACHE BOOL "")
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
#set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(LIBCXX_INSTALL_LIBRARY ON CACHE BOOL "")
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(LIBCXX_USE_COMPILER_RT OFF CACHE BOOL "")
set(LLVM_ENABLE_RUNTIMES "libcxx;libcxxabi;libunwind" CACHE STRING "") #compiler-rt
#set(LLVM_BUILD_STATIC ON CACHE BOOL "")
#set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
#set(LLVM_STATIC_LINK_CXX_STDLIB ON CACHE BOOL "")
#set(LLVM_HOST_TRIPLE "x86_64-alpine-linux-musl" CACHE STRING "")
#set(target "x86_64-alpine-linux-musl")
# set(LLVM_BUILTIN_TARGETS "${TARGET}" CACHE STRING "")
# set(BUILTINS_${TARGET}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
# set(BUILTINS_${TARGET}_CMAKE_BUILD_TYPE Release CACHE STRING "")
set(LLVM_RUNTIME_TARGETS "${TARGET}" CACHE STRING "")
set(RUNTIMES_${TARGET}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
set(RUNTIMES_${TARGET}_CMAKE_BUILD_TYPE Release CACHE STRING "")
#set(RUNTIMES_${TARGET}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBUNWIND_USE_COMPILER_RT OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBUNWIND_INSTALL_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXXABI_USE_COMPILER_RT OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXXABI_INSTALL_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXX_USE_COMPILER_RT OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
#set(RUNTIMES_${TARGET}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${TARGET}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(RUNTIMES_${TARGET}_LLVM_ENABLE_RUNTIMES "libcxx;libcxxabi;libunwind" CACHE STRING "")
set(RUNTIMES_${TARGET}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
#set(RUNTIMES_${TARGET}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
# set(RUNTIMES_${TARGET}_LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
#set(RUNTIMES_${TARGET}_LLVM_STATIC_LINK_CXX_STDLIB ON CACHE BOOL "")
# # set(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED ON CACHE BOOL "")
# # set(RUNTIMES_${TARGET}_COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED ON CACHE BOOL "")
# set(COMPILER_RT_SANITIZERS_TO_BUILD asan;dfsan;msan;hwasan;tsan;safestack;cfi;ubsan_minimal CACHE STRING "")
# set(RUNTIMES_${TARGET}_COMPILER_RT_SANITIZERS_TO_BUILD asan;dfsan;msan;hwasan;tsan;safestack;cfi;ubsan_minimal CACHE STRING "")
#set(LLVM_ENABLE_PROJECTS ${_SERENE_ENABLE_PROJECTS} CACHE STRING "")
#set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
set(RUNTIMES_${TARGET}_LIBCXX_HAS_MUSL_LIBC ON CACHE BOOL "")
set(LIBCXX_HAS_MUSL_LIBC ON CACHE BOOL "")
set(LLVM_HOST_TRIPLE ${TARGET})
set(LLVM_NATIVE_TOOL_DIR ${NATIVE_LLVM_DIR}/bin CACHE PATH "")

View File

@ -1,52 +0,0 @@
# Serene Programming Language
#
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file sets up a CMakeCache to build serene for development
# Where to find the packages. Packages can be built from source
# or downloaded via the builder script.
message(STATUS "[SERENE] SET THE CONFIG DIR TO: ${SERENE_CONFIG_HOME}")
set(SERENE_PKG_DIR "${SERENE_CONFIG_HOME}/env")
set(SERENE_LLVM_DIR "${SERENE_PKG_DIR}/llvm.${LLVM_VERSION}"
CACHE STRING "Where to find the llvm installation.")
set(SERENE_LLVM_BIN "${SERENE_LLVM_DIR}/bin")
if(EXISTS ${SERENE_LLVM_DIR})
message(STATUS "Setting LLVM DIR to: '${SERENE_LLVM_DIR}'")
else()
message(FATAL_ERROR "Can't find the LLVM dir at: '${SERENE_LLVM_DIR}'")
endif()
# Setting the PATH env var to include the bin dir from the LLVM build
# this is the same as `export PATH="blah/:$PATH". it will not propegate
# to the host shell.
set(ENV{PATH} "${SERENE_LLVM_BIN}:$ENV{PATH}")
set(CMAKE_C_COMPILER "${SERENE_LLVM_BIN}/clang" CACHE PATH "")
set(CMAKE_CXX_COMPILER "${SERENE_LLVM_BIN}/clang++" CACHE PATH "")
# The name of this variable has to be like this(a mix of upper and
# lower case letters). That's due to the package name and it is not
# a mistake
set(BDWgc_DIR "${SERENE_PKG_DIR}/bdwgc.${BDWGC_VERSION}")
set(MUSL_DIR "${SERENE_PKG_DIR}/musl.${MUSL_VERSION}/" CACHE PATH "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "")
set(SERENE_CCACHE_DIR "$ENV{HOME}/.ccache" CACHE STRING "")
set(CMAKE_BUILD_TYPE "Debug")

View File

@ -1,44 +0,0 @@
# This file sets up a CMakeCache for a Fuchsia toolchain build.
set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")
set(CMAKE_INSTALL_PREFIX $ENV{install_dir} CACHE STRING "")
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
set(LLVM_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "")
set(LLVM_ENABLE_OCAMLDOC OFF CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
set(LLVM_TOOL_LLVM_LTO2_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_LLVM_LTO_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_LTO_BUILD OFF CACHE BOOL "")
set(LLVM_TOOL_REMARKS_SHLIB_BUILD OFF CACHE BOOL "")
set(CLANG_INCLUDE_DOCS OFF CACHE BOOL "")
set(CLANG_TOOL_CLANG_IMPORT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_C_INDEX_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_ARCMT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_C_ARCMT_TEST_BUILD OFF CACHE BOOL "")
set(CLANG_TOOL_LIBCLANG_BUILD OFF CACHE BOOL "")
set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
#set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
#set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")
set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
# set(LLVM_ENABLE_EH ON CACHE BOOL "")
# set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")

View File

@ -1,52 +0,0 @@
#! /bin/sh
# This is a slightly modified version of the ld.musl-clang script from
# musl libc that distributes under the MIT license
cc="@CC@"
libc_lib="@LIBDIR@"
ldso="@LDSO@"
cleared=
shared=
userlinkdir=
userlink=
for x ; do
test "$cleared" || set -- ; cleared=1
case "$x" in
-L-user-start)
userlinkdir=1
;;
-L-user-end)
userlinkdir=
;;
-L*)
test "$userlinkdir" && set -- "$@" "$x"
;;
-l-user-start)
userlink=1
;;
-l-user-end)
userlink=
;;
crtbegin*.o|crtend*.o)
set -- "$@" $($cc -print-file-name=$x)
;;
-lgcc|-lgcc_eh)
file=lib${x#-l}.a
set -- "$@" $($cc -print-file-name=$file)
;;
-l*)
test "$userlink" && set -- "$@" "$x"
;;
-shared)
shared=1
set -- "$@" -shared
;;
-sysroot=*|--sysroot=*)
;;
*)
set -- "$@" "$x"
;;
esac
done
exec $($cc -print-prog-name=ld) -fuse-ld=lld -nostdlib "$@" -lc -dynamic-linker "$ldso"

View File

@ -1,42 +0,0 @@
#! /bin/sh
# This is a slightly modified version of the musl-clang script from
# musl libc that distributes under the MIT license
# -----------------------------------------------------------------------------
# Commentary
# -----------------------------------------------------------------------------
# The idea of this template comes from musl itself. This is a wrapper that
# We use to make musl libc hassel free.
cc="@CC@"
libc="@PREFIX@"
libc_inc="@INCDIR@"
libc_lib="@LIBDIR@"
me="`cd "$(dirname "$0")"; pwd`"
# prevent clang from running the linker (and erroring) on no input.
sflags=
eflags=
for x ; do
case "$x" in
-l*) input=1 ;;
*) input= ;;
esac
if test "$input" ; then
sflags="-l-user-start"
eflags="-l-user-end"
break
fi
done
# --rtlib=compiler-rt \
exec $cc \
-B"$me" \
-fuse-ld=musl-lld \
-nostdinc \
--sysroot "$libc" \
-isystem "$libc_inc" \
-L-user-start \
$sflags \
"$@" \
$eflags \
-L"$libc_lib" \
-L-user-end