[ORC-RT] Configure the ORC runtime for more architectures and platforms
Enable building the ORC runtime for 64-bit and 32-bit ARM architectures, and for all Darwin embedded platforms (iOS, tvOS, and watchOS). This covers building the cross-platform code, but does not add TLV runtime support for the new architectures, which can be added independently. Incidentally, stop building the Mach-O TLS support file unnecessarily on other platforms. Differential Revision: https://reviews.llvm.org/D112111
This commit is contained in:
@@ -78,5 +78,5 @@ endif()
|
|||||||
set(ALL_SHADOWCALLSTACK_SUPPORTED_ARCH ${ARM64})
|
set(ALL_SHADOWCALLSTACK_SUPPORTED_ARCH ${ARM64})
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
set(ALL_ORC_SUPPORTED_ARCH ${X86_64})
|
set(ALL_ORC_SUPPORTED_ARCH ${X86_64} ${ARM64} ${ARM32})
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -480,6 +480,7 @@ if(APPLE)
|
|||||||
list(APPEND PROFILE_SUPPORTED_OS ${platform}sim)
|
list(APPEND PROFILE_SUPPORTED_OS ${platform}sim)
|
||||||
list(APPEND TSAN_SUPPORTED_OS ${platform}sim)
|
list(APPEND TSAN_SUPPORTED_OS ${platform}sim)
|
||||||
list(APPEND FUZZER_SUPPORTED_OS ${platform}sim)
|
list(APPEND FUZZER_SUPPORTED_OS ${platform}sim)
|
||||||
|
list(APPEND ORC_SUPPORTED_OS ${platform}sim)
|
||||||
endif()
|
endif()
|
||||||
foreach(arch ${DARWIN_${platform}sim_ARCHS})
|
foreach(arch ${DARWIN_${platform}sim_ARCHS})
|
||||||
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
||||||
@@ -510,6 +511,7 @@ if(APPLE)
|
|||||||
list(APPEND TSAN_SUPPORTED_OS ${platform})
|
list(APPEND TSAN_SUPPORTED_OS ${platform})
|
||||||
endif()
|
endif()
|
||||||
list(APPEND FUZZER_SUPPORTED_OS ${platform})
|
list(APPEND FUZZER_SUPPORTED_OS ${platform})
|
||||||
|
list(APPEND ORC_SUPPORTED_OS ${platform})
|
||||||
endif()
|
endif()
|
||||||
foreach(arch ${DARWIN_${platform}_ARCHS})
|
foreach(arch ${DARWIN_${platform}_ARCHS})
|
||||||
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ set(ORC_SOURCES
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Implementation files for all ORC architectures.
|
# Implementation files for all ORC architectures.
|
||||||
set(x86_64_SOURCES
|
set(ALL_ORC_ASM_SOURCES
|
||||||
# x86-64 specific assembly files will go here.
|
|
||||||
macho_tlv.x86-64.S
|
macho_tlv.x86-64.S
|
||||||
elfnix_tls.x86-64.S
|
elfnix_tls.x86-64.S
|
||||||
)
|
)
|
||||||
@@ -36,7 +35,7 @@ set(ORC_IMPL_HEADERS
|
|||||||
# consumption by tests.
|
# consumption by tests.
|
||||||
set(ORC_ALL_SOURCE_FILES
|
set(ORC_ALL_SOURCE_FILES
|
||||||
${ORC_SOURCES}
|
${ORC_SOURCES}
|
||||||
${x86_64_SOURCES}
|
${ALL_ORC_ASM_SOURCES}
|
||||||
${ORC_IMPL_HEADERS}
|
${ORC_IMPL_HEADERS}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -66,12 +65,11 @@ if (APPLE)
|
|||||||
add_compiler_rt_object_libraries(RTOrc
|
add_compiler_rt_object_libraries(RTOrc
|
||||||
OS ${ORC_SUPPORTED_OS}
|
OS ${ORC_SUPPORTED_OS}
|
||||||
ARCHS ${ORC_SUPPORTED_ARCH}
|
ARCHS ${ORC_SUPPORTED_ARCH}
|
||||||
SOURCES ${ORC_SOURCES} ${x86_64_SOURCES}
|
SOURCES ${ORC_SOURCES} ${ORC_ASM_SOURCES}
|
||||||
ADDITIONAL_HEADERS ${ORC_IMPL_HEADERS}
|
ADDITIONAL_HEADERS ${ORC_IMPL_HEADERS}
|
||||||
CFLAGS ${ORC_CFLAGS}
|
CFLAGS ${ORC_CFLAGS}
|
||||||
DEPS ${ORC_DEPS})
|
DEPS ${ORC_DEPS})
|
||||||
|
|
||||||
# We only support running on osx for now.
|
|
||||||
add_compiler_rt_runtime(clang_rt.orc
|
add_compiler_rt_runtime(clang_rt.orc
|
||||||
STATIC
|
STATIC
|
||||||
OS ${ORC_SUPPORTED_OS}
|
OS ${ORC_SUPPORTED_OS}
|
||||||
@@ -82,13 +80,16 @@ if (APPLE)
|
|||||||
LINK_LIBS ${ORC_LINK_LIBS}
|
LINK_LIBS ${ORC_LINK_LIBS}
|
||||||
PARENT_TARGET orc)
|
PARENT_TARGET orc)
|
||||||
else() # not Apple
|
else() # not Apple
|
||||||
|
add_asm_sources(ORC_ASM_SOURCES elfnix_tls.x86-64.S)
|
||||||
|
|
||||||
foreach(arch ${ORC_SUPPORTED_ARCH})
|
foreach(arch ${ORC_SUPPORTED_ARCH})
|
||||||
if(NOT CAN_TARGET_${arch})
|
if(NOT CAN_TARGET_${arch})
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compiler_rt_object_libraries(RTOrc
|
add_compiler_rt_object_libraries(RTOrc
|
||||||
ARCHS ${arch}
|
ARCHS ${arch}
|
||||||
SOURCES ${ORC_SOURCES} ${${arch}_SOURCES}
|
SOURCES ${ORC_SOURCES} ${ORC_ASM_SOURCES}
|
||||||
ADDITIONAL_HEADERS ${ORC_IMPL_HEADERS}
|
ADDITIONAL_HEADERS ${ORC_IMPL_HEADERS}
|
||||||
CFLAGS ${ORC_CFLAGS}
|
CFLAGS ${ORC_CFLAGS}
|
||||||
DEPS ${ORC_DEPS})
|
DEPS ${ORC_DEPS})
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// The content of this file is x86_64-only
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
|
||||||
#define REGISTER_SAVE_SPACE_SIZE 512
|
#define REGISTER_SAVE_SPACE_SIZE 512
|
||||||
|
|
||||||
.text
|
.text
|
||||||
@@ -57,3 +60,5 @@ ___orc_rt_elfnix_tls_get_addr:
|
|||||||
addq $REGISTER_SAVE_SPACE_SIZE, %rsp
|
addq $REGISTER_SAVE_SPACE_SIZE, %rsp
|
||||||
popq %rbp
|
popq %rbp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
#endif // defined(__x86_64__)
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// The content of this file is x86_64-only
|
||||||
|
#if defined(__x86_64__)
|
||||||
|
|
||||||
#define REGISTER_SAVE_SPACE_SIZE 512
|
#define REGISTER_SAVE_SPACE_SIZE 512
|
||||||
|
|
||||||
.text
|
.text
|
||||||
@@ -66,3 +69,5 @@ ___orc_rt_macho_tlv_get_addr:
|
|||||||
addq $REGISTER_SAVE_SPACE_SIZE, %rsp
|
addq $REGISTER_SAVE_SPACE_SIZE, %rsp
|
||||||
popq %rbp
|
popq %rbp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
#endif // defined(__x86_64__)
|
||||||
|
|||||||
@@ -396,10 +396,12 @@ public:
|
|||||||
uint64_t Size;
|
uint64_t Size;
|
||||||
if (!SPSArgList<uint64_t>::deserialize(IB, Size))
|
if (!SPSArgList<uint64_t>::deserialize(IB, Size))
|
||||||
return false;
|
return false;
|
||||||
|
if (Size > std::numeric_limits<size_t>::max())
|
||||||
|
return false;
|
||||||
Data = IB.data();
|
Data = IB.data();
|
||||||
if (!IB.skip(Size))
|
if (!IB.skip(Size))
|
||||||
return false;
|
return false;
|
||||||
S = {Data, Size};
|
S = {Data, static_cast<size_t>(Size)};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user