File: llvm-libc%2B%2B-android-ndk.cfg.in

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (47 lines) | stat: -rw-r--r-- 1,801 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This testing configuration handles running the test suite against LLVM's
# libc++ using adb and a libc++_shared.so library on Android.

lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')

import re
import site

site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))

import libcxx.test.android
import libcxx.test.config
import libcxx.test.params

config.substitutions.append(('%{flags}',
    '--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else ''
))

compile_flags = '-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'
if re.match(r'i686-linux-android(21|22|23)$', config.target_triple):
    # 32-bit x86 Android has a bug where the stack is sometimes misaligned.
    # The problem appears limited to versions before Android N (API 24) and only
    # __attribute__((constructor)) functions. Compile with -mstackrealign to
    # work around the bug.
    # TODO: Consider automatically doing something like this in Clang itself (LIBCXX-ANDROID-FIXME)
    # See https://github.com/android/ndk/issues/693.
    compile_flags += ' -mstackrealign'
config.substitutions.append(('%{compile_flags}', compile_flags))

# The NDK library is called "libc++_shared.so". Use LD_LIBRARY_PATH to find
# libc++_shared.so because older Bionic dynamic loaders don't support rpath
# lookup.
config.substitutions.append(('%{link_flags}',
    '-nostdlib++ -L %{lib-dir} -lc++_shared'
))
config.substitutions.append(('%{exec}',
    '%{executor}' +
    ' --job-limit-socket ' + libcxx.test.android.adb_job_limit_socket() +
    ' --prepend-path-env LD_LIBRARY_PATH /data/local/tmp/libc++ --execdir %T -- '
))

libcxx.test.config.configure(
    libcxx.test.params.DEFAULT_PARAMETERS,
    libcxx.test.features.DEFAULT_FEATURES,
    config,
    lit_config
)