2014-02-14 17:20:33 +08:00
|
|
|
# This directory contains a large amount of C code which provides
|
|
|
|
# generic implementations of the core runtime library along with optimized
|
|
|
|
# architecture-specific code in various subdirectories.
|
|
|
|
|
[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 (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
2016-06-01 04:21:42 +08:00
|
|
|
cmake_minimum_required(VERSION 3.4.3)
|
[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
|
|
|
|
|
|
|
project(CompilerRTBuiltins C ASM)
|
|
|
|
set(COMPILER_RT_STANDALONE_BUILD TRUE)
|
|
|
|
set(COMPILER_RT_BUILTINS_STANDALONE_BUILD TRUE)
|
|
|
|
list(INSERT CMAKE_MODULE_PATH 0
|
|
|
|
"${CMAKE_SOURCE_DIR}/../../cmake"
|
|
|
|
"${CMAKE_SOURCE_DIR}/../../cmake/Modules")
|
|
|
|
include(base-config-ix)
|
|
|
|
include(CompilerRTUtils)
|
2016-08-02 13:51:05 +08:00
|
|
|
|
|
|
|
load_llvm_config()
|
|
|
|
construct_compiler_rt_default_triple()
|
|
|
|
|
[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(APPLE)
|
|
|
|
include(CompilerRTDarwinUtils)
|
|
|
|
endif()
|
|
|
|
include(AddCompilerRT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(builtin-config-ix)
|
|
|
|
|
2015-11-13 03:17:05 +08:00
|
|
|
# TODO: Need to add a mechanism for logging errors when builtin source files are
|
|
|
|
# added to a sub-directory and not this CMakeLists file.
|
2014-02-14 17:20:33 +08:00
|
|
|
set(GENERIC_SOURCES
|
|
|
|
absvdi2.c
|
|
|
|
absvsi2.c
|
|
|
|
absvti2.c
|
|
|
|
adddf3.c
|
|
|
|
addsf3.c
|
2014-06-20 04:24:49 +08:00
|
|
|
addtf3.c
|
2014-02-14 17:20:33 +08:00
|
|
|
addvdi3.c
|
|
|
|
addvsi3.c
|
|
|
|
addvti3.c
|
|
|
|
apple_versioning.c
|
|
|
|
ashldi3.c
|
|
|
|
ashlti3.c
|
|
|
|
ashrdi3.c
|
|
|
|
ashrti3.c
|
Add generic __bswap[ds]i2 implementations
Summary:
In FreeBSD we needed to add generic implementations for `__bswapdi2` and
`__bswapsi2`, since gcc 6.x for mips is emitting calls to these. See:
https://reviews.freebsd.org/D10838 and https://reviews.freebsd.org/rS318601
The actual mips code generated for these generic C versions is pretty
OK, as can be seen in the (FreeBSD) review.
I checked over gcc sources, and it seems that it can emit these calls on
more architectures, so maybe it's best to simply always add them to the
compiler-rt builtins library.
Reviewers: howard.hinnant, compnerd, petarj, emaste
Reviewed By: compnerd, emaste
Subscribers: mgorny, llvm-commits, arichardson
Differential Revision: https://reviews.llvm.org/D33516
llvm-svn: 303866
2017-05-25 22:52:14 +08:00
|
|
|
bswapdi2.c
|
|
|
|
bswapsi2.c
|
2014-02-14 17:20:33 +08:00
|
|
|
clzdi2.c
|
|
|
|
clzsi2.c
|
|
|
|
clzti2.c
|
|
|
|
cmpdi2.c
|
|
|
|
cmpti2.c
|
|
|
|
comparedf2.c
|
|
|
|
comparesf2.c
|
2016-07-15 06:02:35 +08:00
|
|
|
cpu_model.c
|
2014-02-14 17:20:33 +08:00
|
|
|
ctzdi2.c
|
|
|
|
ctzsi2.c
|
|
|
|
ctzti2.c
|
|
|
|
divdc3.c
|
|
|
|
divdf3.c
|
|
|
|
divdi3.c
|
|
|
|
divmoddi4.c
|
|
|
|
divmodsi4.c
|
|
|
|
divsc3.c
|
|
|
|
divsf3.c
|
|
|
|
divsi3.c
|
2015-11-23 03:13:49 +08:00
|
|
|
divtc3.c
|
2014-02-14 17:20:33 +08:00
|
|
|
divti3.c
|
2014-06-20 04:24:49 +08:00
|
|
|
divtf3.c
|
2014-02-14 17:20:33 +08:00
|
|
|
divxc3.c
|
|
|
|
extendsfdf2.c
|
2015-05-13 02:33:42 +08:00
|
|
|
extendhfsf2.c
|
2014-02-14 17:20:33 +08:00
|
|
|
ffsdi2.c
|
2017-04-07 02:12:02 +08:00
|
|
|
ffssi2.c
|
2014-02-14 17:20:33 +08:00
|
|
|
ffsti2.c
|
|
|
|
fixdfdi.c
|
|
|
|
fixdfsi.c
|
|
|
|
fixdfti.c
|
|
|
|
fixsfdi.c
|
|
|
|
fixsfsi.c
|
|
|
|
fixsfti.c
|
|
|
|
fixunsdfdi.c
|
|
|
|
fixunsdfsi.c
|
|
|
|
fixunsdfti.c
|
|
|
|
fixunssfdi.c
|
|
|
|
fixunssfsi.c
|
|
|
|
fixunssfti.c
|
|
|
|
fixunsxfdi.c
|
|
|
|
fixunsxfsi.c
|
|
|
|
fixunsxfti.c
|
|
|
|
fixxfdi.c
|
|
|
|
fixxfti.c
|
|
|
|
floatdidf.c
|
|
|
|
floatdisf.c
|
|
|
|
floatdixf.c
|
|
|
|
floatsidf.c
|
|
|
|
floatsisf.c
|
|
|
|
floattidf.c
|
|
|
|
floattisf.c
|
|
|
|
floattixf.c
|
|
|
|
floatundidf.c
|
|
|
|
floatundisf.c
|
|
|
|
floatundixf.c
|
|
|
|
floatunsidf.c
|
|
|
|
floatunsisf.c
|
|
|
|
floatuntidf.c
|
|
|
|
floatuntisf.c
|
|
|
|
floatuntixf.c
|
|
|
|
int_util.c
|
|
|
|
lshrdi3.c
|
|
|
|
lshrti3.c
|
|
|
|
moddi3.c
|
|
|
|
modsi3.c
|
|
|
|
modti3.c
|
|
|
|
muldc3.c
|
|
|
|
muldf3.c
|
|
|
|
muldi3.c
|
|
|
|
mulodi4.c
|
|
|
|
mulosi4.c
|
|
|
|
muloti4.c
|
|
|
|
mulsc3.c
|
|
|
|
mulsf3.c
|
|
|
|
multi3.c
|
2014-06-20 04:34:03 +08:00
|
|
|
multf3.c
|
2014-02-14 17:20:33 +08:00
|
|
|
mulvdi3.c
|
|
|
|
mulvsi3.c
|
|
|
|
mulvti3.c
|
|
|
|
mulxc3.c
|
|
|
|
negdf2.c
|
|
|
|
negdi2.c
|
|
|
|
negsf2.c
|
|
|
|
negti2.c
|
|
|
|
negvdi2.c
|
|
|
|
negvsi2.c
|
|
|
|
negvti2.c
|
2017-03-10 01:02:16 +08:00
|
|
|
os_version_check.c
|
2014-02-14 17:20:33 +08:00
|
|
|
paritydi2.c
|
|
|
|
paritysi2.c
|
|
|
|
parityti2.c
|
|
|
|
popcountdi2.c
|
|
|
|
popcountsi2.c
|
|
|
|
popcountti2.c
|
|
|
|
powidf2.c
|
|
|
|
powisf2.c
|
|
|
|
powitf2.c
|
|
|
|
powixf2.c
|
|
|
|
subdf3.c
|
|
|
|
subsf3.c
|
|
|
|
subvdi3.c
|
|
|
|
subvsi3.c
|
|
|
|
subvti3.c
|
2014-06-20 04:24:49 +08:00
|
|
|
subtf3.c
|
2014-02-14 17:20:33 +08:00
|
|
|
trampoline_setup.c
|
2015-05-13 02:33:42 +08:00
|
|
|
truncdfhf2.c
|
2014-02-14 17:20:33 +08:00
|
|
|
truncdfsf2.c
|
2015-05-13 02:33:42 +08:00
|
|
|
truncsfhf2.c
|
2014-02-14 17:20:33 +08:00
|
|
|
ucmpdi2.c
|
|
|
|
ucmpti2.c
|
|
|
|
udivdi3.c
|
|
|
|
udivmoddi4.c
|
|
|
|
udivmodsi4.c
|
|
|
|
udivmodti4.c
|
|
|
|
udivsi3.c
|
|
|
|
udivti3.c
|
|
|
|
umoddi3.c
|
|
|
|
umodsi3.c
|
2017-05-25 22:45:54 +08:00
|
|
|
umodti3.c)
|
2014-02-14 17:20:33 +08:00
|
|
|
|
2017-05-04 21:34:17 +08:00
|
|
|
set(GENERIC_TF_SOURCES
|
|
|
|
comparetf2.c
|
|
|
|
extenddftf2.c
|
|
|
|
extendsftf2.c
|
|
|
|
fixtfdi.c
|
|
|
|
fixtfsi.c
|
|
|
|
fixtfti.c
|
|
|
|
fixunstfdi.c
|
|
|
|
fixunstfsi.c
|
|
|
|
fixunstfti.c
|
|
|
|
floatditf.c
|
|
|
|
floatsitf.c
|
|
|
|
floattitf.c
|
|
|
|
floatunditf.c
|
|
|
|
floatunsitf.c
|
|
|
|
floatuntitf.c
|
|
|
|
multc3.c
|
|
|
|
trunctfdf2.c
|
|
|
|
trunctfsf2.c)
|
|
|
|
|
2016-09-02 05:05:49 +08:00
|
|
|
option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
|
|
|
|
"Skip the atomic builtin (this may be needed if system headers are unavailable)"
|
|
|
|
Off)
|
|
|
|
|
2017-07-13 03:33:30 +08:00
|
|
|
if(NOT FUCHSIA AND NOT COMPILER_RT_BAREMETAL_BUILD)
|
2017-05-10 23:34:25 +08:00
|
|
|
set(GENERIC_SOURCES
|
|
|
|
${GENERIC_SOURCES}
|
2017-05-25 22:45:54 +08:00
|
|
|
emutls.c
|
2017-07-13 03:33:30 +08:00
|
|
|
enable_execute_stack.c
|
|
|
|
eprintf.c)
|
2017-05-10 23:34:25 +08:00
|
|
|
endif()
|
|
|
|
|
2016-09-02 05:05:49 +08:00
|
|
|
if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN)
|
2016-08-12 09:29:26 +08:00
|
|
|
set(GENERIC_SOURCES
|
|
|
|
${GENERIC_SOURCES}
|
|
|
|
atomic.c)
|
|
|
|
endif()
|
|
|
|
|
2015-09-23 23:28:44 +08:00
|
|
|
if(APPLE)
|
|
|
|
set(GENERIC_SOURCES
|
|
|
|
${GENERIC_SOURCES}
|
|
|
|
atomic_flag_clear.c
|
|
|
|
atomic_flag_clear_explicit.c
|
|
|
|
atomic_flag_test_and_set.c
|
|
|
|
atomic_flag_test_and_set_explicit.c
|
|
|
|
atomic_signal_fence.c
|
|
|
|
atomic_thread_fence.c)
|
|
|
|
endif()
|
|
|
|
|
2015-01-14 23:55:17 +08:00
|
|
|
if (HAVE_UNWIND_H)
|
|
|
|
set(GENERIC_SOURCES
|
|
|
|
${GENERIC_SOURCES}
|
|
|
|
gcc_personality_v0.c)
|
|
|
|
endif ()
|
|
|
|
|
2017-07-13 03:33:30 +08:00
|
|
|
if (NOT FUCHSIA)
|
|
|
|
set(GENERIC_SOURCES
|
|
|
|
${GENERIC_SOURCES}
|
|
|
|
clear_cache.c)
|
|
|
|
endif()
|
|
|
|
|
2015-10-15 10:47:19 +08:00
|
|
|
if (NOT MSVC)
|
2015-07-18 00:23:05 +08:00
|
|
|
set(x86_64_SOURCES
|
2015-11-13 03:15:56 +08:00
|
|
|
x86_64/chkstk.S
|
|
|
|
x86_64/chkstk2.S
|
2015-10-15 10:47:19 +08:00
|
|
|
x86_64/floatdidf.c
|
|
|
|
x86_64/floatdisf.c
|
|
|
|
x86_64/floatdixf.c
|
|
|
|
x86_64/floatundidf.S
|
|
|
|
x86_64/floatundisf.S
|
2017-08-31 01:12:57 +08:00
|
|
|
x86_64/floatundixf.S)
|
|
|
|
filter_builtin_sources(x86_64_SOURCES EXCLUDE x86_64_SOURCES "${x86_64_SOURCES};${GENERIC_SOURCES}")
|
2015-10-15 10:47:19 +08:00
|
|
|
set(x86_64h_SOURCES ${x86_64_SOURCES})
|
2015-07-18 00:23:05 +08:00
|
|
|
|
2015-10-15 10:47:19 +08:00
|
|
|
if (WIN32)
|
|
|
|
set(x86_64_SOURCES
|
|
|
|
${x86_64_SOURCES}
|
2015-11-04 00:04:28 +08:00
|
|
|
x86_64/chkstk.S
|
2015-11-03 23:46:23 +08:00
|
|
|
x86_64/chkstk2.S)
|
2015-10-15 10:47:19 +08:00
|
|
|
endif()
|
2014-02-14 17:20:33 +08:00
|
|
|
|
2015-07-18 00:23:05 +08:00
|
|
|
set(i386_SOURCES
|
2015-10-15 10:47:19 +08:00
|
|
|
i386/ashldi3.S
|
|
|
|
i386/ashrdi3.S
|
2015-11-13 03:15:56 +08:00
|
|
|
i386/chkstk.S
|
|
|
|
i386/chkstk2.S
|
2015-10-15 10:47:19 +08:00
|
|
|
i386/divdi3.S
|
|
|
|
i386/floatdidf.S
|
|
|
|
i386/floatdisf.S
|
|
|
|
i386/floatdixf.S
|
|
|
|
i386/floatundidf.S
|
|
|
|
i386/floatundisf.S
|
|
|
|
i386/floatundixf.S
|
|
|
|
i386/lshrdi3.S
|
|
|
|
i386/moddi3.S
|
|
|
|
i386/muldi3.S
|
|
|
|
i386/udivdi3.S
|
2017-08-31 01:12:57 +08:00
|
|
|
i386/umoddi3.S)
|
|
|
|
filter_builtin_sources(i386_SOURCES EXCLUDE i386_SOURCES "${i386_SOURCES};${GENERIC_SOURCES}")
|
2015-07-18 00:23:05 +08:00
|
|
|
|
2015-10-15 10:47:19 +08:00
|
|
|
if (WIN32)
|
|
|
|
set(i386_SOURCES
|
|
|
|
${i386_SOURCES}
|
2015-11-04 00:04:28 +08:00
|
|
|
i386/chkstk.S
|
2015-11-03 23:46:23 +08:00
|
|
|
i386/chkstk2.S)
|
2015-10-15 10:47:19 +08:00
|
|
|
endif()
|
|
|
|
else () # MSVC
|
|
|
|
# Use C versions of functions when building on MSVC
|
2016-02-20 20:56:04 +08:00
|
|
|
# MSVC's assembler takes Intel syntax, not AT&T syntax.
|
|
|
|
# Also use only MSVC compilable builtin implementations.
|
2015-10-15 10:47:19 +08:00
|
|
|
set(x86_64_SOURCES
|
|
|
|
x86_64/floatdidf.c
|
|
|
|
x86_64/floatdisf.c
|
|
|
|
x86_64/floatdixf.c
|
2017-04-08 00:35:09 +08:00
|
|
|
${GENERIC_SOURCES})
|
2015-10-15 10:47:19 +08:00
|
|
|
set(x86_64h_SOURCES ${x86_64_SOURCES})
|
2017-04-08 00:35:09 +08:00
|
|
|
set(i386_SOURCES ${GENERIC_SOURCES})
|
2015-10-15 10:47:19 +08:00
|
|
|
endif () # if (NOT MSVC)
|
2014-10-01 20:55:06 +08:00
|
|
|
|
2014-02-14 17:20:33 +08:00
|
|
|
set(arm_SOURCES
|
2016-08-05 05:58:39 +08:00
|
|
|
arm/bswapdi2.S
|
|
|
|
arm/bswapsi2.S
|
|
|
|
arm/clzdi2.S
|
|
|
|
arm/clzsi2.S
|
|
|
|
arm/comparesf2.S
|
|
|
|
arm/divmodsi4.S
|
|
|
|
arm/divsi3.S
|
|
|
|
arm/modsi3.S
|
|
|
|
arm/sync_fetch_and_add_4.S
|
|
|
|
arm/sync_fetch_and_add_8.S
|
|
|
|
arm/sync_fetch_and_and_4.S
|
|
|
|
arm/sync_fetch_and_and_8.S
|
|
|
|
arm/sync_fetch_and_max_4.S
|
|
|
|
arm/sync_fetch_and_max_8.S
|
|
|
|
arm/sync_fetch_and_min_4.S
|
|
|
|
arm/sync_fetch_and_min_8.S
|
|
|
|
arm/sync_fetch_and_nand_4.S
|
|
|
|
arm/sync_fetch_and_nand_8.S
|
|
|
|
arm/sync_fetch_and_or_4.S
|
|
|
|
arm/sync_fetch_and_or_8.S
|
|
|
|
arm/sync_fetch_and_sub_4.S
|
|
|
|
arm/sync_fetch_and_sub_8.S
|
|
|
|
arm/sync_fetch_and_umax_4.S
|
|
|
|
arm/sync_fetch_and_umax_8.S
|
|
|
|
arm/sync_fetch_and_umin_4.S
|
|
|
|
arm/sync_fetch_and_umin_8.S
|
|
|
|
arm/sync_fetch_and_xor_4.S
|
|
|
|
arm/sync_fetch_and_xor_8.S
|
|
|
|
arm/udivmodsi4.S
|
|
|
|
arm/udivsi3.S
|
2017-08-31 01:12:57 +08:00
|
|
|
arm/umodsi3.S)
|
|
|
|
filter_builtin_sources(arm_SOURCES EXCLUDE arm_SOURCES "${arm_SOURCES};${GENERIC_SOURCES}")
|
2016-08-05 05:58:39 +08:00
|
|
|
|
2017-01-20 02:46:11 +08:00
|
|
|
set(thumb1_SOURCES
|
|
|
|
arm/divsi3.S
|
|
|
|
arm/udivsi3.S
|
|
|
|
arm/comparesf2.S
|
2017-02-06 14:04:10 +08:00
|
|
|
arm/addsf3.S
|
2017-01-20 02:46:11 +08:00
|
|
|
${GENERIC_SOURCES})
|
|
|
|
|
2016-08-05 05:58:39 +08:00
|
|
|
set(arm_EABI_SOURCES
|
2015-08-21 08:25:37 +08:00
|
|
|
arm/aeabi_cdcmp.S
|
|
|
|
arm/aeabi_cdcmpeq_check_nan.c
|
|
|
|
arm/aeabi_cfcmp.S
|
|
|
|
arm/aeabi_cfcmpeq_check_nan.c
|
2014-02-14 17:20:33 +08:00
|
|
|
arm/aeabi_dcmp.S
|
2014-09-07 05:34:02 +08:00
|
|
|
arm/aeabi_div0.c
|
2015-08-19 02:10:33 +08:00
|
|
|
arm/aeabi_drsub.c
|
2014-02-14 17:20:33 +08:00
|
|
|
arm/aeabi_fcmp.S
|
2015-08-19 02:10:33 +08:00
|
|
|
arm/aeabi_frsub.c
|
2014-02-14 17:20:33 +08:00
|
|
|
arm/aeabi_idivmod.S
|
|
|
|
arm/aeabi_ldivmod.S
|
|
|
|
arm/aeabi_memcmp.S
|
|
|
|
arm/aeabi_memcpy.S
|
|
|
|
arm/aeabi_memmove.S
|
|
|
|
arm/aeabi_memset.S
|
|
|
|
arm/aeabi_uidivmod.S
|
2016-08-05 05:58:39 +08:00
|
|
|
arm/aeabi_uldivmod.S)
|
2017-01-20 02:46:11 +08:00
|
|
|
|
2016-08-06 00:24:56 +08:00
|
|
|
set(arm_Thumb1_JT_SOURCES
|
|
|
|
arm/switch16.S
|
|
|
|
arm/switch32.S
|
|
|
|
arm/switch8.S
|
|
|
|
arm/switchu8.S)
|
|
|
|
set(arm_Thumb1_SjLj_EH_SOURCES
|
|
|
|
arm/restore_vfp_d8_d15_regs.S
|
|
|
|
arm/save_vfp_d8_d15_regs.S)
|
|
|
|
set(arm_Thumb1_VFPv2_SOURCES
|
2016-08-05 05:58:39 +08:00
|
|
|
arm/adddf3vfp.S
|
|
|
|
arm/addsf3vfp.S
|
2014-02-14 17:20:33 +08:00
|
|
|
arm/divdf3vfp.S
|
|
|
|
arm/divsf3vfp.S
|
|
|
|
arm/eqdf2vfp.S
|
|
|
|
arm/eqsf2vfp.S
|
|
|
|
arm/extendsfdf2vfp.S
|
|
|
|
arm/fixdfsivfp.S
|
|
|
|
arm/fixsfsivfp.S
|
|
|
|
arm/fixunsdfsivfp.S
|
|
|
|
arm/fixunssfsivfp.S
|
|
|
|
arm/floatsidfvfp.S
|
|
|
|
arm/floatsisfvfp.S
|
|
|
|
arm/floatunssidfvfp.S
|
|
|
|
arm/floatunssisfvfp.S
|
|
|
|
arm/gedf2vfp.S
|
|
|
|
arm/gesf2vfp.S
|
|
|
|
arm/gtdf2vfp.S
|
|
|
|
arm/gtsf2vfp.S
|
|
|
|
arm/ledf2vfp.S
|
|
|
|
arm/lesf2vfp.S
|
|
|
|
arm/ltdf2vfp.S
|
|
|
|
arm/ltsf2vfp.S
|
|
|
|
arm/muldf3vfp.S
|
|
|
|
arm/mulsf3vfp.S
|
|
|
|
arm/nedf2vfp.S
|
|
|
|
arm/negdf2vfp.S
|
|
|
|
arm/negsf2vfp.S
|
|
|
|
arm/nesf2vfp.S
|
|
|
|
arm/subdf3vfp.S
|
|
|
|
arm/subsf3vfp.S
|
|
|
|
arm/truncdfsf2vfp.S
|
|
|
|
arm/unorddf2vfp.S
|
2016-08-05 05:58:39 +08:00
|
|
|
arm/unordsf2vfp.S)
|
2016-08-06 00:24:56 +08:00
|
|
|
set(arm_Thumb1_icache_SOURCES
|
|
|
|
arm/sync_synchronize.S)
|
|
|
|
set(arm_Thumb1_SOURCES
|
|
|
|
${arm_Thumb1_JT_SOURCES}
|
|
|
|
${arm_Thumb1_SjLj_EH_SOURCES}
|
|
|
|
${arm_Thumb1_VFPv2_SOURCES}
|
|
|
|
${arm_Thumb1_icache_SOURCES})
|
2016-08-05 05:58:39 +08:00
|
|
|
|
2016-11-20 05:22:38 +08:00
|
|
|
if(MINGW)
|
|
|
|
set(arm_SOURCES
|
|
|
|
arm/aeabi_idivmod.S
|
|
|
|
arm/aeabi_ldivmod.S
|
|
|
|
arm/aeabi_uidivmod.S
|
|
|
|
arm/aeabi_uldivmod.S
|
|
|
|
divmoddi4.c
|
|
|
|
divmodsi4.c
|
|
|
|
divdi3.c
|
|
|
|
divsi3.c
|
|
|
|
fixdfdi.c
|
|
|
|
fixsfdi.c
|
|
|
|
fixunsdfdi.c
|
|
|
|
fixunssfdi.c
|
|
|
|
floatdidf.c
|
|
|
|
floatdisf.c
|
|
|
|
floatundidf.c
|
|
|
|
floatundisf.c
|
|
|
|
mingw_fixfloat.c
|
|
|
|
moddi3.c
|
|
|
|
udivmoddi4.c
|
|
|
|
udivmodsi4.c
|
|
|
|
udivsi3.c
|
2017-05-06 23:13:17 +08:00
|
|
|
umoddi3.c
|
|
|
|
emutls.c)
|
2016-12-02 06:00:54 +08:00
|
|
|
elseif(NOT WIN32)
|
2016-08-06 00:24:56 +08:00
|
|
|
# TODO the EABI sources should only be added to EABI targets
|
2016-08-05 05:58:39 +08:00
|
|
|
set(arm_SOURCES
|
|
|
|
${arm_SOURCES}
|
|
|
|
${arm_EABI_SOURCES}
|
2016-08-06 00:24:56 +08:00
|
|
|
${arm_Thumb1_SOURCES})
|
2017-01-20 02:46:11 +08:00
|
|
|
|
|
|
|
set(thumb1_SOURCES
|
|
|
|
${thumb1_SOURCES}
|
2017-01-31 02:48:05 +08:00
|
|
|
${arm_EABI_SOURCES})
|
2016-08-05 05:58:39 +08:00
|
|
|
endif()
|
2014-02-14 17:20:33 +08:00
|
|
|
|
[compiler-rt] Add AArch64 to CMake configuration and several missing builtins
Summary:
Currently CMake doesn't build builtins for AArch64 and if one does this anyway
it's likely that at least `__multc3`, `__floatditf` and `__floatunditf` will be
missing. There is actually more builtins to add, but these come from
different libc implementations, thus providing them makes compiler-rt for
AArch64 good enough at least for basic usage.
Builtins implementation were originally taken from FreeBSD project:
* [[ https://reviews.freebsd.org/D2173 | __multc3 ]]
* [[ https://reviews.freebsd.org/D2174 | __floatditf and __floatunditf ]]
Until they have been tested to find mistakes in `__float*` functions.
`__floatditf` was based on `__floatsitf`, which had the same mistakes
(fixed it in r243746).
Version of the builtins in this patch are fixed and complemented with basic
tests. Additionally they were tested via GCC's torture (this is what revealed
these issues).
P.S. Ed (author of FreeBSD patches) asked for feedback on the list some time ago (here [[ http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/084064.html | here ]])
and got no response, but it seems to be worth adding these builtins as is and
extracting common part later.
Reviewers: howard.hinnant, t.p.northover, jmolloy, enefaim, rengolin, zatrazz
Subscribers: asl, emaste, samsonov, aemerson, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D11679
llvm-svn: 245296
2015-08-18 21:43:37 +08:00
|
|
|
set(aarch64_SOURCES
|
2017-05-04 21:34:17 +08:00
|
|
|
${GENERIC_TF_SOURCES}
|
[compiler-rt] Add AArch64 to CMake configuration and several missing builtins
Summary:
Currently CMake doesn't build builtins for AArch64 and if one does this anyway
it's likely that at least `__multc3`, `__floatditf` and `__floatunditf` will be
missing. There is actually more builtins to add, but these come from
different libc implementations, thus providing them makes compiler-rt for
AArch64 good enough at least for basic usage.
Builtins implementation were originally taken from FreeBSD project:
* [[ https://reviews.freebsd.org/D2173 | __multc3 ]]
* [[ https://reviews.freebsd.org/D2174 | __floatditf and __floatunditf ]]
Until they have been tested to find mistakes in `__float*` functions.
`__floatditf` was based on `__floatsitf`, which had the same mistakes
(fixed it in r243746).
Version of the builtins in this patch are fixed and complemented with basic
tests. Additionally they were tested via GCC's torture (this is what revealed
these issues).
P.S. Ed (author of FreeBSD patches) asked for feedback on the list some time ago (here [[ http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/084064.html | here ]])
and got no response, but it seems to be worth adding these builtins as is and
extracting common part later.
Reviewers: howard.hinnant, t.p.northover, jmolloy, enefaim, rengolin, zatrazz
Subscribers: asl, emaste, samsonov, aemerson, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D11679
llvm-svn: 245296
2015-08-18 21:43:37 +08:00
|
|
|
${GENERIC_SOURCES})
|
|
|
|
|
2015-09-26 11:26:01 +08:00
|
|
|
set(armhf_SOURCES ${arm_SOURCES})
|
2015-09-01 05:24:50 +08:00
|
|
|
set(armv7_SOURCES ${arm_SOURCES})
|
|
|
|
set(armv7s_SOURCES ${arm_SOURCES})
|
2016-02-02 10:01:17 +08:00
|
|
|
set(armv7k_SOURCES ${arm_SOURCES})
|
2015-09-01 05:24:50 +08:00
|
|
|
set(arm64_SOURCES ${aarch64_SOURCES})
|
|
|
|
|
2015-09-30 07:13:45 +08:00
|
|
|
# macho_embedded archs
|
2017-01-20 02:46:11 +08:00
|
|
|
set(armv6m_SOURCES ${thumb1_SOURCES})
|
2015-09-30 07:13:45 +08:00
|
|
|
set(armv7m_SOURCES ${arm_SOURCES})
|
|
|
|
set(armv7em_SOURCES ${arm_SOURCES})
|
|
|
|
|
2015-10-06 17:02:38 +08:00
|
|
|
set(mips_SOURCES ${GENERIC_SOURCES})
|
|
|
|
set(mipsel_SOURCES ${mips_SOURCES})
|
2017-05-04 21:34:17 +08:00
|
|
|
set(mips64_SOURCES ${GENERIC_TF_SOURCES}
|
|
|
|
${mips_SOURCES})
|
|
|
|
set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
|
|
|
|
${mips_SOURCES})
|
2015-10-06 17:02:38 +08:00
|
|
|
|
2016-01-14 00:56:15 +08:00
|
|
|
set(wasm32_SOURCES ${GENERIC_SOURCES})
|
|
|
|
set(wasm64_SOURCES ${GENERIC_SOURCES})
|
|
|
|
|
2014-02-18 17:33:45 +08:00
|
|
|
add_custom_target(builtins)
|
2016-07-12 05:51:56 +08:00
|
|
|
set_target_properties(builtins PROPERTIES FOLDER "Compiler-RT Misc")
|
2014-02-18 17:33:45 +08:00
|
|
|
|
2015-09-01 05:24:50 +08:00
|
|
|
if (APPLE)
|
2015-09-30 07:21:07 +08:00
|
|
|
add_subdirectory(Darwin-excludes)
|
|
|
|
add_subdirectory(macho_embedded)
|
2015-09-23 23:18:17 +08:00
|
|
|
darwin_add_builtin_libraries(${BUILTIN_SUPPORTED_OS})
|
2016-02-20 20:56:04 +08:00
|
|
|
else ()
|
2016-08-23 04:33:47 +08:00
|
|
|
set(BUILTIN_CFLAGS "")
|
2016-10-29 07:19:03 +08:00
|
|
|
|
2016-11-29 10:31:40 +08:00
|
|
|
append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS)
|
2016-08-23 04:33:47 +08:00
|
|
|
|
|
|
|
# These flags would normally be added to CMAKE_C_FLAGS by the llvm
|
|
|
|
# cmake step. Add them manually if this is a standalone build.
|
|
|
|
if(COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC BUILTIN_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin BUILTIN_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -fvisibility=hidden BUILTIN_CFLAGS)
|
|
|
|
if(NOT COMPILER_RT_DEBUG)
|
|
|
|
append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fomit-frame-pointer BUILTIN_CFLAGS)
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-11-20 11:37:12 +08:00
|
|
|
|
2016-10-29 07:19:03 +08:00
|
|
|
set(BUILTIN_DEFS "")
|
|
|
|
|
|
|
|
append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS)
|
|
|
|
|
2015-09-01 05:24:50 +08:00
|
|
|
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
|
2014-07-27 07:44:22 +08:00
|
|
|
if (CAN_TARGET_${arch})
|
2017-05-16 03:09:13 +08:00
|
|
|
# NOTE: some architectures (e.g. i386) have multiple names. Ensure that
|
|
|
|
# we catch them all.
|
2017-08-10 21:27:29 +08:00
|
|
|
set(_arch ${arch})
|
2017-08-29 04:30:12 +08:00
|
|
|
if("${arch}" STREQUAL "armv6m")
|
2017-08-10 21:27:29 +08:00
|
|
|
set(_arch "arm|armv6m")
|
|
|
|
elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
|
|
|
|
set(_arch "arm")
|
2017-05-16 03:09:13 +08:00
|
|
|
endif()
|
|
|
|
|
2014-07-27 07:44:22 +08:00
|
|
|
# Filter out generic versions of routines that are re-implemented in
|
|
|
|
# architecture specific manner. This prevents multiple definitions of the
|
|
|
|
# same symbols, making the symbol selection non-deterministic.
|
|
|
|
foreach (_file ${${arch}_SOURCES})
|
2017-05-16 03:09:13 +08:00
|
|
|
if (${_file} MATCHES ${_arch}/*)
|
2014-07-27 07:44:22 +08:00
|
|
|
get_filename_component(_name ${_file} NAME)
|
|
|
|
string(REPLACE ".S" ".c" _cname "${_name}")
|
|
|
|
list(REMOVE_ITEM ${arch}_SOURCES ${_cname})
|
|
|
|
endif ()
|
|
|
|
endforeach ()
|
|
|
|
|
2016-10-26 23:20:33 +08:00
|
|
|
# Needed for clear_cache on debug mode, due to r7's usage in inline asm.
|
|
|
|
# Release mode already sets it via -O2/3, Debug mode doesn't.
|
|
|
|
if (${arch} STREQUAL "armhf")
|
2017-03-29 11:36:46 +08:00
|
|
|
list(APPEND BUILTIN_CFLAGS -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
|
2016-10-26 23:20:33 +08:00
|
|
|
endif()
|
|
|
|
|
2015-08-26 03:53:09 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.builtins
|
|
|
|
STATIC
|
2015-09-01 05:24:50 +08:00
|
|
|
ARCHS ${arch}
|
2014-07-27 07:44:22 +08:00
|
|
|
SOURCES ${${arch}_SOURCES}
|
2016-10-29 07:19:03 +08:00
|
|
|
DEFS ${BUILTIN_DEFS}
|
2016-08-23 04:33:47 +08:00
|
|
|
CFLAGS ${BUILTIN_CFLAGS}
|
2015-08-26 03:53:09 +08:00
|
|
|
PARENT_TARGET builtins)
|
2014-07-27 07:44:22 +08:00
|
|
|
endif ()
|
|
|
|
endforeach ()
|
|
|
|
endif ()
|
2014-02-18 17:33:45 +08:00
|
|
|
|
|
|
|
add_dependencies(compiler-rt builtins)
|