brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 96c952d Raw
48 lines · plain
1# This testing configuration handles running the test suite against LLVM's2# libc++ using adb on Android.3 4lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')5 6import re7import site8 9site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))10 11import libcxx.test.android12import libcxx.test.config13import libcxx.test.params14 15config.substitutions.append(('%{flags}',16    '--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else ''17))18 19compile_flags = '-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'20if re.match(r'i686-linux-android(21|22|23)$', config.target_triple):21    # 32-bit x86 Android has a bug where the stack is sometimes misaligned.22    # The problem appears limited to versions before Android N (API 24) and only23    # __attribute__((constructor)) functions. Compile with -mstackrealign to24    # work around the bug.25    # TODO: Consider automatically doing something like this in Clang itself (LIBCXX-ANDROID-FIXME)26    # See https://github.com/android/ndk/issues/693.27    compile_flags += ' -mstackrealign'28config.substitutions.append(('%{compile_flags}', compile_flags))29 30# The platform library is called "libc++.so" and the NDK library is called "libc++_shared.so". 31# Use LD_LIBRARY_PATH to find the libcxx shared object because older Bionic dynamic loaders 32# don't support rpath lookup.33config.substitutions.append(('%{link_flags}',34    '-nostdlib++ -L %{lib-dir} -l@LIBCXX_SHARED_OUTPUT_NAME@'35))36config.substitutions.append(('%{exec}',37    '%{executor}' +38    ' --job-limit-socket ' + libcxx.test.android.adb_job_limit_socket() +39    ' --prepend-path-env LD_LIBRARY_PATH /data/local/tmp/libc++ --execdir %{temp} -- '40))41 42libcxx.test.config.configure(43    libcxx.test.params.DEFAULT_PARAMETERS,44    libcxx.test.features.DEFAULT_FEATURES,45    config,46    lit_config47)48