[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
include(BuiltinTests)
|
2016-08-12 09:29:26 +08:00
|
|
|
include(CheckCSourceCompiles)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
|
|
|
|
# Make all the tests only check the compiler
|
|
|
|
set(TEST_COMPILE_ONLY On)
|
|
|
|
|
2016-11-16 09:01:13 +08:00
|
|
|
# Check host compiler support for certain flags
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG)
|
|
|
|
builtin_check_c_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG)
|
|
|
|
builtin_check_c_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG)
|
2016-11-29 10:31:40 +08:00
|
|
|
builtin_check_c_compiler_flag(-std=c11 COMPILER_RT_HAS_STD_C11_FLAG)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
builtin_check_c_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG)
|
|
|
|
builtin_check_c_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG)
|
|
|
|
builtin_check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FREESTANDING_FLAG)
|
2016-11-16 09:01:13 +08:00
|
|
|
builtin_check_c_compiler_flag(-fxray-instrument COMPILER_RT_HAS_XRAY_COMPILER_FLAG)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
|
2016-08-16 04:12:43 +08:00
|
|
|
builtin_check_c_compiler_source(COMPILER_RT_HAS_ATOMIC_KEYWORD
|
2016-08-12 09:29:26 +08:00
|
|
|
"
|
|
|
|
int foo(int x, int y) {
|
|
|
|
_Atomic int result = x * y;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
set(ARM64 aarch64)
|
2017-05-24 23:53:24 +08:00
|
|
|
set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k)
|
2018-05-09 22:44:54 +08:00
|
|
|
set(HEXAGON hexagon)
|
2017-08-29 04:30:12 +08:00
|
|
|
set(X86 i386)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
set(X86_64 x86_64)
|
|
|
|
set(MIPS32 mips mipsel)
|
|
|
|
set(MIPS64 mips64 mips64el)
|
|
|
|
set(PPC64 powerpc64 powerpc64le)
|
2018-03-01 15:47:27 +08:00
|
|
|
set(RISCV32 riscv32)
|
|
|
|
set(RISCV64 riscv64)
|
2019-07-12 16:30:17 +08:00
|
|
|
set(SPARC sparc)
|
|
|
|
set(SPARCV9 sparcv9)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
set(WASM32 wasm32)
|
|
|
|
set(WASM64 wasm64)
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
set(ARM64 arm64)
|
|
|
|
set(ARM32 armv7 armv7k armv7s)
|
|
|
|
set(X86_64 x86_64 x86_64h)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
|
2019-07-12 16:30:17 +08:00
|
|
|
${HEXAGON} ${MIPS32} ${MIPS64} ${PPC64} ${RISCV32} ${RISCV64} ${SPARC} ${SPARCV9} ${WASM32} ${WASM64})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
|
|
|
|
include(CompilerRTUtils)
|
|
|
|
include(CompilerRTDarwinUtils)
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
|
|
|
|
find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx)
|
|
|
|
find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator)
|
|
|
|
find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos)
|
|
|
|
find_darwin_sdk_dir(DARWIN_watchossim_SYSROOT watchsimulator)
|
|
|
|
find_darwin_sdk_dir(DARWIN_watchos_SYSROOT watchos)
|
|
|
|
find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator)
|
|
|
|
find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos)
|
|
|
|
|
|
|
|
set(DARWIN_EMBEDDED_PLATFORMS)
|
|
|
|
set(DARWIN_osx_BUILTIN_MIN_VER 10.5)
|
|
|
|
set(DARWIN_osx_BUILTIN_MIN_VER_FLAG
|
|
|
|
-mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER})
|
2019-09-14 01:31:22 +08:00
|
|
|
set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
|
|
|
|
if(COMPILER_RT_ENABLE_IOS)
|
|
|
|
list(APPEND DARWIN_EMBEDDED_PLATFORMS ios)
|
|
|
|
set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min)
|
|
|
|
set(DARWIN_ios_BUILTIN_MIN_VER 6.0)
|
|
|
|
set(DARWIN_ios_BUILTIN_MIN_VER_FLAG
|
|
|
|
${DARWIN_ios_MIN_VER_FLAG}=${DARWIN_ios_BUILTIN_MIN_VER})
|
2019-09-14 01:31:22 +08:00
|
|
|
set(DARWIN_ios_BUILTIN_ALL_POSSIBLE_ARCHS ${ARM64} ${ARM32})
|
|
|
|
set(DARWIN_iossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
endif()
|
|
|
|
if(COMPILER_RT_ENABLE_WATCHOS)
|
|
|
|
list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos)
|
|
|
|
set(DARWIN_watchos_MIN_VER_FLAG -mwatchos-version-min)
|
|
|
|
set(DARWIN_watchos_BUILTIN_MIN_VER 2.0)
|
|
|
|
set(DARWIN_watchos_BUILTIN_MIN_VER_FLAG
|
|
|
|
${DARWIN_watchos_MIN_VER_FLAG}=${DARWIN_watchos_BUILTIN_MIN_VER})
|
2019-09-14 01:31:22 +08:00
|
|
|
set(DARWIN_watchos_BUILTIN_ALL_POSSIBLE_ARCHS armv7 armv7k)
|
|
|
|
set(DARWIN_watchossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
endif()
|
|
|
|
if(COMPILER_RT_ENABLE_TVOS)
|
|
|
|
list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos)
|
|
|
|
set(DARWIN_tvos_MIN_VER_FLAG -mtvos-version-min)
|
|
|
|
set(DARWIN_tvos_BUILTIN_MIN_VER 9.0)
|
|
|
|
set(DARWIN_tvos_BUILTIN_MIN_VER_FLAG
|
|
|
|
${DARWIN_tvos_MIN_VER_FLAG}=${DARWIN_tvos_BUILTIN_MIN_VER})
|
2019-09-14 01:31:22 +08:00
|
|
|
set(DARWIN_tvos_BUILTIN_ALL_POSSIBLE_ARCHS armv7 arm64)
|
|
|
|
set(DARWIN_tvossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(BUILTIN_SUPPORTED_OS osx)
|
|
|
|
|
|
|
|
# We're setting the flag manually for each target OS
|
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
|
|
|
|
2019-09-14 01:31:22 +08:00
|
|
|
# NOTE: We deliberately avoid using `DARWIN_<os>_ARCHS` here because that is
|
|
|
|
# used by `config-ix.cmake` in the context of building the rest of
|
|
|
|
# compiler-rt where the global `${TEST_COMPILE_ONLY}` (used by
|
|
|
|
# `darwin_test_archs()`) has a different value.
|
|
|
|
darwin_test_archs(osx
|
|
|
|
DARWIN_osx_BUILTIN_ARCHS
|
|
|
|
${DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS}
|
|
|
|
)
|
|
|
|
message(STATUS "OSX supported builtin arches: ${DARWIN_osx_BUILTIN_ARCHS}")
|
|
|
|
foreach(arch ${DARWIN_osx_BUILTIN_ARCHS})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
|
|
|
set(CAN_TARGET_${arch} 1)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(platform ${DARWIN_EMBEDDED_PLATFORMS})
|
|
|
|
if(DARWIN_${platform}sim_SYSROOT)
|
|
|
|
set(DARWIN_${platform}sim_BUILTIN_MIN_VER
|
|
|
|
${DARWIN_${platform}_BUILTIN_MIN_VER})
|
|
|
|
set(DARWIN_${platform}sim_BUILTIN_MIN_VER_FLAG
|
|
|
|
${DARWIN_${platform}_BUILTIN_MIN_VER_FLAG})
|
|
|
|
|
|
|
|
set(DARWIN_${platform}sim_SKIP_CC_KEXT On)
|
|
|
|
|
|
|
|
darwin_test_archs(${platform}sim
|
2019-09-14 01:31:22 +08:00
|
|
|
DARWIN_${platform}sim_BUILTIN_ARCHS
|
|
|
|
${DARWIN_${platform}sim_BUILTIN_ALL_POSSIBLE_ARCHS}
|
|
|
|
)
|
|
|
|
message(STATUS "${platform} Simulator supported builtin arches: ${DARWIN_${platform}sim_BUILTIN_ARCHS}")
|
|
|
|
if(DARWIN_${platform}sim_BUILTIN_ARCHS)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
list(APPEND BUILTIN_SUPPORTED_OS ${platform}sim)
|
|
|
|
endif()
|
2019-09-14 01:31:22 +08:00
|
|
|
foreach(arch ${DARWIN_${platform}sim_BUILTIN_ARCHS})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
|
|
|
set(CAN_TARGET_${arch} 1)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DARWIN_${platform}_SYSROOT)
|
|
|
|
darwin_test_archs(${platform}
|
2019-09-14 01:31:22 +08:00
|
|
|
DARWIN_${platform}_BUILTIN_ARCHS
|
|
|
|
${DARWIN_${platform}_BUILTIN_ALL_POSSIBLE_ARCHS}
|
|
|
|
)
|
|
|
|
message(STATUS "${platform} supported builtin arches: ${DARWIN_${platform}_BUILTIN_ARCHS}")
|
|
|
|
if(DARWIN_${platform}_BUILTIN_ARCHS)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
list(APPEND BUILTIN_SUPPORTED_OS ${platform})
|
|
|
|
endif()
|
2019-09-14 01:31:22 +08:00
|
|
|
foreach(arch ${DARWIN_${platform}_BUILTIN_ARCHS})
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-10 05:45:52 +08:00
|
|
|
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
|
|
|
set(CAN_TARGET_${arch} 1)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
list_intersect(BUILTIN_SUPPORTED_ARCH ALL_BUILTIN_SUPPORTED_ARCH COMPILER_RT_SUPPORTED_ARCH)
|
|
|
|
|
|
|
|
else()
|
|
|
|
# If we're not building the builtins standalone, just rely on the tests in
|
|
|
|
# config-ix.cmake to tell us what to build. Otherwise we need to do some leg
|
|
|
|
# work here...
|
|
|
|
if(COMPILER_RT_BUILTINS_STANDALONE_BUILD)
|
|
|
|
test_targets()
|
|
|
|
endif()
|
|
|
|
# Architectures supported by compiler-rt libraries.
|
|
|
|
filter_available_targets(BUILTIN_SUPPORTED_ARCH
|
|
|
|
${ALL_BUILTIN_SUPPORTED_ARCH})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Builtin supported architectures: ${BUILTIN_SUPPORTED_ARCH}")
|