Skip to content

Commit b67b45a

Browse files
committed
[android] Modify lit replacement of module-target-triple for ARMv7
Android ARMv7 has an LLVM triple of armv7-none-linux-androideabi, but the Swift module triple is just armv7-node-linux-android. The change removes the "eabi" bit for the %module-target-triple substitution of lit to avoid an error in the test test/SourceKit/CursorInfo/cursor_swiftonly_systemmodule.swift. Android AArch64 wasn't affected because the LLVM triple for it is just aarch64-none-linux-android.
1 parent 14a20ee commit b67b45a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/lit.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,12 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
944944
(config.variant_triple, clang_mcp_opt))
945945
config.target_ld = "ld -L%r" % (make_path(test_resource_dir, config.target_sdk_name))
946946
elif run_os == 'linux-androideabi' or run_os == 'linux-android':
947+
# The module triple for Android ARMv7 seems to be canonicalized in LLVM
948+
# to be armv7-none-linux-android, without the "eabi" bit. Let's remove the
949+
# same bit from the substitutions so the tests pass correctly.
950+
target_specific_module_triple = re.sub(r'androideabi', 'android',
951+
target_specific_module_triple)
952+
config.variant_triple = re.sub(r'androideabi', 'android', config.variant_triple)
947953
def get_architecture_value(**kwargs):
948954
result = kwargs[run_cpu]
949955
if result is None:

0 commit comments

Comments
 (0)