| 1 |
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') |
| 2 |
|
| 3 |
libc_linker_script = '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld' |
| 4 |
|
| 5 |
config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) |
| 6 |
|
| 7 |
config.substitutions.append(('%{compile_flags}', |
| 8 |
'-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support' |
| 9 |
|
| 10 |
# Disable warnings in cxx_atomic_impl.h: |
| 11 |
# "large atomic operation may incur significant performance penalty; the |
| 12 |
# access size (4 bytes) exceeds the max lock-free size (0 bytes)" |
| 13 |
' -Wno-atomic-alignment' |
| 14 |
|
| 15 |
# Various libc++ headers check for the definition of _NEWLIB_VERSION |
| 16 |
# which for picolibc is defined in picolibc.h. |
| 17 |
' -include picolibc.h' |
| 18 |
)) |
| 19 |
config.substitutions.append(('%{link_flags}', |
| 20 |
'-nostdlib -nostdlib++ -L %{lib-dir} -lc++ -lc++abi' |
| 21 |
' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + |
| 22 |
' -T {}'.format(libc_linker_script) + |
| 23 |
' -Wl,--defsym=__flash=0x0' |
| 24 |
' -Wl,--defsym=__flash_size=0x400000' |
| 25 |
' -Wl,--defsym=__ram=0x21000000' |
| 26 |
' -Wl,--defsym=__ram_size=0x1000000' |
| 27 |
' -Wl,--defsym=__stack_size=0x1000' |
| 28 |
)) |
| 29 |
|
| 30 |
config.executor = ( |
| 31 |
'@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py' |
| 32 |
' --qemu @QEMU_SYSTEM_ARM@' |
| 33 |
' --machine mps2-an385' |
| 34 |
' --cpu cortex-m3') |
| 35 |
config.substitutions.append(('%{exec}', |
| 36 |
'%{executor}' |
| 37 |
' --execdir %T' |
| 38 |
)) |
| 39 |
|
| 40 |
import os, site |
| 41 |
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) |
| 42 |
import libcxx.test.params, libcxx.test.config |
| 43 |
libcxx.test.config.configure( |
| 44 |
libcxx.test.params.DEFAULT_PARAMETERS, |
| 45 |
libcxx.test.features.DEFAULT_FEATURES, |
| 46 |
config, |
| 47 |
lit_config |
| 48 |
) |