Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions arm-software/linux/atfl-libc++-shared.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This testing configuration handles running the test suite against ATfL's libc++
# using a shared library.

config.substitutions.append(('%{flags}',
'-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
'-fuse-ld=lld -nostdlib++ -L %{lib-dir} -Wl,-rpath,%{lib-dir} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %{temp} -- '
))

import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.params, libcxx.test.config
libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)
29 changes: 29 additions & 0 deletions arm-software/linux/atfl-libc++abi-shared.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This testing configuration handles running the test suite against ATfL's libc++abi
# using a shared library.
# Very similar to libcxx/test/configs/llvm-libc++abi-shared.cfg.in except the use of
# -fuse-ld=lld which is needed to override the system linker in RHEL-8.

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

config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
))
config.substitutions.append(('%{link_flags}',
'-fuse-ld=lld -nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lc++abi -pthread'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %{temp} -- '
))

import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.config
libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)
59 changes: 59 additions & 0 deletions arm-software/linux/atfl-libunwind-shared.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Configuration file for running ATfL's libunwind tests against the shared library.
# Very similar to libcxx/test/configs/llvm-libunwind-shared.cfg.in except the use of
# -fuse-ld=lld which is needed to override the system linker in RHEL-8.
#

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

compile_flags = []
link_flags = []

if @HAVE_GETAUXVAL@:
compile_flags.append('-D_LIBUNWIND_HAVE_GETAUXVAL')

if @HAVE_ELF_AUX_INFO@:
compile_flags.append('-D_LIBUNWIND_HAVE_ELF_AUX_INFO')

if @LIBUNWIND_ENABLE_CET@:
compile_flags.append('-fcf-protection=full')

if @LIBUNWIND_ENABLE_GCS@:
compile_flags.append('-mbranch-protection=standard')

if @HAVE_CFI_SET_RA_STATE@:
compile_flags.append('-DHAVE_CFI_SET_RA_STATE')

# On ELF platforms, link tests with -Wl,--export-dynamic if supported by the linker.
if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'):
link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@')

if '@CMAKE_DL_LIBS@':
link_flags.append('-l@CMAKE_DL_LIBS@')

# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')

local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
config.substitutions.append(('%{flags}',
'-isysroot {}'.format(local_sysroot) if local_sysroot else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{{include}} -I %{{libcxx}}/test/support {}'.format(' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
'-fuse-ld=lld -L %{{lib}} -Wl,-rpath,%{{lib}} -lunwind {}'.format(' '.join(link_flags))
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %{temp} -- '
))

import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.config
libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)
15 changes: 4 additions & 11 deletions arm-software/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ declare -A COMMON_CMAKE_FLAGS=(
["LLVM_TARGETS_TO_BUILD:STRING"]="\"AArch64\""
["LLVM_DEFAULT_TARGET_TRIPLE:STRING"]="\"${ATFL_TARGET_TRIPLE}\""
["ZLIB_LIBRARY_RELEASE:FILEPATH"]="\"${ZLIB_STATIC_PATH}\""
["LIBCXX_TEST_CONFIG:FILEPATH"]="\"${SOURCES_DIR}/arm-software/linux/atfl-libc++-shared.cfg.in\""
["LIBCXXABI_TEST_CONFIG:FILEPATH"]="\"${SOURCES_DIR}/arm-software/linux/atfl-libc++abi-shared.cfg.in\""
["LIBUNWIND_TEST_CONFIG:FILEPATH"]="\"${SOURCES_DIR}/arm-software/linux/atfl-libunwind-shared.cfg.in\""
)

declare -A USE_BOOTSTRAP_CMAKE_FLAGS=(
["CMAKE_C_COMPILER:FILEPATH"]="\"${BUILD_DIR}/bootstrap_compiler/bin/clang\""
["CMAKE_CXX_COMPILER:FILEPATH"]="\"${BUILD_DIR}/bootstrap_compiler/bin/clang++\""
["CMAKE_LINKER_TYPE:STRING"]="LLD"
["CMAKE_INSTALL_PREFIX:PATH"]="\"${ATFL_DIR}\""
["LLVM_ENABLE_LLD:BOOL"]=ON
)
Expand Down Expand Up @@ -355,11 +359,6 @@ print_forced_cmake_flags_cache() {
done
}

bootstrap_compiler_default_config() {
rm -f "${BUILD_DIR}"/bootstrap_compiler/bin/clang.cfg
rm -f "${BUILD_DIR}"/bootstrap_compiler/bin/clang++.cfg
}

bootstrap_compiler_build() {
mkdir -p "${BUILD_DIR}/stage/bootstrap_compiler"
cd "${BUILD_DIR}/stage/bootstrap_compiler"
Expand Down Expand Up @@ -404,14 +403,12 @@ bootstrap_compiler_build() {
run_command cmake --build . "${CMAKE_BUILD_ARGS[@]}" 2>&1 | tee -a "${LOGS_DIR}/bootstrap_compiler.txt"
run_command cmake --install . 2>&1 | tee -a "${LOGS_DIR}/bootstrap_compiler.txt"
export PATH="${BUILD_DIR}/bootstrap_compiler/bin:${PATH}"
bootstrap_compiler_default_config
run_test_command "${LOGS_DIR}/bootstrap_check_all.xml" "${LOGS_DIR}/bootstrap_compiler.txt" check-all
}

libcpp_build() {
mkdir -p "${BUILD_DIR}/stage/libcpp_build"
cd "${BUILD_DIR}/stage/libcpp_build"
bootstrap_compiler_default_config

{ print_forced_cmake_flags_cache "COMMON_CMAKE_FLAGS"
print_forced_cmake_flags_cache "USE_BOOTSTRAP_CMAKE_FLAGS"
Expand Down Expand Up @@ -456,7 +453,6 @@ product_build() {

mkdir -p "${BUILD_DIR}/stage/product_build"
cd "${BUILD_DIR}/stage/product_build"
bootstrap_compiler_default_config

local libs="-L${ATFL_DIR}/lib -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -stdlib=libc++ ${COMMON_LINKER_FLAGS}"
local cmake_caches="${BUILD_DIR}/stage/product_build/cmake_caches"
Expand Down Expand Up @@ -536,14 +532,11 @@ product_build() {
cp "${ATFL_DIR}/bin/${clang_name}" "${ATFL_DIR}/bin/${clang_name}.not_bolted"
cp "${ATFL_DIR}/bin/${flang_name}" "${ATFL_DIR}/bin/${flang_name}.not_bolted"
fi

bootstrap_compiler_default_config
}

static_libomp_build() {
mkdir -p "${BUILD_DIR}/stage/static_libomp_build"
cd "${BUILD_DIR}/stage/static_libomp_build"
bootstrap_compiler_default_config

{ print_forced_cmake_flags_cache "COMMON_CMAKE_FLAGS"
print_forced_cmake_flags_cache "USE_BOOTSTRAP_CMAKE_FLAGS"
Expand Down