File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,16 @@ function(_add_host_variant_c_compile_flags target)
291291 target_compile_options (${target} PRIVATE -march=core2)
292292 endif ()
293293 endif ()
294+
295+ # The LLVM backend is built with these defines on most 32-bit platforms,
296+ # llvm/llvm-project@66395c9, which can cause incompatibilities with the Swift
297+ # frontend if not built the same way.
298+ if ("${SWIFT_HOST_VARIANT_ARCH} " MATCHES "armv6|armv7|i686" AND
299+ NOT (SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID AND SWIFT_ANDROID_API_LEVEL LESS 24))
300+ target_compile_definitions (${target} PRIVATE
301+ _LARGEFILE_SOURCE
302+ _FILE_OFFSET_BITS=64)
303+ endif ()
294304endfunction ()
295305
296306function (_add_host_variant_link_flags target )
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ namespace {
556556 if (size > 4096 )
557557 return Type ();
558558
559- SmallVector<TupleTypeElt, 8 > elts{size, elementType};
559+ SmallVector<TupleTypeElt, 8 > elts{static_cast < size_t >( size) , elementType};
560560 return TupleType::get (elts, elementType->getASTContext ());
561561 }
562562
Original file line number Diff line number Diff line change 2929
3030// Android NDK <r21 do not provide `__aeabi_d2h` in the compiler runtime,
3131// provide shims in that case.
32- #if (defined(ANDROID ) && defined(__ARM_ARCH_7A__) && defined(__ARM_EABI__)) || \
32+ #if (defined(__ANDROID__ ) && defined(__ARM_ARCH_7A__) && defined(__ARM_EABI__)) || \
3333 ((defined (__i686__) || defined (__x86_64__)) && !defined (__APPLE__))
3434
3535#include " ../SwiftShims/Visibility.h"
Original file line number Diff line number Diff line change @@ -454,6 +454,10 @@ function set_build_options_for_host() {
454454 SWIFT_HOST_TRIPLE=" aarch64-unknown-linux-android"
455455 llvm_target_arch=" AArch64"
456456 ;;
457+ android-armv7)
458+ SWIFT_HOST_TRIPLE=" armv7-unknown-linux-androideabi"
459+ llvm_target_arch=" ARM"
460+ ;;
457461 linux-armv6)
458462 SWIFT_HOST_TRIPLE=" armv6-unknown-linux-gnueabihf"
459463 llvm_target_arch=" ARM"
You can’t perform that action at this time.
0 commit comments