[compiler-rt] r307832 - [builtins] Better Fuchsia support
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 12 12:33:30 PDT 2017
Author: phosek
Date: Wed Jul 12 12:33:30 2017
New Revision: 307832
URL: http://llvm.org/viewvc/llvm-project?rev=307832&view=rev
Log:
[builtins] Better Fuchsia support
Add Fuchsia support to some builtings and avoid building builtins
that are not and will never be used on Fuchsia.
Differential Revision: https://reviews.llvm.org/D34075
Modified:
compiler-rt/trunk/lib/builtins/CMakeLists.txt
compiler-rt/trunk/lib/builtins/int_util.c
Modified: compiler-rt/trunk/lib/builtins/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=307832&r1=307831&r2=307832&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt Wed Jul 12 12:33:30 2017
@@ -44,7 +44,6 @@ set(GENERIC_SOURCES
ashrti3.c
bswapdi2.c
bswapsi2.c
- clear_cache.c
clzdi2.c
clzsi2.c
clzti2.c
@@ -68,7 +67,6 @@ set(GENERIC_SOURCES
divti3.c
divtf3.c
divxc3.c
- eprintf.c
extendsfdf2.c
extendhfsf2.c
ffsdi2.c
@@ -191,11 +189,12 @@ option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTI
"Skip the atomic builtin (this may be needed if system headers are unavailable)"
Off)
-if(NOT COMPILER_RT_BAREMETAL_BUILD)
+if(NOT FUCHSIA AND NOT COMPILER_RT_BAREMETAL_BUILD)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
emutls.c
- enable_execute_stack.c)
+ enable_execute_stack.c
+ eprintf.c)
endif()
if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN)
@@ -221,6 +220,12 @@ if (HAVE_UNWIND_H)
gcc_personality_v0.c)
endif ()
+if (NOT FUCHSIA)
+ set(GENERIC_SOURCES
+ ${GENERIC_SOURCES}
+ clear_cache.c)
+endif()
+
if (NOT MSVC)
set(x86_64_SOURCES
x86_64/chkstk.S
Modified: compiler-rt/trunk/lib/builtins/int_util.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_util.c?rev=307832&r1=307831&r2=307832&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/int_util.c (original)
+++ compiler-rt/trunk/lib/builtins/int_util.c Wed Jul 12 12:33:30 2017
@@ -45,6 +45,16 @@ void compilerrt_abort_impl(const char *f
__assert_rtn(function, file, line, "libcompiler_rt abort");
}
+#elif __Fuchsia__
+
+#ifndef _WIN32
+__attribute__((weak))
+__attribute__((visibility("hidden")))
+#endif
+void compilerrt_abort_impl(const char *file, int line, const char *function) {
+ __builtin_trap();
+}
+
#else
/* Get the system definition of abort() */
More information about the llvm-commits
mailing list