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)
291
291
target_compile_options (${target} PRIVATE -march=core2 )
292
292
endif ()
293
293
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 ()
294
304
endfunction ()
295
305
296
306
function (_add_host_variant_link_flags target )
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ namespace {
556
556
if (size > 4096 )
557
557
return Type ();
558
558
559
- SmallVector<TupleTypeElt, 8 > elts{size, elementType};
559
+ SmallVector<TupleTypeElt, 8 > elts{static_cast < size_t >( size) , elementType};
560
560
return TupleType::get (elts, elementType->getASTContext ());
561
561
}
562
562
Original file line number Diff line number Diff line change 29
29
30
30
// Android NDK <r21 do not provide `__aeabi_d2h` in the compiler runtime,
31
31
// 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__)) || \
33
33
((defined(__i686__) || defined(__x86_64__)) && !defined(__APPLE__))
34
34
35
35
#include " ../SwiftShims/Visibility.h"
Original file line number Diff line number Diff line change @@ -454,6 +454,10 @@ function set_build_options_for_host() {
454
454
SWIFT_HOST_TRIPLE=" aarch64-unknown-linux-android"
455
455
llvm_target_arch=" AArch64"
456
456
;;
457
+ android-armv7)
458
+ SWIFT_HOST_TRIPLE=" armv7-unknown-linux-androideabi"
459
+ llvm_target_arch=" ARM"
460
+ ;;
457
461
linux-armv6)
458
462
SWIFT_HOST_TRIPLE=" armv6-unknown-linux-gnueabihf"
459
463
llvm_target_arch=" ARM"
You can’t perform that action at this time.
0 commit comments