From e71ae1842d9a4eef06bc7d66fe16113665191c38 Mon Sep 17 00:00:00 2001 From: nasmnc01 Date: Thu, 18 Jul 2024 11:54:53 +0100 Subject: [PATCH 001/138] Added Omax optimisation cfg file Introduced a configuration file which enables several optimisation flags. Change-Id: Idf6334f828177e7facfb12bbbb6a0159a877ee31 --- CMakeLists.txt | 7 +++++++ Omax.cfg | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Omax.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 83047a53..eeb3fad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,6 +326,13 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) ) endif() +install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/Omax.cfg + DESTINATION bin + COMPONENT llvm-toolchain-omax-cfg +) + add_subdirectory( ${llvmproject_SOURCE_DIR}/llvm llvm ) diff --git a/Omax.cfg b/Omax.cfg new file mode 100644 index 00000000..49b75778 --- /dev/null +++ b/Omax.cfg @@ -0,0 +1,10 @@ +-O3 -ffast-math \ +-mllvm -inline-threshold=500 \ +-mllvm -unroll-threshold=450 \ +-mllvm -unroll-partial-threshold=450 \ +-mllvm -unroll-max-iteration-count-to-analyze=20 \ +-mllvm -lsr-complexity-limit=1073741823 \ +-mllvm -force-attribute=main:norecurse \ +-flto=full \ +-fvirtual-function-elimination \ +-fwhole-program-vtables From 979748eb05d5e935b3cecddbb78ecd06e8e7bb6a Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Mon, 22 Jul 2024 15:56:07 +0100 Subject: [PATCH 002/138] fix llvm large test patch application Applying the 0002-libc-tests-with-picolibc-disable-large-tests.patch llvm-project patch failed because of llvm-project commit 3497500946c9b6a1b2e1452312a24c41ee412b34: "[libc++] Clean up and update deployment target features (#96312)" This patch should make the application succeed again. --- ...002-libc-tests-with-picolibc-disable-large-tests.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch index 4adfc8f7..8b437199 100644 --- a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch +++ b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch @@ -1,4 +1,4 @@ -From dded2dbf8fe8eb9dc306bf26259d4e72893ffd67 Mon Sep 17 00:00:00 2001 +From 80000ddfade0f706ad1ebb488a51132a88cbe61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 15 Nov 2023 12:18:35 +0100 Subject: [libc++] tests with picolibc: disable large tests @@ -41,11 +41,11 @@ index b5f9089308d2..0a83e75ceceb 100644 set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") find_program(QEMU_SYSTEM_ARM qemu-system-arm REQUIRED) diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index 88637b84de01..a3fe75edafea 100644 +index fe5598991b83..65d30a352814 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp -@@ -10,7 +10,7 @@ - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} +@@ -7,7 +7,7 @@ + //===----------------------------------------------------------------------===// // This test is too big for most embedded devices. -// XFAIL: LIBCXX-PICOLIBC-FIXME From 4579e2c6d741c59419ddb07da6db587e6087b68f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 22 Jul 2024 11:25:26 +0100 Subject: [PATCH 003/138] Generalise the 'library overlay install' option. I've renamed it so it doesn't have NEWLIB in the name: now it's just called `LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL`. You configure it to make an overlay package of newlib in particular by also defining `LLVM_TOOLCHAIN_C_LIBRARY=newlib` (which you already had to do anyway, even with the previous option name). The old option name is no longer a cmake cache entry, but it is detected on the command line, and used to set the default for the new option. So existing cmake command lines should still work. I've also removed some of the literal uses of the string 'newlib' in code conditionalised by the option. Now those strings are obtained by expanding `${LLVM_TOOLCHAIN_C_LIBRARY}`. So when we add another libc type in the next commit, they should automatically adapt. --- CMakeLists.txt | 57 ++++++++++++++++++++++++++++++++------------------ docs/newlib.md | 15 ++++++++----- 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eeb3fad8..73cd4246 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,25 @@ set(LLVM_TOOLCHAIN_C_LIBRARY ) set_property(CACHE LLVM_TOOLCHAIN_C_LIBRARY PROPERTY STRINGS picolibc newlib) -option(LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL - "Make cpack build an overlay package that can be unpacked over the main toolchain to install a secondary set of libraries based on newlib.") + +# Previously, the LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL option was +# called LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL. Detect a setting of +# that name, in case it's in an existing CMakeCache.txt or command +# line, and use it to set the default for the more general option +# name. +if(LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) + set(overlay_install_default ON) +else() + set(overlay_install_default OFF) +endif() +option(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL + "Make cpack build an overlay package that can be unpacked over the main toolchain to install a secondary set of libraries based on newlib." + ${overlay_install_default}) +if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) + if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL "picolibc") + message(FATAL_ERROR "LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL is only permitted for C libraries other than the default picolibc") + endif() +endif() set(BUG_REPORT_URL "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/issues" CACHE STRING "") set(LLVM_DISTRIBUTION_COMPONENTS @@ -364,10 +381,10 @@ if(DEFINED LLVM_TOOLCHAIN_VERSION_SUFFIX) endif() # Restrict which LLVM components are installed. -if(LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) +if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) set(CPACK_COMPONENTS_ALL llvm-toolchain-libs - llvm-toolchain-newlib-configs + llvm-toolchain-${LLVM_TOOLCHAIN_C_LIBRARY}-configs llvm-toolchain-third-party-licenses) elseif(LLVM_TOOLCHAIN_CROSS_BUILD_MINGW) set(CPACK_COMPONENTS_ALL ${LLVM_TOOLCHAIN_DISTRIBUTION_COMPONENTS} llvm-toolchain-mingw) @@ -382,7 +399,7 @@ set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) # Exception: the newlib overlay package does not do this, because it has # to be able to unpack over the top of an existing installation on all # platforms, and each platform has a different top-level directory name. -if(LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) +if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY FALSE) else() set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY TRUE) @@ -425,8 +442,8 @@ endif() set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION}) -if(LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) - set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-newlib-overlay-${PACKAGE_VERSION}) +if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) + set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${LLVM_TOOLCHAIN_C_LIBRARY}-overlay-${PACKAGE_VERSION}) else() set(PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}) endif() @@ -550,14 +567,14 @@ set(newlib_specific_runtimes_options -DLIBUNWIND_ENABLE_THREADS=OFF ) -if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib AND - LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) - # If we're building newlib with the intention of installing it as - # an overlay on the main package archive, then all of newlib's - # includes, libraries and multilib.yaml go in a subdirectory of - # lib/clang-runtimes. Configuration files in the bin directory - # will make it easy to reset the sysroot to point at that subdir. - set(library_subdir "/newlib") +if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) + # If we're building a non-default libc with the intention of + # installing it as an overlay on the main package archive, then + # all of its includes, libraries and multilib.yaml go in a + # subdirectory of lib/clang-runtimes. Configuration files in the + # bin directory will make it easy to reset the sysroot to point at + # that subdir. + set(library_subdir "/${LLVM_TOOLCHAIN_C_LIBRARY}") else() set(library_subdir "") endif() @@ -1687,18 +1704,18 @@ if(LLVM_TOOLCHAIN_CROSS_BUILD_MINGW) endif() configure_file(cmake/THIRD-PARTY-LICENSES.txt.in THIRD-PARTY-LICENSES.txt) -if(NOT LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) +if(NOT LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) set(third_party_license_summary_install_dir .) set(third_party_license_files_install_dir third-party-licenses) else() # If we're building an overlay archive, put all the license files - # one level down in third-party-licenses/newlib, so that + # one level down in third-party-licenses/, so that # COPYING.NEWLIB doesn't collide with the file of the same name # from picolibc, and the LLVM license files are also duplicated # (in case the overlay archive is used with a non-matching version # of the main toolchain). - set(third_party_license_summary_install_dir third-party-licenses/newlib) - set(third_party_license_files_install_dir third-party-licenses/newlib) + set(third_party_license_summary_install_dir third-party-licenses/${LLVM_TOOLCHAIN_C_LIBRARY}) + set(third_party_license_files_install_dir third-party-licenses/${LLVM_TOOLCHAIN_C_LIBRARY}) endif() install( @@ -1799,7 +1816,7 @@ if(LLVM_TOOLCHAIN_CROSS_BUILD_MINGW OR WIN32) set(cpack_generator ZIP) set(package_filename_extension ".zip") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" - AND NOT LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL) + AND NOT LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) set(cpack_generator DragNDrop) set(package_filename_extension ".dmg") else() diff --git a/docs/newlib.md b/docs/newlib.md index 95e3f315..a7174f0f 100644 --- a/docs/newlib.md +++ b/docs/newlib.md @@ -36,9 +36,14 @@ $ clang --config=newlib.cfg --target=arm-none-eabi -march=armv7m -T redboot.ld - > **NOTE:** Building `newlib` package is only supported on Linux and macOS. -Add the `-DLLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL=on` CMake option for the -`package-llvm-toolchain` CMake target to generate the `newlib` overlay package. +Configure the toolchain with the CMake setting +`-DLLVM_TOOLCHAIN_C_LIBRARY=newlib` to build a newlib-based version of +the toolchain. -Note that the `-DLLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL=on` option only generates -the `newlib` package, but does not install it as part of the `install` CMake -target. \ No newline at end of file +If you also add `-DLLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL=on` then the +`package-llvm-toolchain` CMake target will generate the `newlib` +overlay package. + +Note that the `-DLLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL=on` option +only generates the `newlib` package, but does not install it as part +of the `install` CMake target. \ No newline at end of file From 3915c4a963a9d97ef0aa02182e715689e753466b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 22 Jul 2024 11:28:19 +0100 Subject: [PATCH 004/138] Add experimental ability to build LLVM libc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is extremely new and barely tested: I've compiled and run a hello-world program, and that is literally all. But that's a start – if you can do that, you can also investigate what else does and doesn't compile or run successfully. So this is enough to allow users to experiment. As documented in the new `docs/llvmlibc.md`, this currently builds C libraries only (not C++), for AArch32 only. I don't know how much effort it will take to fix each of those: I only know that in each case _at least one_ cause of build failure exists, but I don't know how many more are hiding behind that one. You can use the new `-DLLVM_TOOLCHAIN_C_LIBRARY` with or without the option to build an overlay package. If you have both a newlib and an llvm-libc overlay package, then it should be possible to install both alongside each other on top of the same main toolchain. Unlike picolibc and newlib, llvm-libc doesn't come with a crt0.o startup file. Compiled for bare metal (as we're doing here), it also leaves some support functions undefined (e.g. for writing to stdout or stderr), expecting the user to provide them. So I've also added a small source directory containing the missing pieces. That builds two additional libraries, -lcrt0 and -lsemihost. At present, I haven't set up a llvm-libc specific ld script, and there's no code in my new crt0 that copies RW data out of ROM (as there is in picolibc). The only definition required by the crt0 is `__stack`, which you can define via an ld script of your own if you want, or directly on the ld.lld command ilne if you prefer. --- CMakeLists.txt | 241 ++++++++++++++++++++++++++----- README.md | 2 +- cmake/generate_version_txt.cmake | 14 +- docs/llvmlibc.md | 66 +++++++++ llvmlibc-support/CMakeLists.txt | 46 ++++++ llvmlibc-support/crt0.c | 34 +++++ llvmlibc-support/exit.c | 32 ++++ llvmlibc-support/init.c | 39 +++++ llvmlibc-support/platform.h | 34 +++++ llvmlibc-support/semihost.h | 117 +++++++++++++++ llvmlibc-support/stdio_read.c | 33 +++++ llvmlibc-support/stdio_write.c | 32 ++++ llvmlibc.cfg | 1 + 13 files changed, 650 insertions(+), 41 deletions(-) create mode 100644 docs/llvmlibc.md create mode 100644 llvmlibc-support/CMakeLists.txt create mode 100644 llvmlibc-support/crt0.c create mode 100644 llvmlibc-support/exit.c create mode 100644 llvmlibc-support/init.c create mode 100644 llvmlibc-support/platform.h create mode 100644 llvmlibc-support/semihost.h create mode 100644 llvmlibc-support/stdio_read.c create mode 100644 llvmlibc-support/stdio_write.c create mode 100644 llvmlibc.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 73cd4246..dd5c96c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ set(LLVM_TOOLCHAIN_C_LIBRARY "Which C library to use." ) set_property(CACHE LLVM_TOOLCHAIN_C_LIBRARY - PROPERTY STRINGS picolibc newlib) + PROPERTY STRINGS picolibc newlib llvmlibc) # Previously, the LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL option was # called LLVM_TOOLCHAIN_NEWLIB_OVERLAY_INSTALL. Detect a setting of @@ -153,7 +153,7 @@ else() set(overlay_install_default OFF) endif() option(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL - "Make cpack build an overlay package that can be unpacked over the main toolchain to install a secondary set of libraries based on newlib." + "Make cpack build an overlay package that can be unpacked over the main toolchain to install a secondary set of libraries based on newlib or llvm-libc." ${overlay_install_default}) if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL "picolibc") @@ -268,7 +268,9 @@ function(read_repo_version output_variable_prefix repo) set(${output_variable_prefix}_SHALLOW "${shallow}" PARENT_SCOPE) endfunction() read_repo_version(llvmproject llvm-project) -read_repo_version(${LLVM_TOOLCHAIN_C_LIBRARY} ${LLVM_TOOLCHAIN_C_LIBRARY}) +if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? + read_repo_version(${LLVM_TOOLCHAIN_C_LIBRARY} ${LLVM_TOOLCHAIN_C_LIBRARY}) +endif() # The patches are generated from custom branch, with followin command: # git format-patch -k origin/main @@ -319,7 +321,9 @@ FetchContent_Declare(newlib ) FetchContent_MakeAvailable(llvmproject) -FetchContent_MakeAvailable(${LLVM_TOOLCHAIN_C_LIBRARY}) +if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? + FetchContent_MakeAvailable(${LLVM_TOOLCHAIN_C_LIBRARY}) +endif() # We generally want to install to a local directory to see what the # output will look like rather than install into the system, so change @@ -334,6 +338,10 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ) endif() +# Whether to try to build C++ libraries. (We can't currently do this +# for all choices of C library.) +set(CXX_LIBS ON) + if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) install( FILES @@ -350,6 +358,42 @@ install( COMPONENT llvm-toolchain-omax-cfg ) +if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) + install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc.cfg + DESTINATION bin + COMPONENT llvm-toolchain-llvmlibc-configs + ) + + # We aren't yet able to build C++ libraries to go with llvm-libc + set(CXX_LIBS OFF) + + # We need to build libc-hdrgen + ExternalProject_Add( + libc_hdrgen + SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm + DEPENDS ${lib_tool_dependencies} + CMAKE_ARGS + -DLLVM_ENABLE_RUNTIMES=libc + -DLLVM_LIBC_FULL_BUILD=ON + -DCMAKE_BUILD_TYPE=Debug + STEP_TARGETS build install + BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen + INSTALL_COMMAND ${CMAKE_COMMAND} -E true + # Always run the build command so that incremental builds are correct. + BUILD_ALWAYS TRUE + CONFIGURE_HANDLED_BY_BUILD TRUE + ) + ExternalProject_Get_property(libc_hdrgen BINARY_DIR) + set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + + # Add an empty check target, to simplify the logic below that expects to + # find one for every libc type. We have no current setup to run the LLVM + # libc test suite. + add_custom_target(check-llvmlibc) +endif() + add_subdirectory( ${llvmproject_SOURCE_DIR}/llvm llvm ) @@ -396,7 +440,7 @@ set(CPACK_ARCHIVE_COMPONENT_INSTALL TRUE) # Don't create a separate archive for each component. set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) # When extracting the files put them in an ArmCompiler-.../ directory. -# Exception: the newlib overlay package does not do this, because it has +# Exception: the overlay packages do not do this, because they have # to be able to unpack over the top of an existing installation on all # platforms, and each platform has a different top-level directory name. if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) @@ -479,7 +523,7 @@ add_custom_target( -DLLVMEmbeddedToolchainForArm_VERSION=${LLVMEmbeddedToolchainForArm_VERSION} -DLLVMEmbeddedToolchainForArm_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -Dllvmproject_SOURCE_DIR=${llvmproject_SOURCE_DIR} - # only one of picolibc and newlib source dirs is needed, but easiest to + # at most one of picolibc and newlib source dirs is needed, but easiest to # specify both definitions -Dpicolibc_SOURCE_DIR=${picolibc_SOURCE_DIR} -Dnewlib_SOURCE_DIR=${newlib_SOURCE_DIR} @@ -817,6 +861,112 @@ function( ) endfunction() +function( + add_llvmlibc + directory + variant + target_triple + flags + test_executor_params + default_boot_flash_addr + default_boot_flash_size + default_flash_addr + default_flash_size + default_ram_addr + default_ram_size + default_stack_size +) + get_runtimes_flags("${directory}" "${flags}") + + set(runtimes_flags "${runtimes_flags} -Wno-error=atomic-alignment") + + set(common_cmake_args + -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_COMPILER_TARGET=${target_triple} + -DCMAKE_ASM_FLAGS=${runtimes_flags} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_CXX_COMPILER_TARGET=${target_triple} + -DCMAKE_CXX_FLAGS=${runtimes_flags} + -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_C_COMPILER_TARGET=${target_triple} + -DCMAKE_C_FLAGS=${runtimes_flags} + -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} + # Let CMake know we're cross-compiling + -DCMAKE_SYSTEM_NAME=Generic + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY + ) + + ExternalProject_Add( + llvmlibc_${variant} + SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes + PREFIX llvmlibc/${variant} + INSTALL_DIR llvmlibc/${variant}/install + DEPENDS ${lib_tool_dependencies} ${libc_target} libc_hdrgen + CMAKE_ARGS + ${common_cmake_args} + -DLIBC_TARGET_TRIPLE=${target_triple} + -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} + -DLIBC_TARGET_OS=baremetal + -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON + -DLLVM_ENABLE_RUNTIMES=libc + -DLLVM_INCLUDE_TESTS=OFF # I haven't yet got the tests to build + -DLLVM_LIBC_FULL_BUILD=ON + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + # Always run the build command so that incremental builds are correct. + BUILD_ALWAYS TRUE + CONFIGURE_HANDLED_BY_BUILD TRUE + INSTALL_COMMAND ${CMAKE_COMMAND} --install . + # Copy llvm-libc lib directory, moving libraries out of their + # target-specific subdirectory. + COMMAND + ${CMAKE_COMMAND} + -E copy_directory + /lib/${target_triple} + "${LLVM_BINARY_DIR}/${directory}/lib" + # And copy the include directory, which is already arranged right. + COMMAND + ${CMAKE_COMMAND} + -E copy_directory + /include + "${LLVM_BINARY_DIR}/${directory}/include" + ) + + ExternalProject_Add( + llvmlibc-support_${variant} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc-support + PREFIX llvmlibc-support/${variant} + INSTALL_DIR "${LLVM_BINARY_DIR}/${directory}" + DEPENDS ${lib_tool_dependencies} llvmlibc_${variant}-install + CMAKE_ARGS ${common_cmake_args} + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + # Always run the build command so that incremental builds are correct. + BUILD_ALWAYS TRUE + CONFIGURE_HANDLED_BY_BUILD TRUE + ) + + add_dependencies( + llvm-toolchain-runtimes + llvmlibc_${variant} + llvmlibc-support_${variant} + ) +endfunction() + macro( add_libc directory @@ -869,6 +1019,21 @@ macro( "${default_ram_size}" "${default_stack_size}" ) + elseif(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) + add_llvmlibc( + "${directory}" + "${variant}" + "${target_triple}" + "${flags}" + "${test_executor_params}" + "${default_boot_flash_addr}" + "${default_boot_flash_size}" + "${default_flash_addr}" + "${default_flash_size}" + "${default_ram_addr}" + "${default_ram_size}" + "${default_stack_size}" + ) endif() endmacro() @@ -1231,25 +1396,29 @@ function(add_library_variant target_arch) "${VARIANT_COMPILE_FLAGS}" "${lit_test_executor}" "${LLVM_TOOLCHAIN_C_LIBRARY}_${variant}-install" - ) - add_libcxx_libcxxabi_libunwind( - "${directory}" - "${variant}" - "${target_triple}" - "${VARIANT_COMPILE_FLAGS}" - "${lit_test_executor}" - "${LLVM_TOOLCHAIN_C_LIBRARY}_${variant}-install" - "${${LLVM_TOOLCHAIN_C_LIBRARY}_specific_runtimes_options}" - ${VARIANT_ENABLE_EXCEPTIONS} - ${VARIANT_ENABLE_RTTI} - ) + ) + if(CXX_LIBS) + add_libcxx_libcxxabi_libunwind( + "${directory}" + "${variant}" + "${target_triple}" + "${VARIANT_COMPILE_FLAGS}" + "${lit_test_executor}" + "${LLVM_TOOLCHAIN_C_LIBRARY}_${variant}-install" + "${${LLVM_TOOLCHAIN_C_LIBRARY}_specific_runtimes_options}" + ${VARIANT_ENABLE_EXCEPTIONS} + ${VARIANT_ENABLE_RTTI} + ) + endif() if(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8") message("C++ runtime libraries tests disabled for ${variant}") else() add_custom_target(check-llvm-toolchain-runtimes-${variant}) add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) add_compiler_rt_tests("${variant}") - add_libcxx_libcxxabi_libunwind_tests("${variant}") + if(CXX_LIBS) + add_libcxx_libcxxabi_libunwind_tests("${variant}") + endif() endif() endif() @@ -1333,21 +1502,25 @@ set(multilib_yaml_content "") # For most variants, the "flash" memory is placed in address range, where # simulated boards have RAM. This is because code for some tests does not fit # the real flash. -add_library_variants_for_cpu( - aarch64 - COMPILE_FLAGS "-march=armv8-a" - MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "virt" - QEMU_CPU "cortex-a57" - BOOT_FLASH_ADDRESS 0x40000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x40001000 - FLASH_SIZE 0xfff000 - RAM_ADDRESS 0x41000000 - RAM_SIZE 0x1000000 - STACK_SIZE 8K -) +if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) + # llvm-libc doesn't have a bare-metal configuration for AArch64, so we + # leave out the AArch64 library if we're building that libc. + add_library_variants_for_cpu( + aarch64 + COMPILE_FLAGS "-march=armv8-a" + MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "virt" + QEMU_CPU "cortex-a57" + BOOT_FLASH_ADDRESS 0x40000000 + BOOT_FLASH_SIZE 0x1000 + FLASH_ADDRESS 0x40001000 + FLASH_SIZE 0xfff000 + RAM_ADDRESS 0x41000000 + RAM_SIZE 0x1000000 + STACK_SIZE 8K + ) +endif() # For AArch32, clang uses different defaults for FPU selection than GCC, both # when "+fp" or "+fp.dp" are used and when no FPU specifier is provided in # "-march=". Using "-mfpu=" explicitly. diff --git a/README.md b/README.md index 802085fc..0bdb97b8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ bare-metal LLVM based toolchain targeting Arm based on: * libc++abi * libc++ * compiler-rt -* picolibc, or optionally newlib +* picolibc, or optionally newlib or LLVM's libc ## Goal diff --git a/cmake/generate_version_txt.cmake b/cmake/generate_version_txt.cmake index b36460cb..a3f70327 100644 --- a/cmake/generate_version_txt.cmake +++ b/cmake/generate_version_txt.cmake @@ -23,12 +23,14 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY ) -execute_process( - COMMAND git -C ${${LLVM_TOOLCHAIN_C_LIBRARY}_SOURCE_DIR} rev-parse HEAD - OUTPUT_VARIABLE ${LLVM_TOOLCHAIN_C_LIBRARY}_COMMIT - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND_ERROR_IS_FATAL ANY -) +if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? + execute_process( + COMMAND git -C ${${LLVM_TOOLCHAIN_C_LIBRARY}_SOURCE_DIR} rev-parse HEAD + OUTPUT_VARIABLE ${LLVM_TOOLCHAIN_C_LIBRARY}_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY + ) +endif() configure_file( ${CMAKE_CURRENT_LIST_DIR}/VERSION.txt.in diff --git a/docs/llvmlibc.md b/docs/llvmlibc.md new file mode 100644 index 00000000..b9cc6fc8 --- /dev/null +++ b/docs/llvmlibc.md @@ -0,0 +1,66 @@ +# Experimental LLVM libc support + +LLVM Embedded Toolchain for Arm uses +[`picolibc`](https://github.com/picolibc/picolibc) as the standard C +library. For experimental and evaluation purposes, you can instead +choose to use the LLVM project's own C library. + +> **NOTE:** `llvmlibc` support in LLVM Embedded Toolchain for Arm is +> an experimental technology preview, with significant limitations. + +## Building the toolchain with LLVM libc + +> **NOTE:** Building the LLVM libc package is only supported on Linux +> and macOS. + +Configure the toolchain with the CMake setting +`-DLLVM_TOOLCHAIN_C_LIBRARY=llvmlibc` to build a version of the +toolchain based on LLVM libc. + +If you also add `-DLLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL=on` then the +`package-llvm-toolchain` CMake target will generate an overlay package +similar to the [newlib overlay +package](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/blob/main/docs/newlib.md). +If you unpack this over an existing installation of the toolchain, +then you can switch to LLVM libc by adding `--config=llvmlibc.cfg` on +the command line. + +## Using LLVM libc + +To compile a program with this LLVM libc, you must provide the +following command line options, in addition to `--target`, `-march` or +`-mcpu`, and the input and output files: + +* `--config=llvmlibc.cfg` if you are using LLVM libc as an overlay + package (but you do not need this if you have built the whole + toolchain with only LLVM libc) + +* `-lcrt0` to include a library defining the `_start` symbol (or else + provide that symbol yourself) + +* `-lsemihost` to include a library that implements porting functions + in LLVM's libc in terms of the Arm semihosting API (or else provide + an alternative implementation of those functions yourself) + +* `-Wl,--defsym=__stack=0x`_nnnnnn_ to define the starting value of + your stack pointer. Alternatively, use a linker script that defines + the symbol `__stack` in addition to whatever other memory layout you + want. + +For example: + +``` +clang --config=llvmlibc.cfg --target=arm-none-eabi -march=armv7m -o hello hello.c -lsemihost -lcrt0 -Wl,--defsym=__stack=0x200000 +``` + +## Limitations of LLVM libc in LLVM Embedded Toolchain for Arm + +At present, this toolchain only builds LLVM libc for AArch32, not for +AArch64. + +At present, this toolchain does not build any C++ libraries to go with +LLVM libc. + +At the time of writing this (2024-07), LLVM libc is a work in +progress. It is incomplete: not all standard C library functionality +is provided. diff --git a/llvmlibc-support/CMakeLists.txt b/llvmlibc-support/CMakeLists.txt new file mode 100644 index 00000000..0e61b37f --- /dev/null +++ b/llvmlibc-support/CMakeLists.txt @@ -0,0 +1,46 @@ +# +# Copyright (c) 2022, Arm Limited and affiliates. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This directory builds two additional library files to go with llvm-libc: +# +# libcrt0.a contains an implementation of the _start() default entry point, +# which sets up the stack and does any necessary initialization before +# calling main(). +# +# libsemihost.a implements llvm-libc's porting function API such as +# __llvm_libc_stdio_write, in terms of the Arm semihosting system. +# +# To use LLVM libc in a semihosting context, include both of these +# libraries. To use it in a different context, you will need to +# reimplement the same functions that libsemihost.a provides, but +# libcrt0.a might still be useful. + +cmake_minimum_required(VERSION 3.20.0) +project(llvmlibc-support LANGUAGES C ASM) + +add_library(semihost STATIC + init.c + exit.c + stdio_read.c + stdio_write.c +) + +add_library(crt0 STATIC + crt0.c +) + +install(TARGETS semihost crt0) diff --git a/llvmlibc-support/crt0.c b/llvmlibc-support/crt0.c new file mode 100644 index 00000000..b2f11693 --- /dev/null +++ b/llvmlibc-support/crt0.c @@ -0,0 +1,34 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include +#include + +#include "platform.h" + +int main(int, char **); + +__attribute__((used)) static void c_startup(void) { + _platform_init(); + _Exit(main(0, NULL)); +} + +extern long __stack[]; +__attribute__((naked)) void _start(void) { + __asm__("mov sp, %0" : : "r"(__stack)); + __asm__("b c_startup"); +} diff --git a/llvmlibc-support/exit.c b/llvmlibc-support/exit.c new file mode 100644 index 00000000..d784a597 --- /dev/null +++ b/llvmlibc-support/exit.c @@ -0,0 +1,32 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "semihost.h" + +void __llvm_libc_exit(int status) { + +#if defined(__ARM_64BIT_STATE) && __ARM_64BIT_STATE + size_t block[2]; + block[0] = ADP_Stopped_ApplicationExit; + block[1] = code; + semihosting_call(SYS_EXIT, block); +#else + semihosting_call(SYS_EXIT, (const void *)ADP_Stopped_ApplicationExit); +#endif + + __builtin_unreachable(); /* semihosting call doesn't return */ +} diff --git a/llvmlibc-support/init.c b/llvmlibc-support/init.c new file mode 100644 index 00000000..bbe8d3c8 --- /dev/null +++ b/llvmlibc-support/init.c @@ -0,0 +1,39 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include + +#include "platform.h" +#include "semihost.h" + +struct __llvm_libc_stdio_cookie __llvm_libc_stdin_cookie; +struct __llvm_libc_stdio_cookie __llvm_libc_stdout_cookie; +struct __llvm_libc_stdio_cookie __llvm_libc_stderr_cookie; + +static void stdio_open(struct __llvm_libc_stdio_cookie *cookie, int mode) { + size_t args[3]; + args[0] = (size_t) ":tt"; + args[1] = (size_t)mode; + args[2] = (size_t)3; /* name length */ + cookie->handle = semihosting_call(SYS_OPEN, args); +} + +void _platform_init(void) { + stdio_open(&__llvm_libc_stdin_cookie, OPENMODE_R); + stdio_open(&__llvm_libc_stdout_cookie, OPENMODE_W); + stdio_open(&__llvm_libc_stderr_cookie, OPENMODE_W); +} diff --git a/llvmlibc-support/platform.h b/llvmlibc-support/platform.h new file mode 100644 index 00000000..668c3304 --- /dev/null +++ b/llvmlibc-support/platform.h @@ -0,0 +1,34 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// This header file defines the interface between libcrt0.a, which defines +// the program entry point, and libsemihost.a, which implements the +// LLVM-libc porting functions in terms of semihosting. If you replace +// libsemihost.a with something else, this header file shows how to make +// that work with libcrt0.a. + +#ifndef LLVMET_LLVMLIBC_SUPPORT_PLATFORM_H +#define LLVMET_LLVMLIBC_SUPPORT_PLATFORM_H + +// libcrt0.a will call this function after the stack pointer is +// initialized. If any setup specific to the libc porting layer is +// needed, this is where to do it. For example, in semihosting, the +// standard I/O handles must be opened via the SYS_OPEN operation, and +// this function is where libsemihost.a does it. +void _platform_init(void); + +#endif // LLVMET_LLVMLIBC_SUPPORT_PLATFORM_H diff --git a/llvmlibc-support/semihost.h b/llvmlibc-support/semihost.h new file mode 100644 index 00000000..71c80949 --- /dev/null +++ b/llvmlibc-support/semihost.h @@ -0,0 +1,117 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// This header file provides internal definitions for libsemihost.a, +// including an inline function to make a semihosting call, and a lot +// of constant definitions. + +#ifndef LLVMET_LLVMLIBC_SUPPORT_SEMIHOST_H +#define LLVMET_LLVMLIBC_SUPPORT_SEMIHOST_H + +#include + +#if __ARM_64BIT_STATE +# define ARG_REG_0 "x0" +# define ARG_REG_1 "x1" +#else +# define ARG_REG_0 "r0" +# define ARG_REG_1 "r1" +#endif + +#if __ARM_64BIT_STATE // A64 +# define SEMIHOST_INSTRUCTION "hlt #0xf000" +#elif defined(__thumb__) // T32 +# if defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' +# define SEMIHOST_INSTRUCTION "bkpt #0xAB" +# elif defined(HLT_SEMIHOSTING) +# define SEMIHOST_INSTRUCTION ".inst.n 0xbabc" // hlt #60 +# else +# define SEMIHOST_INSTRUCTION "svc 0xab" +# endif +#else // A32 +# if defined(HLT_SEMIHOSTING) +# define SEMIHOST_INSTRUCTION ".inst 0xe10f0070" // hlt #0xf000 +# else +# define SEMIHOST_INSTRUCTION "svc 0x123456" +# endif +#endif + +__attribute__((always_inline)) +static long semihosting_call(long val, const void *ptr) { + register long v __asm__(ARG_REG_0) = val; + register const void *p __asm__(ARG_REG_1) = ptr; + __asm__ __volatile__(SEMIHOST_INSTRUCTION + : "+r"(v), "+r"(p) + : + : "memory", "cc"); + return v; +} + +#define SYS_CLOCK 0x10 +#define SYS_CLOSE 0x02 +#define SYS_ELAPSED 0x30 +#define SYS_ERRNO 0x13 +#define SYS_EXIT 0x18 +#define SYS_EXIT_EXTENDED 0x20 +#define SYS_FLEN 0x0c +#define SYS_GET_CMDLINE 0x15 +#define SYS_HEAPINFO 0x16 +#define SYS_ISERROR 0x08 +#define SYS_ISTTY 0x09 +#define SYS_OPEN 0x01 +#define SYS_READ 0x06 +#define SYS_READC 0x07 +#define SYS_REMOVE 0x0e +#define SYS_RENAME 0x0f +#define SYS_SEEK 0x0a +#define SYS_SYSTEM 0x12 +#define SYS_TICKFREQ 0x31 +#define SYS_TIME 0x11 +#define SYS_TMPNAM 0x0d +#define SYS_WRITE0 0x04 +#define SYS_WRITE 0x05 +#define SYS_WRITEC 0x03 + +#define ADP_Stopped_BranchThroughZero 0x20000 +#define ADP_Stopped_UndefinedInstr 0x20001 +#define ADP_Stopped_SoftwareInterrupt 0x20002 +#define ADP_Stopped_PrefetchAbort 0x20003 +#define ADP_Stopped_DataAbort 0x20004 +#define ADP_Stopped_AddressException 0x20005 +#define ADP_Stopped_IRQ 0x20006 +#define ADP_Stopped_FIQ 0x20007 +#define ADP_Stopped_BreakPoint 0x20020 +#define ADP_Stopped_WatchPoint 0x20021 +#define ADP_Stopped_StepComplete 0x20022 +#define ADP_Stopped_RunTimeErrorUnknown 0x20023 +#define ADP_Stopped_InternalError 0x20024 +#define ADP_Stopped_UserInterruption 0x20025 +#define ADP_Stopped_ApplicationExit 0x20026 +#define ADP_Stopped_StackOverflow 0x20027 +#define ADP_Stopped_DivisionByZero 0x20028 +#define ADP_Stopped_OSSpecific 0x20029 + +/* SYS_OPEN modes must be one of R,W,A, plus an optional B and optional PLUS */ +#define OPENMODE_R 0 +#define OPENMODE_W 4 +#define OPENMODE_A 8 +#define OPENMODE_B 1 +#define OPENMODE_PLUS 2 + +struct __llvm_libc_stdio_cookie { int handle; }; + +#endif // LLVMET_LLVMLIBC_SUPPORT_SEMIHOST_H diff --git a/llvmlibc-support/stdio_read.c b/llvmlibc-support/stdio_read.c new file mode 100644 index 00000000..aa2c00fe --- /dev/null +++ b/llvmlibc-support/stdio_read.c @@ -0,0 +1,33 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include + +#include "semihost.h" + +ssize_t __llvm_libc_stdio_read(struct __llvm_libc_stdio_cookie *cookie, + const char *buf, size_t size) { + size_t args[4]; + args[0] = (size_t)cookie->handle; + args[1] = (size_t)buf; + args[2] = (size_t)size; + args[3] = 0; + ssize_t retval = semihosting_call(SYS_READ, args); + if (retval >= 0) + retval = size - retval; + return retval; +} diff --git a/llvmlibc-support/stdio_write.c b/llvmlibc-support/stdio_write.c new file mode 100644 index 00000000..9b7741fd --- /dev/null +++ b/llvmlibc-support/stdio_write.c @@ -0,0 +1,32 @@ +// +// Copyright (c) 2022, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include + +#include "semihost.h" + +ssize_t __llvm_libc_stdio_write(struct __llvm_libc_stdio_cookie *cookie, + const char *buf, size_t size) { + size_t args[4]; + args[0] = (size_t)cookie->handle; + args[1] = (size_t)buf; + args[2] = (size_t)size; + ssize_t retval = semihosting_call(SYS_WRITE, args); + if (retval >= 0) + retval = size - retval; + return retval; +} diff --git a/llvmlibc.cfg b/llvmlibc.cfg new file mode 100644 index 00000000..14aba3bf --- /dev/null +++ b/llvmlibc.cfg @@ -0,0 +1 @@ +--sysroot /../lib/clang-runtimes/llvmlibc From fc94ee55ce788f53d05dc5625c92c9932d7172f6 Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Tue, 23 Jul 2024 11:46:32 +0100 Subject: [PATCH 005/138] Include Omax.cfg during build packaging (#454) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd5c96c0..55f44d31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,7 +355,7 @@ install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/Omax.cfg DESTINATION bin - COMPONENT llvm-toolchain-omax-cfg + COMPONENT llvm-toolchain-config-files ) if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) From dadf5cdcc673f87aead6ffc70d9d8f5b916491af Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 23 Jul 2024 11:25:13 +0100 Subject: [PATCH 006/138] When building LLVM libc, include its license file. This copies `libc/LICENSE.TXT` from the llvm-project repository into the `third-party-licenses` directory, renamed to `LIBC-LICENSE.TXT` so you can tell it apart from all the other subdirectory licenses. (We were already doing similar renames for libcxx, libunwind, etc.) When you build the toolchain in llvm-libc-only mode, that file shows up along with all the others at the top level of `third-party-licenses`. If you build an overlay package, it ends up in the `third-party-licenses/llvmlibc` subdirectory. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55f44d31..636af983 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1918,6 +1918,11 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) ${newlib_SOURCE_DIR}/COPYING.LIBGLOSS COPYING.LIBGLOSS ) endif() +if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) + list(APPEND third_party_license_files + ${llvmproject_SOURCE_DIR}/libc/LICENSE.TXT LIBC-LICENSE.TXT + ) +endif() while(third_party_license_files) list(POP_FRONT third_party_license_files source_file destination_name) From 9a53fc97bba7788731151f4c61e0c861f7d747eb Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Thu, 25 Jul 2024 17:07:56 +0100 Subject: [PATCH 007/138] Update patch file for libc++ tests with picolibc, to mark sort test as long one (#457) Co-authored-by: Vrukesh V Panse --- ...-picolibc-mark-sort-test-as-long-one.patch | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch index 7d5c66ba..a85424eb 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch @@ -1,21 +1,20 @@ -From ac480df06d78bd7457d2a6333be8578cda88c240 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dominik=20W=C3=B3jt?= -Date: Thu, 9 Nov 2023 14:14:30 +0100 -Subject: [libc++] tests with picolibc: mark sort test as long one +From 7071eeaeafa681f281434d38223618165560efee Mon Sep 17 00:00:00 2001 +From: vrupan01 +Date: Thu, 25 Jul 2024 15:44:04 +0100 +Subject: [PATCH] [libc++] tests with picolibc: mark sort test as long one --- - .../std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + .../test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -index e2581fbf2fa6..99a9e1775513 100644 +index da7794e8c85d..a904b2ee3f78 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -@@ -6,8 +6,7 @@ - // - //===----------------------------------------------------------------------===// +@@ -8,7 +8,7 @@ --// This test appears to hang with picolibc & qemu. + // This test did pass but is very slow when run using qemu. ~7 minutes on a + // Neoverse N1 (AArch64) server core. -// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME +// REQUIRES: long_test From 6695d9b8960459e51e64626925d6fceb048b3037 Mon Sep 17 00:00:00 2001 From: nasmnc01 Date: Thu, 25 Jul 2024 11:56:54 +0100 Subject: [PATCH 008/138] Separate LTO options from Omax.cfg The motivation for this change is that users may wish to disable LTO when using the the Omax.cfg file. Removing the LTO flags to a seperate file allows the user to enable LTO related flags seperately. Change-Id: Id9ed8d8051f7ca4611b640f838715f658790d9cf --- CMakeLists.txt | 1 + Omax.cfg | 3 --- OmaxLTO.cfg | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 OmaxLTO.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 636af983..2bab30e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,6 +354,7 @@ endif() install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/Omax.cfg + ${CMAKE_CURRENT_SOURCE_DIR}/OmaxLTO.cfg DESTINATION bin COMPONENT llvm-toolchain-config-files ) diff --git a/Omax.cfg b/Omax.cfg index 49b75778..7cf623bf 100644 --- a/Omax.cfg +++ b/Omax.cfg @@ -5,6 +5,3 @@ -mllvm -unroll-max-iteration-count-to-analyze=20 \ -mllvm -lsr-complexity-limit=1073741823 \ -mllvm -force-attribute=main:norecurse \ --flto=full \ --fvirtual-function-elimination \ --fwhole-program-vtables diff --git a/OmaxLTO.cfg b/OmaxLTO.cfg new file mode 100644 index 00000000..5c029b91 --- /dev/null +++ b/OmaxLTO.cfg @@ -0,0 +1,3 @@ +-flto=full \ +-fvirtual-function-elimination \ +-fwhole-program-vtables From 3b32a828d5eef80661ed292332845731aa5e6c37 Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Thu, 1 Aug 2024 15:10:56 +0100 Subject: [PATCH 009/138] Remove patch since llvm sort.pass.cpp is already marked as a long test (#458) Co-authored-by: Vrukesh V Panse --- CMakeLists.txt | 5 ++-- ...with-picolibc-XFAIL-uses-of-atomics.patch} | 0 ...-picolibc-mark-sort-test-as-long-one.patch | 25 ------------------- ...-picolibc-mark-two-more-large-tests.patch} | 0 4 files changed, 2 insertions(+), 28 deletions(-) rename patches/llvm-project/{0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch => 0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch} (100%) delete mode 100644 patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch rename patches/llvm-project/{0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch => 0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bab30e8..e3fb1d68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,9 +281,8 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch ) FetchContent_Declare(llvmproject GIT_REPOSITORY https://github.com/llvm/llvm-project.git diff --git a/patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch similarity index 100% rename from patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch rename to patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch deleted file mode 100644 index a85424eb..00000000 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7071eeaeafa681f281434d38223618165560efee Mon Sep 17 00:00:00 2001 -From: vrupan01 -Date: Thu, 25 Jul 2024 15:44:04 +0100 -Subject: [PATCH] [libc++] tests with picolibc: mark sort test as long one - ---- - .../test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -index da7794e8c85d..a904b2ee3f78 100644 ---- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -@@ -8,7 +8,7 @@ - - // This test did pass but is very slow when run using qemu. ~7 minutes on a - // Neoverse N1 (AArch64) server core. --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+// REQUIRES: long_test - - // - --- -2.34.1 - diff --git a/patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch similarity index 100% rename from patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch rename to patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch From fd450a37da3ff1727e12bbee850630ff02a9927b Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Fri, 2 Aug 2024 10:26:52 +0100 Subject: [PATCH 010/138] Update pre-requisite for executing on Windows 10 and Windows 11 (#459) * Update pre-requisite for executing on Windows 10 and Windows 11 * Update pre-requisite for executing on Windows --------- Co-authored-by: Vrukesh V Panse --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0bdb97b8..21a8912b 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ Download a release of the toolchain for your platform from [Github releases](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases) and extract the archive into an arbitrary directory. +### Pre-requisite for using toolchain on Windows + +Install appropriate latest supported Microsoft Visual C++ Redistributable package, such as from [Microsoft Visual C++ Redistributable latest supported downloads](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170). + ### Using the toolchain > *Note:* If you are using the toolchain in a shared environment with untrusted input, From 39523a050620862e779b17cdedc7d3b7f88f7432 Mon Sep 17 00:00:00 2001 From: dcandler <56445371+dcandler@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:46:20 +0100 Subject: [PATCH 011/138] Do not default to linking crt0 when using crt0-semihosting (#460) * Do not default to linking crt0 when using crt0-semihosting This commit adds the -nostartfiles option to tests using semihosting. This is in response to a recent change in clang which modified the driver to include crt0.o in the link: https://github.com/llvm/llvm-project/pull/101258 While the change to clang removes the need to include the crt0 library directly, the tests using semihosting need to link against a different crt0 library. Therefore the new default behavior needs to be suppressed in these cases, which can be done by adding the -nostartfiles option. * Also remove -lcrt0 from make.bat --- CMakeLists.txt | 2 +- README.md | 4 ++++ docs/migrating.md | 4 ++-- packagetest/hello.c | 2 +- packagetest/hello.cpp | 2 +- samples/Makefile.conf | 3 +-- samples/src/baremetal-semihosting-aarch64/make.bat | 2 +- samples/src/baremetal-semihosting/make.bat | 2 +- samples/src/baremetal-uart/Makefile | 2 +- samples/src/baremetal-uart/make.bat | 2 +- samples/src/cpp-baremetal-semihosting-cfi/make.bat | 4 ++-- samples/src/cpp-baremetal-semihosting-prof/make.bat | 2 +- samples/src/cpp-baremetal-semihosting-ubsan/make.bat | 4 ++-- samples/src/cpp-baremetal-semihosting/make.bat | 2 +- test-support/llvm-libc++-picolibc.cfg.in | 2 +- test-support/llvm-libc++abi-picolibc.cfg.in | 2 +- test-support/llvm-libunwind-picolibc.cfg.in | 2 +- 17 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3fb1d68..09c12399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1073,7 +1073,7 @@ Hard-float library with target triple \"${target_triple}\" must end \"-eabihf\"" get_runtimes_flags("${directory}" "${flags}") - set(compiler_rt_test_flags "${runtimes_flags} -fno-exceptions -fno-rtti -lcrt0-semihost -lsemihost -T picolibcpp.ld") + set(compiler_rt_test_flags "${runtimes_flags} -fno-exceptions -fno-rtti -nostartfiles -lcrt0-semihost -lsemihost -T picolibcpp.ld") if(variant STREQUAL "armv6m_soft_nofp") set(compiler_rt_test_flags "${compiler_rt_test_flags} -fomit-frame-pointer") endif() diff --git a/README.md b/README.md index 21a8912b..5ec29fdc 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ To use the toolchain, on the command line you need to provide the following opti * The FPU to use. * Disabling/enabling C++ exceptions and RTTI. * The C runtime library: either `crt0` or `crt0-semihost`. + `crt0` will be linked automatically, but this can be suppressed + with the `-nostartfiles` option so that `crt0-semihost` can be used. * The semihosting library, if using `crt0-semihost`. * A [linker script]( https://sourceware.org/binutils/docs/ld/Scripts.html) specified with `-T`. @@ -102,6 +104,7 @@ $ clang \ -mfpu=none \ -fno-exceptions \ -fno-rtti \ +-nostartfiles \ -lcrt0-semihost \ -lsemihost \ -T picolibc.ld \ @@ -130,6 +133,7 @@ $ clang \ -mfpu=none \ -fno-exceptions \ -fno-rtti \ +-nostartfiles \ -lcrt0-semihost \ -lsemihost \ -T picolibc.ld \ diff --git a/docs/migrating.md b/docs/migrating.md index 5e2ea542..8f1562d5 100644 --- a/docs/migrating.md +++ b/docs/migrating.md @@ -88,8 +88,8 @@ however uses different command line options to control selection of semihosting. |Use case|GNU options|LLVM options| |--------|-----------|------------| -|No semihosting|`--specs=nosys.specs`|`-lcrt0`| -|Semihosting|`--specs=rdimon.specs`|`-lcrt0-semihost -lsemihost`| +|No semihosting|`--specs=nosys.specs`| +|Semihosting|`--specs=rdimon.specs`|`-nostartfiles -lcrt0-semihost -lsemihost`| |Newlib-nano|`--specs=nano.specs`|Not available: `picolibc` is an equivalent of `newlib-nano`. ## Linker diff --git a/packagetest/hello.c b/packagetest/hello.c index b0bb0ee7..f9ee5469 100644 --- a/packagetest/hello.c +++ b/packagetest/hello.c @@ -1,4 +1,4 @@ -// RUN: %clang --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -T %S/Inputs/microbit.ld %s -o %t.out +// RUN: %clang --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -T %S/Inputs/microbit.ld %s -o %t.out // RUN: qemu-system-arm -M microbit -semihosting -nographic -device loader,file=%t.out 2>&1 | FileCheck %s #include diff --git a/packagetest/hello.cpp b/packagetest/hello.cpp index 65b7572e..107c72d0 100644 --- a/packagetest/hello.cpp +++ b/packagetest/hello.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -T %S/Inputs/microbit.ld %s -o %t.out +// RUN: %clangxx --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -T %S/Inputs/microbit.ld %s -o %t.out // RUN: qemu-system-arm -M microbit -semihosting -nographic -device loader,file=%t.out 2>&1 | FileCheck %s // Include as many C++17 headers as possible. diff --git a/samples/Makefile.conf b/samples/Makefile.conf index aa65263b..4ccae915 100644 --- a/samples/Makefile.conf +++ b/samples/Makefile.conf @@ -22,7 +22,6 @@ endif MICROBIT_TARGET=--target=armv6m-none-eabi -march=armv6m -mfpu=none -mfloat-abi=soft AARCH64_TARGET=--target=aarch64-none-elf -CRT=-lcrt0 -CRT_SEMIHOST=-lcrt0-semihost -lsemihost +CRT_SEMIHOST=-nostartfiles -lcrt0-semihost -lsemihost CPP_FLAGS=-fno-exceptions -fno-rtti diff --git a/samples/src/baremetal-semihosting-aarch64/make.bat b/samples/src/baremetal-semihosting-aarch64/make.bat index b1c3a7f7..8264ee3a 100644 --- a/samples/src/baremetal-semihosting-aarch64/make.bat +++ b/samples/src/baremetal-semihosting-aarch64/make.bat @@ -49,6 +49,6 @@ if exist hello.img del /q hello.img @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=aarch64-none-elf -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\raspi3b.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=aarch64-none-elf -nostartfiles -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\raspi3b.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O binary hello.elf hello.img @exit /B diff --git a/samples/src/baremetal-semihosting/make.bat b/samples/src/baremetal-semihosting/make.bat index 826818f1..4b80e42e 100644 --- a/samples/src/baremetal-semihosting/make.bat +++ b/samples/src/baremetal-semihosting/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/baremetal-uart/Makefile b/samples/src/baremetal-uart/Makefile index 589d5bd0..14b51b4b 100644 --- a/samples/src/baremetal-uart/Makefile +++ b/samples/src/baremetal-uart/Makefile @@ -20,7 +20,7 @@ include ../../Makefile.conf build: hello.elf hello.elf: *.c - $(BIN_PATH)/clang $(MICROBIT_TARGET) $(CRT) -g -T ../../ldscripts/microbit.ld -o hello.elf $^ + $(BIN_PATH)/clang $(MICROBIT_TARGET) -g -T ../../ldscripts/microbit.ld -o hello.elf $^ %.hex: %.elf $(BIN_PATH)/llvm-objcopy -O ihex $< $@ diff --git a/samples/src/baremetal-uart/make.bat b/samples/src/baremetal-uart/make.bat index b61dcb71..7b9c3a39 100644 --- a/samples/src/baremetal-uart/make.bat +++ b/samples/src/baremetal-uart/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0 -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c +%BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.c %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-cfi/make.bat b/samples/src/cpp-baremetal-semihosting-cfi/make.bat index b8d1a4ff..66b7ccbd 100644 --- a/samples/src/cpp-baremetal-semihosting-cfi/make.bat +++ b/samples/src/cpp-baremetal-semihosting-cfi/make.bat @@ -57,12 +57,12 @@ if exist hello.hex del /q hello.hex :build_fn %BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -fno-exceptions -fno-rtti -flto -fsanitize=cfi -fvisibility=hidden -fno-sanitize-ignorelist -g -c hello.cpp -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B :build_no_cfi_fn %BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -fno-exceptions -fno-rtti -flto -g -c hello.cpp -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -flto -T ..\..\ldscripts\microbit.ld -g -o hello.elf hello.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-prof/make.bat b/samples/src/cpp-baremetal-semihosting-prof/make.bat index cff03fdf..cffb9baa 100644 --- a/samples/src/cpp-baremetal-semihosting-prof/make.bat +++ b/samples/src/cpp-baremetal-semihosting-prof/make.bat @@ -55,6 +55,6 @@ if exist proflib.o del /q proflib.o :build_fn %BIN_PATH%\clang.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -g -c proflib.c -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -fprofile-instr-generate -fcoverage-mapping -o hello.elf hello.cpp proflib.o +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -fprofile-instr-generate -fcoverage-mapping -o hello.elf hello.cpp proflib.o %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting-ubsan/make.bat b/samples/src/cpp-baremetal-semihosting-ubsan/make.bat index 12007fe3..cf9493d7 100644 --- a/samples/src/cpp-baremetal-semihosting-ubsan/make.bat +++ b/samples/src/cpp-baremetal-semihosting-ubsan/make.bat @@ -55,11 +55,11 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-minimal-runtime -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-minimal-runtime -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B :build_trap_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-trap=all -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti --std=c++17 -fsanitize=undefined -fsanitize-trap=all -g -T ../../ldscripts/microbit.ld -o hello.elf *.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/samples/src/cpp-baremetal-semihosting/make.bat b/samples/src/cpp-baremetal-semihosting/make.bat index 1e5b9b33..f868a3e8 100644 --- a/samples/src/cpp-baremetal-semihosting/make.bat +++ b/samples/src/cpp-baremetal-semihosting/make.bat @@ -49,6 +49,6 @@ if exist hello.hex del /q hello.hex @exit /B 1 :build_fn -%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp %BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex @exit /B diff --git a/test-support/llvm-libc++-picolibc.cfg.in b/test-support/llvm-libc++-picolibc.cfg.in index 2c00fd89..1041aa5f 100644 --- a/test-support/llvm-libc++-picolibc.cfg.in +++ b/test-support/llvm-libc++-picolibc.cfg.in @@ -27,7 +27,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib-dir}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}', diff --git a/test-support/llvm-libc++abi-picolibc.cfg.in b/test-support/llvm-libc++abi-picolibc.cfg.in index bfe0eb2e..96b32064 100644 --- a/test-support/llvm-libc++abi-picolibc.cfg.in +++ b/test-support/llvm-libc++abi-picolibc.cfg.in @@ -19,7 +19,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}', diff --git a/test-support/llvm-libunwind-picolibc.cfg.in b/test-support/llvm-libunwind-picolibc.cfg.in index d0f00a35..948b2143 100644 --- a/test-support/llvm-libunwind-picolibc.cfg.in +++ b/test-support/llvm-libunwind-picolibc.cfg.in @@ -32,7 +32,7 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi -lunwind' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' ' -T %{libc-linker-script}' )) config.substitutions.append(('%{exec}', From 00968d7e125fbfaf32a6a50a43887ddebb125c8f Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Thu, 8 Aug 2024 16:19:47 +0100 Subject: [PATCH 012/138] Update README to reference Omax.cfg and OmaxLTO.cfg (#461) Updating the README.md file to detail usage of Omax.cfg and OmaxLTO.cfg. --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 5ec29fdc..f3e3e4ee 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,28 @@ $ clang \ The FPU selection can be skipped, but it is not recommended to as the defaults are different to GCC ones. + +The builds of the toolchain come packaged with two config files, Omax.cfg and OmaxLTO.cfg. +When used, these config files enable several build optimisation flags to achieve highest performance on typical embedded benchmarks. OmaxLTO.cfg enables link-time optimisation (LTO) specific flags. +These configs can be optionally passed using the `--config` flag. For example: + +``` +$ clang \ +example.c \ +... +--config=Omax.cfg \ +--config=OmaxLTO.cfg \ +-o example +``` + +Users should be warned that Omax.cfg enables `-ffast-math` which breaks IEEE compliance and +enables maths optimisations which can affect code correctness. LTOs are +kept separately in OmaxLTO.cfg as users may not want LTOs due to potential increase in link time +and/or increased memory usage during linking. Some of the options in the config files are undocumented internal LLVM options. For these undocumented options please see the source code of the +corresponding optimisation passes in the [LLVM project](https://github.com/llvm/llvm-project) +to find out more. Users are also encouraged to create their own configs and tune their own +flag parameters. + Binary releases of the LLVM Embedded Toolchain for Arm are based on release branches of the upstream LLVM Project, thus can safely be used with all tools provided by LLVM [releases](https://github.com/llvm/llvm-project/releases) From 0537ed1ffc4d3fdaa7c1dbd8e76da1f200d0d17f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 29 Jul 2024 11:56:51 +0100 Subject: [PATCH 013/138] Fix AArch64 version of __llvm_libc_exit. I made two mistakes in this function: it used size_t without including any header file that defines it, and it was indecisive about whether its argument was called `code` or `status`. But both mistakes only affected the AArch64 branch of the #ifdef, which we weren't using yet, so they didn't cause a compile failure. --- llvmlibc-support/exit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvmlibc-support/exit.c b/llvmlibc-support/exit.c index d784a597..f6c8e810 100644 --- a/llvmlibc-support/exit.c +++ b/llvmlibc-support/exit.c @@ -15,6 +15,8 @@ // limitations under the License. // +#include + #include "semihost.h" void __llvm_libc_exit(int status) { @@ -22,7 +24,7 @@ void __llvm_libc_exit(int status) { #if defined(__ARM_64BIT_STATE) && __ARM_64BIT_STATE size_t block[2]; block[0] = ADP_Stopped_ApplicationExit; - block[1] = code; + block[1] = status; semihosting_call(SYS_EXIT, block); #else semihosting_call(SYS_EXIT, (const void *)ADP_Stopped_ApplicationExit); From 05f75b46c3fa2f7b9c0832c6a4c97dc686bffbd9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 29 Jul 2024 13:31:23 +0100 Subject: [PATCH 014/138] Build llvmlibc variants for AArch64. We couldn't previously build AArch64 llvmlibc, because the build failed due to lack of setjmp/longjmp. But now llvmlibc does have those functions for AArch64, so we can make building AArch64 library variants unconditional again, not dependent on which libc you want. The other missing thing for AArch64 is a configuration file in libc/config/baremetal (it only has configurations for two architectures, and AArch64 isn't one of them). I think the easiest approach is to reuse the AArch32 configuration, so that we build the same set of library functions into all our bare-metal libraries, 32- or 64-bit. --- CMakeLists.txt | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09c12399..9aa2ffb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -911,7 +911,7 @@ function( ${common_cmake_args} -DLIBC_TARGET_TRIPLE=${target_triple} -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} - -DLIBC_TARGET_OS=baremetal + -DLIBC_CONFIG_PATH=${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm # llvmlibc has no AArch64 bare-metal configuration, but the AArch32 one is fine -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES=libc @@ -1502,25 +1502,21 @@ set(multilib_yaml_content "") # For most variants, the "flash" memory is placed in address range, where # simulated boards have RAM. This is because code for some tests does not fit # the real flash. -if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) - # llvm-libc doesn't have a bare-metal configuration for AArch64, so we - # leave out the AArch64 library if we're building that libc. - add_library_variants_for_cpu( - aarch64 - COMPILE_FLAGS "-march=armv8-a" - MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "virt" - QEMU_CPU "cortex-a57" - BOOT_FLASH_ADDRESS 0x40000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x40001000 - FLASH_SIZE 0xfff000 - RAM_ADDRESS 0x41000000 - RAM_SIZE 0x1000000 - STACK_SIZE 8K - ) -endif() +add_library_variants_for_cpu( + aarch64 + COMPILE_FLAGS "-march=armv8-a" + MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "virt" + QEMU_CPU "cortex-a57" + BOOT_FLASH_ADDRESS 0x40000000 + BOOT_FLASH_SIZE 0x1000 + FLASH_ADDRESS 0x40001000 + FLASH_SIZE 0xfff000 + RAM_ADDRESS 0x41000000 + RAM_SIZE 0x1000000 + STACK_SIZE 8K +) # For AArch32, clang uses different defaults for FPU selection than GCC, both # when "+fp" or "+fp.dp" are used and when no FPU specifier is provided in # "-march=". Using "-mfpu=" explicitly. From 07c5178ca0df7dda98ce87c2c33520ad5fb8026c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 13 Aug 2024 10:37:42 +0100 Subject: [PATCH 015/138] llvmlibc: make time_t 64-bit, even on AArch32. llvmlibc used to use a 32-bit time_t unconditionally on AArch32, commented as being for compatibility with glibc. But now it has an option to choose 64-bit instead, if you don't need to conform to glibc's ABI. A bare-metal libc indeed has no need to worry about glibc's time_t ABI (even for so long as it _stays_ 32-bit, which is probably not much longer). So it makes sense for us to use 64-bit time_t from the start, by setting the new config option. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aa2ffb6..bcf399e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -912,6 +912,7 @@ function( -DLIBC_TARGET_TRIPLE=${target_triple} -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} -DLIBC_CONFIG_PATH=${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm # llvmlibc has no AArch64 bare-metal configuration, but the AArch32 one is fine + -DLIBC_CONF_TIME_64BIT=ON -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES=libc From 2ec9ded19d92241f78cf9c1fcb336e58f7953750 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 13 Aug 2024 14:48:35 +0100 Subject: [PATCH 016/138] Update comment about the llvmlibc tests. llvmlibc's own test suite is written in C++, just like the library itself. But unlike the library, the test suite also depends on having a C++ library available: it uses iostreams, fstreams, vectors and so on. So until it's possible to build libc++ on top of a bare-metal version of llvmlibc, I can't see how we'd be able to run the tests. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcf399e2..79dad14e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -916,7 +916,7 @@ function( -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES=libc - -DLLVM_INCLUDE_TESTS=OFF # I haven't yet got the tests to build + -DLLVM_INCLUDE_TESTS=OFF # llvmlibc's tests require C++, so can't be built until llvmlibc can support libc++ -DLLVM_LIBC_FULL_BUILD=ON STEP_TARGETS build install USES_TERMINAL_CONFIGURE FALSE From 223f9ad1777f09d9fd71a146fd311d99afc72ba6 Mon Sep 17 00:00:00 2001 From: simpal01 <55694978+simpal01@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:10:18 +0100 Subject: [PATCH 017/138] Document the behaviour difference between LLD and GNU LD while using --defsym for library selection (#463) * Document the behaviour difference between LLD and GNU LD while using --defsym for library selection * Addressing the comments. 1. Add backquotes 2. Add the reference to https://github.com/picolibc/picolibc/blob/main/doc/printf.md 3. rephrase some words. * Addressing the suggestions about wording/formatting. --- docs/migrating.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/migrating.md b/docs/migrating.md index 8f1562d5..c0f29e53 100644 --- a/docs/migrating.md +++ b/docs/migrating.md @@ -100,6 +100,11 @@ however there are some known differences to take into account, see: in the LLD documentation. * The [LLD and GNU linker incompatibilities](https://maskray.me/blog/2020-12-19-lld-and-gnu-linker-incompatibilities) blog post. +* When selecting the printf/scanf picolibc implementation variant with `--defsym from=to`, see +[Printf and Scanf levels in Picolibc](https://github.com/picolibc/picolibc/blob/main/doc/printf.md#printf-and-scanf-levels-in-picolibc), +LLD includes not only the printf/scanf implementation variant from picolibc specified through `--defsym`, but +also the default PICOLIBC_DOUBLE_PRINTF_SCANF variant. To avoid linking the default variant into the application, you +must include the `--gc-sections` linker flag. ## Startup code From cdc4fc3164cf8ac4c7ff6c4025822b792c7394f8 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Tue, 20 Aug 2024 12:02:54 +0100 Subject: [PATCH 018/138] Set picolibc version to a working revision (#465) Commit hash e434fa1f41a83a888d6498922ab7f140011933d1 was the last one working. Set it as the default revision while recent breakages are not fixed. --- versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions.json b/versions.json index 95b25230..63b13b67 100644 --- a/versions.json +++ b/versions.json @@ -12,8 +12,8 @@ "tag": "main" }, "picolibc": { - "tagType": "branch", - "tag": "main" + "tagType": "commithash", + "tag": "e434fa1f41a83a888d6498922ab7f140011933d1" }, "newlib": { "tagType": "tag", From 9d5a4c359e4f75e51c2ae07585157cd5672352ec Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 20 Aug 2024 14:27:47 +0100 Subject: [PATCH 019/138] [CMakeLists] Correct suggested -DFETCHCONTENT_SOURCE_DIR script A header comment in CMakeLists.txt suggests a sequence of commands for manually checking out the source repos and applying the patches. But it doesn't work, because it includes the command git -C repos/llvm-project am -k ../../patches/llvm-project/*.patch which, under POSIX shell semantics, is handled by first trying to expand the wildcard, then running the git command, which will change directory into `repos/llvm-project` because of the `-C` option. But the command only works if the wildcard is expanded _after_ changing directory, because the `../..` on the front of the pathname is intended to get back out of `repos/llvm-project`. To fix this, I've replaced the relative paths with `$PWD`, which will be expanded before git changes directory, so the pathnames will refer to the root of this repo. (I wondered if the command would have worked as written on Windows, where wildcards are expanded by the application and not the shell. But it doesn't look like it: on Windows, `git am` doesn't seem to expand wildcards at all. So it would be much more painful to rewrite this command sequence in a Windows-compatible way, and in this commit I haven't tried.) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79dad14e..f39498ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,9 @@ # If you prefer you can check out and patch the repos manually and use those: # mkdir repos # git -C repos clone https://github.com/llvm/llvm-project.git -# git -C repos/llvm-project am -k ../../patches/llvm-project/*.patch +# git -C repos/llvm-project am -k $PWD/patches/llvm-project/*.patch # git -C repos clone https://github.com/picolibc/picolibc.git -# git -C repos/picolibc apply ../../patches/picolibc.patch +# git -C repos/picolibc apply $PWD/patches/picolibc.patch # mkdir build # cd build # cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc From d6fec36895bdf9fbcc6468108c7125968f465b3f Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Wed, 28 Aug 2024 13:54:37 +0100 Subject: [PATCH 020/138] Fix path in build from source recipe In the `Building` section of building-from-source.md, twice we are trying to apply a patch with the following command: git -C repos/ am -k "$PWD"/../patches//*.patch This command is executed from the root of the repo. The original thought for this must have been that because of the `-C`, our path at time of execution is `repos/`, and thus we need to move a level up from our current directory. However `$PWD` will be replaced by the shell before the command is executed. So we need to remove the spurious `../`. --- docs/building-from-source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/building-from-source.md b/docs/building-from-source.md index e059810b..98bcf9d3 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -63,9 +63,9 @@ If you check out repos manually then it is your responsibility to ensure that th ``` mkdir repos git -C repos clone https://github.com/llvm/llvm-project.git -git -C repos/llvm-project am -k "$PWD"/../patches/llvm-project/*.patch +git -C repos/llvm-project am -k "$PWD"/patches/llvm-project/*.patch git -C repos clone https://github.com/picolibc/picolibc.git -git -C repos/picolibc apply "$PWD"/../patches/picolibc.patch +git -C repos/picolibc apply "$PWD"/patches/picolibc.patch mkdir build cd build cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc From e63111092f4317a4675150d054091a3507c68af0 Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Thu, 29 Aug 2024 09:34:47 +0100 Subject: [PATCH 021/138] Add Armv8.1-M PACBTI library variants (#467) This adds the folowing library variants with support for the PACBTI-M architecture extension: * armv8.1m.main_soft_nofp_nomve_pacret_bti[_exn_rtti] * armv8.1m.main_hard_fp_nomve_pacret_bti[_exn_rtti] * armv8.1m.main_hard_fpdp_nomve_pacret_bti[_exn_rtti] * armv8.1m.main_hard_nofp_mve_pacret_bti[_exn_rtti] Unfortunately, qemu currently doesn't provide support for PACBTI-M, which means these variants can't be fully tested at runtime level. Since the PACBTI-M instructions are NOP-copatible, we can use an arvm8.1m.main CPU as a workaround to ensure that the library code still works correctly regardless of branch protection. --- CMakeLists.txt | 68 ++++++++++++++++++++++++++++++++++++++++++ cmake/multilib.yaml.in | 5 ++++ 2 files changed, 73 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f39498ed..8aa61bcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1818,6 +1818,74 @@ add_library_variants_for_cpu( RAM_SIZE 0x1000000 STACK_SIZE 4K ) +# FIXME: qemu currently has no support for PACBTI-M, so the branch protection +# variants below can't be fully tested in runtime. Since PACBTI-M instructions +# are NOP-compatible we can use the cortex-m55 CPU for now, but these should be +# updated to use a PACBTI-M enabled CPU once this is available. +add_library_variants_for_cpu( + armv8.1m.main + SUFFIX soft_nofp_nomve_pacret_bti + COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve -mfpu=none -mbranch-protection=standard" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=standard" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "mps3-an547" + QEMU_CPU "cortex-m55" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 512K + FLASH_ADDRESS 0x60000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x61000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) +add_library_variants_for_cpu( + armv8.1m.main + SUFFIX hard_fp_nomve_pacret_bti + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "mps3-an547" + QEMU_CPU "cortex-m55" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 512K + FLASH_ADDRESS 0x60000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x61000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) +add_library_variants_for_cpu( + armv8.1m.main + SUFFIX hard_fpdp_nomve_pacret_bti + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "mps3-an547" + QEMU_CPU "cortex-m55" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 512K + FLASH_ADDRESS 0x60000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x61000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) +add_library_variants_for_cpu( + armv8.1m.main + SUFFIX hard_nofp_mve_pacret_bti + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none -mbranch-protection=standard" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=standard" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "mps3-an547" + QEMU_CPU "cortex-m55" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 512K + FLASH_ADDRESS 0x60000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x61000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) configure_file( diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index 17bf8ab3..435d3911 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -138,3 +138,8 @@ Mappings: - Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+lob(\+[^\+]+)* Flags: - -march=thumbv8.1m.main+lob + +# -mbranch-protection options +- Match: -mbranch-protection=(standard|pac-ret(\+leaf)?\+bti|bti\+pac-ret(\+leaf)?) + Flags: + - -mbranch-protection=pac-ret+bti From 40475d35e1ae8a73f8c5bf806a727666ddbaaefb Mon Sep 17 00:00:00 2001 From: Timur Date: Fri, 30 Aug 2024 14:34:44 +0200 Subject: [PATCH 022/138] Fixed command line example (#471) * Added commands to set CC and CXX variables for current execution environment for example build commands list --------- Co-authored-by: Timur Co-authored-by: timur.khasanshin --- docs/building-from-source.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 98bcf9d3..fb82f723 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -50,6 +50,8 @@ tools to the `LLVM_DISTRIBUTION_COMPONENTS` CMake list. The toolchain can be built directly with CMake. ``` +export CC=clang +export CXX=clang++ mkdir build cd build cmake .. -GNinja -DFETCHCONTENT_QUIET=OFF @@ -61,6 +63,8 @@ If you prefer you can check out and patch the repos manually and use those. If you check out repos manually then it is your responsibility to ensure that the correct revisions are checked out - see `versions.json` to identify these. ``` +export CC=clang +export CXX=clang++ mkdir repos git -C repos clone https://github.com/llvm/llvm-project.git git -C repos/llvm-project am -k "$PWD"/patches/llvm-project/*.patch From 20834fd4f9f7135101301184decb6627c5246157 Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Fri, 30 Aug 2024 13:43:42 +0100 Subject: [PATCH 023/138] Add missing set of disabled tests for PACBTI-M variants (#473) This adds the `fenv` and `math_errhandling` tests to the set of disabled tests for the PACBTI-M library variants, introduced by #467. These tests were already disabled for the previously existing variants, due to a known issue in compiler-rt where the floating point exceptions are not set correctly for computations on types implemented in software. --- test-support/picolibc-test-wrapper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test-support/picolibc-test-wrapper.py b/test-support/picolibc-test-wrapper.py index 9e9e2abb..5596a7e8 100755 --- a/test-support/picolibc-test-wrapper.py +++ b/test-support/picolibc-test-wrapper.py @@ -28,6 +28,12 @@ "picolibc_armv8.1m.main_hard_nofp_mve_exn_rtti-build/test/fenv", "picolibc_armv8.1m.main_hard_nofp_mve_exn_rtti-build/test/math_errhandling", "picolibc_armv8m.main_hard_fp_exn_rtti-build/test/math_errhandling", + "picolibc_armv8.1m.main_hard_nofp_mve_pacret_bti-build/test/fenv", + "picolibc_armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti-build/test/fenv", + "picolibc_armv8.1m.main_hard_fp_nomve_pacret_bti-build/test/math_errhandling", + "picolibc_armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti-build/test/math_errhandling", + "picolibc_armv8.1m.main_hard_nofp_mve_pacret_bti-build/test/math_errhandling", + "picolibc_armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti-build/test/math_errhandling", ] From 7616f8ca73e2e3b418ea3fda6d0d7809520075cf Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 2 Sep 2024 09:22:20 +0100 Subject: [PATCH 024/138] Fix a patch conflict in libc++ tests. One of our xfailed tests has been fixed, and the patch adding the xfail comment was causing a conflict. --- CMakeLists.txt | 2 +- ...th-picolibc-xfail-one-remaining-test.patch | 26 +++++++++++ ...h-picolibc-xfail-two-remaining-tests.patch | 43 ------------------- 3 files changed, 27 insertions(+), 44 deletions(-) create mode 100644 patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch delete mode 100644 patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 8aa61bcd..9515f82a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,7 +278,7 @@ endif() # ed551e0778a35f00ab60f1c80d83ea8274d8d400. set( llvm_project_patches - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch new file mode 100644 index 00000000..3d0a0dc4 --- /dev/null +++ b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch @@ -0,0 +1,26 @@ +From 1db48238bfbc5324dadf828532a4c67524dc471b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dominik=20W=C3=B3jt?= +Date: Mon, 16 Oct 2023 11:35:48 +0200 +Subject: [PATCH] [libc++] tests with picolibc: xfail one remaining test + +--- + .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +index d8eff69cb5..e16048df72 100644 +--- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp ++++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +@@ -17,6 +17,9 @@ + + // test quick_exit and at_quick_exit + ++// TODO: Find out why the at_quick_exit symbol is not found. ++// XFAIL: LIBCXX-PICOLIBC-FIXME ++ + #include + + void f() {} +-- +2.34.1 + diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch deleted file mode 100644 index 3ed11617..00000000 --- a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch +++ /dev/null @@ -1,43 +0,0 @@ -From cb6cfe0e5fc29d3867f523900f0d46a4ef5dff1b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dominik=20W=C3=B3jt?= -Date: Mon, 16 Oct 2023 11:35:48 +0200 -Subject: [libc++] tests with picolibc: xfail two remaining tests - ---- - .../cmp/cmp.alg/strong_order_long_double.verify.cpp | 5 +++++ - .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ - 2 files changed, 8 insertions(+) - -diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp -index c9c2ba200214..4898a9a06e09 100644 ---- a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp -+++ b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp -@@ -12,6 +12,11 @@ - // This test does apply to aarch64 where Arm's AAPCS64 is followed. There they are different sizes. - // XFAIL: target={{arm64|arm64e|armv(7|8)(l|m)?|powerpc|powerpc64}}-{{.+}} - -+// In internal LLVM arm BMT tests the target is fixed to "arm-none-eabi", so the -+// "unsupported" cluase above does not work. TODO: find more generic way to -+// detect equal sizes of double and long double -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // MSVC configurations have long double equal to regular double on all - // architectures. - // XFAIL: target={{.+}}-pc-windows-msvc -diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -index 5a70ea5bd570..92dfbe8eb1ab 100644 ---- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -+++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -@@ -16,6 +16,9 @@ - - // test quick_exit and at_quick_exit - -+// TODO: Find out why the at_quick_exit symbol is not found. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - #include - - void f() {} --- -2.34.1 - From 37260021194fbf53c074ceafde2778c716613bb0 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 2 Sep 2024 13:58:53 +0100 Subject: [PATCH 025/138] Use latest HEAD from picolibc (#478) Now that the limits.h issue [^1] has been resolved in picolibc upstream [^2], we can go back to its latest HEAD. [^1]: Commit hash cdc4fc3164cf8ac4c7ff6c4025822b792c7394f8 [^2]: https://github.com/picolibc/picolibc/pull/810 --- versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions.json b/versions.json index 63b13b67..95b25230 100644 --- a/versions.json +++ b/versions.json @@ -12,8 +12,8 @@ "tag": "main" }, "picolibc": { - "tagType": "commithash", - "tag": "e434fa1f41a83a888d6498922ab7f140011933d1" + "tagType": "branch", + "tag": "main" }, "newlib": { "tagType": "tag", From 29fd17cf82ce40e57f7d4d96a2b36b2048eecffe Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 3 Sep 2024 09:18:51 +0100 Subject: [PATCH 026/138] Add multilib mappings for thumb triples (#479) The instruction set (ARM/Thumb) is included in the triple, but doesn't matter for library selection because the ISA can be switched on any function call. This adds match blocks to multilib.yaml to treat thumb triples as if they were arm triples for library selection. This will also be needed for AArch32 v8-A and v8-R, but we don't have any libraries for them yet. --- cmake/multilib.yaml.in | 18 ++++++++++++++++++ test/multilib/armv7a.test | 6 +++++- test/multilib/armv7r.test | 8 ++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index 435d3911..0813504d 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -107,15 +107,33 @@ Mappings: - Match: --target=thumbv7em-unknown-none-eabihf Flags: - --target=thumbv7m-unknown-none-eabihf + +# v7-A and v7-R include the ISA in the triple, but that doesn't matter for +# library selection, so canonicalise Thumb triples to ARM ones. - Match: --target=thumbv7r-unknown-none-eabi Flags: - --target=armv7r-unknown-none-eabi +- Match: --target=thumbv7r-unknown-none-eabihf + Flags: + - --target=armv7r-unknown-none-eabihf +- Match: --target=thumbv7-unknown-none-eabi + Flags: + - --target=armv7-unknown-none-eabi +- Match: --target=thumbv7-unknown-none-eabihf + Flags: + - --target=armv7-unknown-none-eabihf - Match: --target=thumbv4t-unknown-none-eabi Flags: - --target=armv4t-unknown-none-eabi +- Match: --target=thumbv4t-unknown-none-eabihf + Flags: + - --target=armv4t-unknown-none-eabihf - Match: --target=thumbv5e-unknown-none-eabi Flags: - --target=armv5e-unknown-none-eabi +- Match: --target=thumbv5e-unknown-none-eabihf + Flags: + - --target=armv5e-unknown-none-eabihf # Higher versions of v8-A, and v9-A, are all supersets of v8-A. (And # of each other, in the obvious way, but we don't have any libraries diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index f8e2211b..0a82dfa3 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -1,4 +1,6 @@ -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -marm | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mthumb| FileCheck %s # CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: @@ -11,6 +13,8 @@ # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index ac609ac4..1f7630f6 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -1,7 +1,11 @@ -# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -marm | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -mthumb | FileCheck %s # CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: From b034a7a3d32788f6c15f74f39048db3ecb51a11b Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 3 Sep 2024 10:27:23 +0100 Subject: [PATCH 027/138] Add multilib mappings for armv7ve (#481) This is a GCC name for v7-A with the virtualisation extension, so for library selection we can treat it the same as v7-A. --- cmake/multilib.yaml.in | 9 +++++++++ test/multilib/armv7a.test | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index 0813504d..d7a46b66 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -135,6 +135,15 @@ Mappings: Flags: - --target=armv5e-unknown-none-eabihf +# armv7ve is a GCC name for v7-A with the virtualisation extension, for library +# selection we treat it the same as v7-A. +- Match: --target=(arm|thumb)v7ve-unknown-none-eabi + Flags: + - --target=armv7-unknown-none-eabi +- Match: --target=(arm|thumb)v7ve-unknown-none-eabihf + Flags: + - --target=armv7-unknown-none-eabihf + # Higher versions of v8-A, and v9-A, are all supersets of v8-A. (And # of each other, in the obvious way, but we don't have any libraries # for those at present, so there's no need to generate all their diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index 0a82dfa3..e7857902 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -1,6 +1,9 @@ # RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none | FileCheck %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -marm | FileCheck %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mthumb| FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -marm | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mthumb| FileCheck %s # CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: @@ -15,6 +18,8 @@ # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: From d95a4fae46be622554eea4b34a745818645789e8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 3 Sep 2024 09:20:42 +0100 Subject: [PATCH 028/138] Update a downstream patch for altered context (NFC) This patch failed to apply for me in a manual `git am`, because the upstream addition of `ADDITIONAL_COMPILE_FLAGS` was just close enough to our change to confuse git. Regenerated that hunk. Now it still makes the same change, just without complaining. --- .../0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index a2d86a18..48bf4e88 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -39,7 +39,7 @@ index 000000000000..5ecc58f3e385 +if "has-no-atomics" in config.available_features: + config.unsupported = True diff --git a/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp b/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp -index 47440015f2c5..4350de3dfa65 100644 +index 99d4226662a0..243aa21c87b4 100644 --- a/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.stoptoken/intrusive_shared_ptr.pass.cpp @@ -7,6 +7,8 @@ @@ -49,8 +49,8 @@ index 47440015f2c5..4350de3dfa65 100644 +// XFAIL: has-no-atomics + // UNSUPPORTED: c++03, c++11, c++14, c++17 + // ADDITIONAL_COMPILE_FLAGS: -Wno-private-header - #include <__stop_token/intrusive_shared_ptr.h> diff --git a/libcxx/test/std/atomics/lit.local.cfg b/libcxx/test/std/atomics/lit.local.cfg new file mode 100644 index 000000000000..5ecc58f3e385 From ceabe739c172ce6cd09845e31f0dff5e29392a69 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 3 Sep 2024 14:54:38 +0100 Subject: [PATCH 029/138] Merge v7-M and v7E-M library variants (#482) The only differece between v7-M and v7E-M is the DSP extension, which is not useful for the C/C++ libraries, so we can simplify things by just having v7-M builds. This fills in a gap of (v7-M, fpv4-sp-d16, hard-float), which we did not previously have a valid library for. --- CMakeLists.txt | 34 +++++++-------------------- test-support/picolibc-test-wrapper.py | 4 ++-- test/multilib/armv7em.test | 11 --------- test/multilib/armv7m.test | 27 +++++++++++++++++---- 4 files changed, 34 insertions(+), 42 deletions(-) delete mode 100644 test/multilib/armv7em.test diff --git a/CMakeLists.txt b/CMakeLists.txt index 9515f82a..c3afb701 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1654,25 +1654,9 @@ add_library_variants_for_cpu( ) add_library_variants_for_cpu( armv7m - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv7m -mfpu=none" - MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an385" - QEMU_CPU "cortex-m3" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x21000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x21600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7em SUFFIX hard_fpv4_sp_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7em -mfpu=fpv4-sp-d16" - MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabihf -mfpu=fpv4-sp-d16" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16" + MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16" PICOLIBC_BUILD_TYPE "minsize" QEMU_MACHINE "mps2-an386" QEMU_CPU "cortex-m4" @@ -1685,10 +1669,10 @@ add_library_variants_for_cpu( STACK_SIZE 4K ) add_library_variants_for_cpu( - armv7em + armv7m SUFFIX hard_fpv5_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7em -mfpu=fpv5-d16" - MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabihf -mfpu=fpv5-d16" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv5-d16" + MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16" PICOLIBC_BUILD_TYPE "minsize" QEMU_MACHINE "mps2-an500" QEMU_CPU "cortex-m7" @@ -1705,12 +1689,12 @@ add_library_variants_for_cpu( # no-fpu variant to win, it has to be in multilab.yaml after all other # fpu variants. The order of variants in multilab.yaml depends on the order # of the add_library_variant calls. So the add_library_variant that adds -# the soft_nofp for armv7em is placed after all other armv7em variants. +# the soft_nofp for armv7m is placed after all other armv7m variants. add_library_variants_for_cpu( - armv7em + armv7m SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv7em -mfpu=none" - MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabi -mfpu=none" + COMPILE_FLAGS "-mfloat-abi=soft -march=armv7m -mfpu=none" + MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=none" PICOLIBC_BUILD_TYPE "minsize" QEMU_MACHINE "mps2-an386" QEMU_CPU "cortex-m4" diff --git a/test-support/picolibc-test-wrapper.py b/test-support/picolibc-test-wrapper.py index 5596a7e8..fe5054e5 100755 --- a/test-support/picolibc-test-wrapper.py +++ b/test-support/picolibc-test-wrapper.py @@ -17,10 +17,10 @@ # computations on types implemented in software # https://github.com/picolibc/picolibc/pull/500 "picolibc_armv7m_soft_fpv4_sp_d16-build/test/math_errhandling", - "picolibc_armv7em_hard_fpv4_sp_d16-build/test/math_errhandling", + "picolibc_armv7m_hard_fpv4_sp_d16-build/test/math_errhandling", "picolibc_armv8.1m.main_hard_fp_nomve-build/test/math_errhandling", "picolibc_armv7m_soft_fpv4_sp_d16_exn_rtti-build/test/math_errhandling", - "picolibc_armv7em_hard_fpv4_sp_d16_exn_rtti-build/test/math_errhandling", + "picolibc_armv7m_hard_fpv4_sp_d16_exn_rtti-build/test/math_errhandling", "picolibc_armv8.1m.main_hard_fp_nomve_exn_rtti-build/test/math_errhandling", "picolibc_armv8.1m.main_hard_nofp_mve-build/test/fenv", "picolibc_armv8.1m.main_hard_nofp_mve-build/test/math_errhandling", diff --git a/test/multilib/armv7em.test b/test/multilib/armv7em.test deleted file mode 100644 index acf847e0..00000000 --- a/test/multilib/armv7em.test +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none | FileCheck %s -# CHECK: arm-none-eabi/armv7em_soft_nofp_exn_rtti{{$}} -# CHECK-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s -# FPV4: arm-none-eabi/armv7em_hard_fpv4_sp_d16_exn_rtti{{$}} -# FPV4-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s -# FPV5: arm-none-eabi/armv7em_hard_fpv5_d16_exn_rtti{{$}} -# FPV5-EMPTY: diff --git a/test/multilib/armv7m.test b/test/multilib/armv7m.test index f5e132dc..6d98aaad 100644 --- a/test/multilib/armv7m.test +++ b/test/multilib/armv7m.test @@ -1,9 +1,28 @@ -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s -# CHECK: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}} -# CHECK-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s --check-prefix=NONE +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE +# NONE: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}} +# NONE-EMPTY: # RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s # RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s # SOFT-FPV4: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti{{$}} # SOFT-FPV4-EMPTY: +# +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s +# FPV4: arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti{{$}} +# FPV4-EMPTY: +# +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s +# FPV5: arm-none-eabi/armv7m_hard_fpv5_d16_exn_rtti{{$}} +# FPV5-EMPTY: + +# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m3 | FileCheck %s --check-prefix=NONE +# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m4 | FileCheck %s --check-prefix=SOFT-FPV4 +# %clang -print-multi-directory --target=arm-none-eabihf -mcpu=cortex-m4 | FileCheck %s --check-prefix=FPV4 +# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m7 | FileCheck %s --check-prefix=SOFT-FPV4 +# %clang -print-multi-directory --target=arm-none-eabihf -mcpu=cortex-m7 | FileCheck %s --check-prefix=FPV4 From e80e2529e09de71cdc48d10cc34dda28f58b72c2 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 3 Sep 2024 17:00:26 +0100 Subject: [PATCH 030/138] Statically link libc++abi into libc++ (#483) This will prevent C++ links from breaking when https://github.com/llvm/llvm-project/pull/101259 lands, as that removes -lc++abi and -lunwind from the linker command-line. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3afb701..72e609fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1201,6 +1201,7 @@ function( -DLIBCXXABI_TEST_PARAMS=executor=${test_executor} -DLIBCXX_ABI_UNSTABLE=ON -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON -DLIBCXX_ENABLE_FILESYSTEM=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC=ON From 5e769ca91266143fb9565262440aee09690c409c Mon Sep 17 00:00:00 2001 From: Eleanor Bonnici Date: Wed, 4 Sep 2024 15:36:46 +0100 Subject: [PATCH 031/138] Make aarch64-a variant distinct from aarch64-r (#468) Currently there's only one aarch64-a variant. We would like to add aarch64-r variants in the future and need a way of distinguishing between the different profiles. --- CMakeLists.txt | 6 +++--- test/multilib/aarch64.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72e609fa..438e81eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1282,7 +1282,7 @@ function(add_libcxx_libcxxabi_libunwind_tests variant) endfunction() function(get_compiler_rt_target_triple target_arch flags) - if(target_arch STREQUAL "aarch64") + if(target_arch MATCHES "^aarch64") set(target_triple "aarch64-none-elf") else() # Choose the target triple so that compiler-rt will do the @@ -1353,7 +1353,7 @@ function(add_library_variant target_arch) endif() endif() - if(target_arch STREQUAL "aarch64") + if(target_arch MATCHES "^aarch64") set(parent_dir_name aarch64-none-elf) else() set(parent_dir_name arm-none-eabi) @@ -1505,7 +1505,7 @@ set(multilib_yaml_content "") # simulated boards have RAM. This is because code for some tests does not fit # the real flash. add_library_variants_for_cpu( - aarch64 + aarch64a COMPILE_FLAGS "-march=armv8-a" MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" PICOLIBC_BUILD_TYPE "release" diff --git a/test/multilib/aarch64.test b/test/multilib/aarch64.test index 19f861aa..f062fc2a 100644 --- a/test/multilib/aarch64.test +++ b/test/multilib/aarch64.test @@ -1,3 +1,3 @@ # RUN: %clang -print-multi-directory --target=aarch64-none-elf | FileCheck %s -# CHECK: aarch64-none-elf/aarch64_exn_rtti{{$}} +# CHECK: aarch64-none-elf/aarch64a_exn_rtti{{$}} # CHECK-EMPTY: From 5a8555c450f1b661da01474ee7c49821bab7d631 Mon Sep 17 00:00:00 2001 From: Eleanor Bonnici Date: Wed, 4 Sep 2024 16:38:55 +0100 Subject: [PATCH 032/138] Enable targetting v8-A Aarch-32 (#484) * Enable targetting v8-A Aarch-32 * fixup! Enable targetting v8-A Aarch-32 --- cmake/multilib.yaml.in | 13 +++++++------ test/multilib/armv8a.test | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 test/multilib/armv8a.test diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index d7a46b66..48c48e3d 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -144,13 +144,14 @@ Mappings: Flags: - --target=armv7-unknown-none-eabihf -# Higher versions of v8-A, and v9-A, are all supersets of v8-A. (And -# of each other, in the obvious way, but we don't have any libraries -# for those at present, so there's no need to generate all their -# flags.) -- Match: --target=armv(8\.[1-9]|9|9\.[1-9])a-unknown-none-eabi +# Higher versions of the architecture such as v8-A and v9-A are a superset of +# v7-A. +- Match: --target=(arm|thumb)v(8|8\.[1-9]|9|9\.[1-9])a-unknown-none-eabi Flags: - - --target=armv8a-unknown-none-eabi + - --target=armv7-unknown-none-eabi +- Match: --target=(arm|thumb)v(8|8\.[1-9]|9|9\.[1-9])a-unknown-none-eabihf + Flags: + - --target=armv7-unknown-none-eabihf # -march extensions - Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+fp16(\+[^\+]+)* diff --git a/test/multilib/armv8a.test b/test/multilib/armv8a.test new file mode 100644 index 00000000..d74f7104 --- /dev/null +++ b/test/multilib/armv8a.test @@ -0,0 +1,19 @@ +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -marm | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -mthumb | FileCheck %s +# CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} +# CHECK-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv4-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv4 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=neon-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3-EMPTY: From 6d76d5c9b8ae294409c8e147ea1c3e3281cc2d1d Mon Sep 17 00:00:00 2001 From: simpal01 <55694978+simpal01@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:18:42 +0100 Subject: [PATCH 033/138] Add missing armv7 library variants. (#464) This patch adds the following library variants. 1. armv7r hard_vfpv3xd 2. armv7a soft_vfpv3_d16. Also disable the math_errhandling tests to the set of disabled tests for the armv7r_hard_vfpv3xd library variant.These tests were already disabled for the previously existing variants, due to a known issue in compiler-rt where the floating point exceptions are not set correctly for computations on types implemented in software. Adding tests in test/multilib to make sure that all the newly added library variants get selected correctly. --- CMakeLists.txt | 34 +++++++++++++++++++++++++++ test-support/picolibc-test-wrapper.py | 2 ++ test/multilib/armv7a.test | 14 +++++++++++ test/multilib/armv7r.test | 6 +++++ 4 files changed, 56 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 438e81eb..9eab338c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1603,6 +1603,23 @@ add_library_variants_for_cpu( RAM_SIZE 0x1000000 STACK_SIZE 4K ) +add_library_variants_for_cpu( + armv7a + SUFFIX soft_vfpv3_d16 + COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16" + MULTILIB_FLAGS "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "none" + QEMU_CPU "cortex-a8" + QEMU_PARAMS "-m 1G" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 0x1000 + FLASH_ADDRESS 0x20000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x21000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) add_library_variants_for_cpu( armv7r SUFFIX soft_nofp @@ -1637,6 +1654,23 @@ add_library_variants_for_cpu( RAM_SIZE 0x1000000 STACK_SIZE 4K ) +add_library_variants_for_cpu( + armv7r + SUFFIX hard_vfpv3xd + COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd" + MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "none" + QEMU_CPU "cortex-r5f" + QEMU_PARAMS "-m 1G" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 0x1000 + FLASH_ADDRESS 0x20000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x21000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) add_library_variants_for_cpu( armv7m SUFFIX soft_fpv4_sp_d16 diff --git a/test-support/picolibc-test-wrapper.py b/test-support/picolibc-test-wrapper.py index fe5054e5..eeb9c276 100755 --- a/test-support/picolibc-test-wrapper.py +++ b/test-support/picolibc-test-wrapper.py @@ -18,6 +18,8 @@ # https://github.com/picolibc/picolibc/pull/500 "picolibc_armv7m_soft_fpv4_sp_d16-build/test/math_errhandling", "picolibc_armv7m_hard_fpv4_sp_d16-build/test/math_errhandling", + "picolibc_armv7r_hard_vfpv3xd-build/test/math_errhandling", + "picolibc_armv7r_hard_vfpv3xd_exn_rtti-build/test/math_errhandling", "picolibc_armv8.1m.main_hard_fp_nomve-build/test/math_errhandling", "picolibc_armv7m_soft_fpv4_sp_d16_exn_rtti-build/test/math_errhandling", "picolibc_armv7m_hard_fpv4_sp_d16_exn_rtti-build/test/math_errhandling", diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index e7857902..8e2fa018 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -23,6 +23,20 @@ # VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti{{$}} +# VFPV3-EMPTY: + # We have no valid variant for this configuration, yet. # RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 2>&1 | FileCheck --check-prefix=NOT-FOUND %s diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index 1f7630f6..4fcde20d 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -9,3 +9,9 @@ # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# VFPV3-EMPTY: From 3537c106f4de59a13b6f59e3e3446674147ab8e5 Mon Sep 17 00:00:00 2001 From: simpal01 Date: Thu, 5 Sep 2024 12:07:52 +0100 Subject: [PATCH 034/138] Fixing the multilib tests introduced by #464 (#487) Use a different check prefix for the newly added tests. --- test/multilib/armv7a.test | 28 ++++++++++++++-------------- test/multilib/armv7r.test | 10 +++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index 8e2fa018..3d246b8c 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -23,21 +23,21 @@ # VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti{{$}} -# VFPV3-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# SOFT-VFPV3: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti{{$}} +# SOFT-VFPV3-EMPTY: # We have no valid variant for this configuration, yet. -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 2>&1 | FileCheck --check-prefix=NOT-FOUND %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3xd 2>&1 | FileCheck --check-prefix=NOT-FOUND %s # NOT-FOUND: warning: no multilib found matching flags diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index 4fcde20d..381067c6 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -10,8 +10,8 @@ # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} -# VFPV3-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3XD %s +# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# VFPV3XD-EMPTY: From 26025118efb8cbb3bf132fab218a8a577968c9f7 Mon Sep 17 00:00:00 2001 From: simpal01 Date: Thu, 5 Sep 2024 15:32:56 +0100 Subject: [PATCH 035/138] Reorder the add_library_variant calls for the armv7r_hard_vfpv3_d16 to win (#490) The order in multilib.yaml matches the order of the libraries in CMakeLists.txt. At the moment both the below commandline options selecting the same library variant. ``` $ clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti $ clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti ``` We need to reorder the the add_library_variant calls so that armv7r_hard_vfpv3_d16 gets selected appropriately. --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eab338c..cc5ca37e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1639,9 +1639,9 @@ add_library_variants_for_cpu( ) add_library_variants_for_cpu( armv7r - SUFFIX hard_vfpv3_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" + SUFFIX hard_vfpv3xd + COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd" + MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "none" QEMU_CPU "cortex-r5f" @@ -1656,9 +1656,9 @@ add_library_variants_for_cpu( ) add_library_variants_for_cpu( armv7r - SUFFIX hard_vfpv3xd - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" + SUFFIX hard_vfpv3_d16 + COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16" + MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "none" QEMU_CPU "cortex-r5f" From 591d325cbd2550ab66cca96cd65205ff8c13f7f4 Mon Sep 17 00:00:00 2001 From: simpal01 Date: Fri, 6 Sep 2024 13:26:01 +0100 Subject: [PATCH 036/138] Add missing armv7 library variants (#491) This patch adds the following library variant. 1. armv7r soft_vfpv3_d16. Adding tests in test/multilib to make sure that all the newly added library variants get selected correctly.. --- CMakeLists.txt | 17 +++++++++++++++++ test/multilib/armv7r.test | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc5ca37e..efbae8c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1671,6 +1671,23 @@ add_library_variants_for_cpu( RAM_SIZE 0x1000000 STACK_SIZE 4K ) +add_library_variants_for_cpu( + armv7r + SUFFIX soft_vfpv3_d16 + COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3-d16" + MULTILIB_FLAGS "--target=armv7r-unknown-none-eabi -mfpu=vfpv3-d16" + PICOLIBC_BUILD_TYPE "release" + QEMU_MACHINE "none" + QEMU_CPU "cortex-r5f" + QEMU_PARAMS "-m 1G" + BOOT_FLASH_ADDRESS 0x00000000 + BOOT_FLASH_SIZE 0x1000 + FLASH_ADDRESS 0x20000000 + FLASH_SIZE 0x1000000 + RAM_ADDRESS 0x21000000 + RAM_SIZE 0x1000000 + STACK_SIZE 4K +) add_library_variants_for_cpu( armv7m SUFFIX soft_fpv4_sp_d16 diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index 381067c6..a529b544 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -10,6 +10,12 @@ # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3_d16_exn_rtti{{$}} +# SOFT-VFPV3-EMPTY: + # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3XD %s # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3XD %s # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3XD %s From 97a3038e38b0425709505b99787ab6b57e7ed4bc Mon Sep 17 00:00:00 2001 From: Eleanor Bonnici Date: Mon, 9 Sep 2024 16:09:37 +0100 Subject: [PATCH 037/138] Enable targetting v8-R+ Aarch-32 (#486) --- cmake/multilib.yaml.in | 6 ++++++ test/multilib/armv8r.test | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/multilib/armv8r.test diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index 48c48e3d..f015d97e 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -152,6 +152,12 @@ Mappings: - Match: --target=(arm|thumb)v(8|8\.[1-9]|9|9\.[1-9])a-unknown-none-eabihf Flags: - --target=armv7-unknown-none-eabihf +- Match: --target=(arm|thumb)v(8|8\.[1-9]|9|9\.[1-9])r-unknown-none-eabi + Flags: + - --target=armv7r-unknown-none-eabi +- Match: --target=(arm|thumb)v(8|8\.[1-9]|9|9\.[1-9])r-unknown-none-eabihf + Flags: + - --target=armv7r-unknown-none-eabihf # -march extensions - Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+fp16(\+[^\+]+)* diff --git a/test/multilib/armv8r.test b/test/multilib/armv8r.test new file mode 100644 index 00000000..e9c6a5ba --- /dev/null +++ b/test/multilib/armv8r.test @@ -0,0 +1,19 @@ +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -marm | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -mthumb | FileCheck %s +# CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} +# CHECK-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv4-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv4 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=neon-fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3-EMPTY: From 60b6b1154e5c1870568d940c69a783d31a9875c6 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Thu, 12 Sep 2024 16:12:56 +0100 Subject: [PATCH 038/138] Enable PACBTI in picolibc's startup code (#498) Follow up to [#467](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/pull/467). This patch makes picolibc's startup code enable PAC and BTI in the relevant library variants. picolibc's startup code enables PAC and BTI if and only if __ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI are defined respectively. These macros are defined if `+pacbti` is passed in the `-march` command-line option: it is not enough to use `-mbranch-protection` in the build of the library variant. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efbae8c4..3d0ec47f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1861,7 +1861,7 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX soft_nofp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve -mfpu=none -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=standard" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=standard" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" @@ -1877,7 +1877,7 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_fp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" @@ -1893,7 +1893,7 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_fpdp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" @@ -1909,7 +1909,7 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_nofp_mve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=standard" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=standard" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" From d3263873ae6d82271baebdc23a4d06be85e8dbf7 Mon Sep 17 00:00:00 2001 From: David Candler Date: Thu, 12 Sep 2024 10:16:22 +0100 Subject: [PATCH 039/138] Create a custom config for LLVM libc Since LLVM libc lacks an AArch64 config, LIBC_CONFIG_PATH is set to the arm subdirectory to force it to use the existing AArch32 config. However, this has the side effect of never loading the generic baremetal config.json file, which is instead in the parent directory. In order to combine the entrypoints in the arm config with the values set in the generic baremetal config, this patch copies both to the same location to be used in the build. --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0ec47f..9b90f6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -392,6 +392,19 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) # find one for every libc type. We have no current setup to run the LLVM # libc test suite. add_custom_target(check-llvmlibc) + + # LLVM libc lacks a configuration for AArch64, but the AArch32 one works + # fine. However, setting the configuration for both architectures to the + # arm config directory means the baremetal config.json is never loaded, + # as it resides in the directory above. To ensure both are used, copy + # them to the same location and point libc to that. + set(LIBC_CFG_DIR ${CMAKE_BINARY_DIR}/llvmlibc-config) + file(COPY + ${llvmproject_SOURCE_DIR}/libc/config/baremetal/config.json + ${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm/. + DESTINATION + ${LIBC_CFG_DIR} + ) endif() add_subdirectory( @@ -911,7 +924,7 @@ function( ${common_cmake_args} -DLIBC_TARGET_TRIPLE=${target_triple} -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} - -DLIBC_CONFIG_PATH=${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm # llvmlibc has no AArch64 bare-metal configuration, but the AArch32 one is fine + -DLIBC_CONFIG_PATH=${LIBC_CFG_DIR} -DLIBC_CONF_TIME_64BIT=ON -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON From b51f17c8126a36237917085f7c90a260a921c578 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 12 Sep 2024 16:41:54 +0100 Subject: [PATCH 040/138] Diagnose an unsupported multilib setup: MVE soft-float. We don't build any MVE-capable libraries with the soft-float ABI. We do have Armv7-M soft-float libraries, but you can't fall back to using those, because MVE requires the FPSCR to be set up specially at startup time, and our v7-M soft-float libraries don't do that. So, rather than select one of those libraries and silently generate wrong MVE code, we should force an error report instead. This commit arranges that, by using the new FatalError flag recently added to the multilib.yaml mechanism. We already had a commented-out test for this case, so I've uncommented it and made it expect a compile failure with the custom error message. --- CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ test/multilib/armv8.1m.main.test | 15 +++++++++------ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b90f6fe..e64eb625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1454,6 +1454,26 @@ function(add_library_variant target_arch) set(multilib_yaml_content "${multilib_yaml_content}" PARENT_SCOPE) endfunction() +function(add_nonexistent_library_variant) + set( + one_value_args + MULTILIB_FLAGS + ERROR_MESSAGE + ) + cmake_parse_arguments(ERR "" "${one_value_args}" "" ${ARGN}) + + string(APPEND multilib_yaml_content "- FatalError: \"${ERR_ERROR_MESSAGE}\"\n") + + string(APPEND multilib_yaml_content " Flags:\n") + string(REPLACE " " ";" multilib_flags_list ${ERR_MULTILIB_FLAGS}) + foreach(flag ${multilib_flags_list}) + string(APPEND multilib_yaml_content " - ${flag}\n") + endforeach() + string(APPEND multilib_yaml_content " Group: stdlibs\n") + + set(multilib_yaml_content "${multilib_yaml_content}" PARENT_SCOPE) +endfunction() + function(add_library_variants_for_cpu target_arch) set( one_value_args @@ -1867,6 +1887,17 @@ add_library_variants_for_cpu( RAM_SIZE 0x1000000 STACK_SIZE 4K ) +add_nonexistent_library_variant( + # We don't build any MVE-capable libraries with the soft-float ABI. + # We do have Armv7-M soft-float libraries, but you can't fall back to + # using those, because MVE requires the FPSCR to be set up specially + # at startup time, and our v7-M soft-float libraries don't do that. + # + # So, rather than select one of those libraries and silently generate + # wrong MVE code, we force an error report instead. + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -march=thumbv8.1m.main+mve" + ERROR_MESSAGE "No library available for MVE with soft-float ABI. Try -mfloat-abi=hard." +) # FIXME: qemu currently has no support for PACBTI-M, so the branch protection # variants below can't be fully tested in runtime. Since PACBTI-M instructions # are NOP-compatible we can use the cortex-m55 CPU for now, but these should be diff --git a/test/multilib/armv8.1m.main.test b/test/multilib/armv8.1m.main.test index b49d2380..7f53604a 100644 --- a/test/multilib/armv8.1m.main.test +++ b/test/multilib/armv8.1m.main.test @@ -20,12 +20,15 @@ # MVE: arm-none-eabi/armv8.1m.main_hard_nofp_mve_exn_rtti{{$}} # MVE-EMPTY: -# TODO: We need to find a way to make this fail. For now it fallbacks to -# arm-none-eabi/armv8.1m.main_soft_nofp, which will not initilize the -# coprocessor nor will save/restore its registers in setjmp/longjmp. -# DONT-RUN-YET: %clang -print-multi-directory --target=armv8.1m.main-none-eabi -march=armv8.1m.main+mve -mfpu=none | FileCheck --check-prefix=SOFTFP_MVE %s -# SOFTFP_MVE: ? -# SOFTFP_MVE-EMPTY: +## This combination is not supported at all, because we don't provide any +## MVE libraries with the soft-float ABI, and we can't fall back to Armv7-M +## soft-float libraries because they won't initialize the FPSCR correctly +## for MVE, or save and restore the vector registers in setjmp/longjmp. +## So we expect this to fail, with a custom error message. +# RUN: not %clang -print-multi-directory --target=armv8.1m.main-none-eabi -march=armv8.1m.main+mve -mfpu=none 2>%t | FileCheck --check-prefix=SOFTFP_MVE --allow-empty %s +# RUN: FileCheck --check-prefix=SOFTFP_MVE_ERR %s < %t +# SOFTFP_MVE-NOT: arm-none-eabi +# SOFTFP_MVE_ERR: clang: error: multilib configuration error: No library available for MVE with soft-float ABI. Try -mfloat-abi=hard. # RUN: %clang -print-multi-flags-experimental --target=arm-none-eabihf -mcpu=cortex-m55 | FileCheck --check-prefix=CORTEXM55 %s # CORTEXM55: -march=thumbv8.1m.main+fp16 From aa8112c32da7cfad665c0ef6a5da2a2a0ab97d14 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Fri, 13 Sep 2024 11:58:13 +0100 Subject: [PATCH 041/138] Fix multilib PACBTI mapping (#501) Follow up to [#467](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/pull/467). This patch fixes the multilib mapping for `-mbranch-protection`. Firstly, the multilib flag to be inserted should be `-mbranch-protection=standard` as it is the flag expected by the PACBTI-M multilib variants. Secondly, the PACBTI-M variant should also match to configurations where the branch protection is restricted to only one of PAC or BTI, like in `-mbranch-protection=bti` or `-mbranch-protection=pac-ret`. Before this patch, the variant would only match if both features were requested at the same time. This is safe to do because instructions from either feature have no effect if that feature is disabled at runtime. --- CMakeLists.txt | 16 ++++++++-------- cmake/multilib.yaml.in | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e64eb625..4195733e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1905,8 +1905,8 @@ add_nonexistent_library_variant( add_library_variants_for_cpu( armv8.1m.main SUFFIX soft_nofp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=standard" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" QEMU_CPU "cortex-m55" @@ -1921,8 +1921,8 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_fp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" QEMU_CPU "cortex-m55" @@ -1937,8 +1937,8 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_fpdp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" QEMU_CPU "cortex-m55" @@ -1953,8 +1953,8 @@ add_library_variants_for_cpu( add_library_variants_for_cpu( armv8.1m.main SUFFIX hard_nofp_mve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=standard" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=standard" + COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" + MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "mps3-an547" QEMU_CPU "cortex-m55" diff --git a/cmake/multilib.yaml.in b/cmake/multilib.yaml.in index f015d97e..5e7c38ba 100644 --- a/cmake/multilib.yaml.in +++ b/cmake/multilib.yaml.in @@ -174,6 +174,6 @@ Mappings: - -march=thumbv8.1m.main+lob # -mbranch-protection options -- Match: -mbranch-protection=(standard|pac-ret(\+leaf)?\+bti|bti\+pac-ret(\+leaf)?) +- Match: -mbranch-protection=(standard|pac-ret(\+leaf)?(\+bti)?|bti(\+pac-ret(\+leaf)?)?) Flags: - -mbranch-protection=pac-ret+bti From 5e44f8a9805bcc62e5d976c0ce50a2f293fe181d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 18 Sep 2024 16:59:40 +0100 Subject: [PATCH 042/138] Update README.md and CHANGELOG.md for LLVM-19 release (#505) * Incorporate changes made for LLVM-18 release. * Add additional supported targets to README.md. * Remove experimental from AArch64. * Update CHANGELOG for changes made since LLVM-18. --- CHANGELOG.md | 24 ++++++++++++++++++++++++ README.md | 6 +++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 277507cc..a85d7488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added +- Armv8.1-M PACBTI library variants (#489). + +### Changed +- -nostartfiles required when using crt0-semihosting (#460). + +## [19.0.0] + +### Added +- AArch32 v8-A and v8-R can now be targeted (#484) (#486). +- Experimental support for building llvm-libc overlay package (#452). +- Additional library variants for Armv7 (#464) (#491) (#494). +- Additional multilib mappings for v7ve and Thumb target triples (#479) (#481). +- Omax and OmaxLTO config files (#454). + ### Changed - Use unstable libc++ ABI (#294). +- Merge v7-M and v7E-M library variants (#482). +- AArch64 A profile library made distinct (#468). + +## [18.0.0] + +### Added + +- Documentation for the newlib overlay package (#399). +- Support for C++ exceptions and RTTI added in the standard libraries (#339). ## [17.0.0] diff --git a/README.md b/README.md index f3e3e4ee..fe38ef3c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,11 @@ embedded and realtime operating systems. - Armv4T (experimental) - Armv5TE (experimental) - Armv6 (experimental, using the Armv5TE library variant) -- AArch64 armv8.0 (experimental) +- Armv7-A +- Armv7-R +- AArch32 Armv8-A +- AArch32 Armv8-R +- AArch64 Armv8-A ## C++ support From 7ca4213d2127e6233273cec4c7389622f8165c9d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Thu, 19 Sep 2024 09:07:16 +0100 Subject: [PATCH 043/138] Reference A-profile correctly [NFC]. (#508) Add missing dash between A and profile to make A-profile. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a85d7488..0befa72b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Use unstable libc++ ABI (#294). - Merge v7-M and v7E-M library variants (#482). -- AArch64 A profile library made distinct (#468). +- AArch64 A-profile library made distinct (#468). ## [18.0.0] From 00c3a28ebfdfab4b2361348eebe85ba5e68ea3c1 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 19 Sep 2024 15:15:24 +0200 Subject: [PATCH 044/138] Use FVP models to test v8.1-M libraries with PACBTI (#506) QEMU doesn't currently support the M-profile PACBTI extension, so we need to use FVP models to test those libraries. There are also other targets not supported by QEMU, such as v8-R, which we will need these for. These models are available free of cost (though not open source) from Arm, and the user must agree to a EULA before using them. I've added a script `fvp/get_fvps.sh' to download and extract them into the `fvp' directory. These models are currently only used for the v8.1-M libraries with PACBTI, but the script also downloads the AEMv8A and AEMv8R models for future use. If the FVPs aren't installed, then the CMakeLists.txt will skip any tests which need them. I don't think it's worth preserving the ability to run these tests with QEMU, because we still have the non-PACBTI library variants which are run with QEMU. The two models also have different memory maps and require different scatter files, so if we wanted the ability to run tests for one library on both then we'd need to add a way to build multiple linker scripts. --- .gitignore | 4 + CMakeLists.txt | 123 +++++++++++++++++++------- README.md | 4 + docs/building-from-source.md | 20 +++++ fvp/config/cortex-m85.cfg | 14 +++ fvp/config/m-fp.cfg | 6 ++ fvp/config/m-nofp.cfg | 4 + fvp/config/m-pacbti.cfg | 5 ++ fvp/config/mve-fp.cfg | 4 + fvp/config/mve-int.cfg | 4 + fvp/config/mve-none.cfg | 4 + fvp/config/v8a-aarch32.cfg | 20 +++++ fvp/config/v8a-aarch64.cfg | 20 +++++ fvp/config/v8r-aarch32.cfg | 16 ++++ fvp/config/v8r-aarch64.cfg | 23 +++++ fvp/get_fvps.sh | 81 +++++++++++++++++ test-support/lit-exec-fvp.py | 96 ++++++++++++++++++++ test-support/picolibc-test-wrapper.py | 93 ++++++++++++++----- test-support/run_fvp.py | 80 +++++++++++++++++ 19 files changed, 566 insertions(+), 55 deletions(-) create mode 100644 fvp/config/cortex-m85.cfg create mode 100644 fvp/config/m-fp.cfg create mode 100644 fvp/config/m-nofp.cfg create mode 100644 fvp/config/m-pacbti.cfg create mode 100644 fvp/config/mve-fp.cfg create mode 100644 fvp/config/mve-int.cfg create mode 100644 fvp/config/mve-none.cfg create mode 100644 fvp/config/v8a-aarch32.cfg create mode 100644 fvp/config/v8a-aarch64.cfg create mode 100644 fvp/config/v8r-aarch32.cfg create mode 100644 fvp/config/v8r-aarch64.cfg create mode 100755 fvp/get_fvps.sh create mode 100644 test-support/lit-exec-fvp.py create mode 100755 test-support/run_fvp.py diff --git a/.gitignore b/.gitignore index 3f86a8e9..ffa3e9a3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ __pycache__ # IDEs .vscode compile_commands.json + +# Downloaded FVPs +/fvp/download/ +/fvp/install/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4195733e..bedb3f19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,14 @@ option( the tools every time you update llvm-project." ON ) - +set( + FVP_INSTALL_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/fvp/install" CACHE STRING + "The directory in which the FVP models are installed. These are not + included in this repository, but can be downloaded by the script + fvp/get_fvps.sh" +) +set(FVP_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fvp/config") set(LLVM_TOOLCHAIN_C_LIBRARY "picolibc" CACHE STRING "Which C library to use." @@ -644,7 +651,7 @@ set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_BINARY_DIR}/bin/llvm-lit") add_custom_target(check-newlib) # FIXME: put things in this -function(get_test_executor_params target_triple qemu_machine qemu_cpu qemu_params) +function(get_qemu_params target_triple qemu_machine qemu_cpu qemu_params) if(target_triple MATCHES "^aarch64") set(qemu_command "qemu-system-aarch64") else() @@ -668,6 +675,24 @@ function(get_test_executor_params target_triple qemu_machine qemu_cpu qemu_param set(test_executor_params "${test_executor_params}" PARENT_SCOPE) endfunction() +function(get_fvp_params fvp_model fvp_config) + set( + test_executor_params + --fvp-install-dir ${FVP_INSTALL_DIR} + --fvp-config-dir ${FVP_CONFIG_DIR} + --fvp-model ${fvp_model} + ) + string(REPLACE " " ";" fvp_config_list ${fvp_config}) + foreach(cfg ${fvp_config_list}) + set( + test_executor_params + ${test_executor_params} + --fvp-config ${cfg} + ) + endforeach() + set(test_executor_params "${test_executor_params}" PARENT_SCOPE) +endfunction() + function( add_picolibc directory @@ -1328,9 +1353,12 @@ function(add_library_variant target_arch) COMPILE_FLAGS MULTILIB_FLAGS PICOLIBC_BUILD_TYPE + EXECUTOR QEMU_MACHINE QEMU_CPU QEMU_PARAMS + FVP_MODEL + FVP_CONFIG BOOT_FLASH_ADDRESS BOOT_FLASH_SIZE FLASH_ADDRESS @@ -1376,19 +1404,40 @@ function(add_library_variant target_arch) set(directory "${TARGET_LIBRARIES_DIR}${library_subdir}/${parent_dir_name}/${variant}") set(VARIANT_COMPILE_FLAGS "--target=${target_triple} ${VARIANT_COMPILE_FLAGS}") - get_test_executor_params( - "${target_triple}" - "${VARIANT_QEMU_MACHINE}" - "${VARIANT_QEMU_CPU}" - "${VARIANT_QEMU_PARAMS}" - ) - set( - lit_test_executor - ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-qemu.py - ${test_executor_params} - ) + + if(VARIANT_EXECUTOR STREQUAL "fvp") + if(EXISTS "${FVP_INSTALL_DIR}") + get_fvp_params( + "${VARIANT_FVP_MODEL}" + "${VARIANT_FVP_CONFIG}" + ) + set( + lit_test_executor + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-fvp.py + ${test_executor_params} + ) + set(have_executor TRUE) + else() + set(have_executor FALSE) + endif() + else() + get_qemu_params( + "${target_triple}" + "${VARIANT_QEMU_MACHINE}" + "${VARIANT_QEMU_CPU}" + "${VARIANT_QEMU_PARAMS}" + ) + set( + lit_test_executor + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-qemu.py + ${test_executor_params} + ) + set(have_executor TRUE) + endif() list(JOIN lit_test_executor " " lit_test_executor) - if(NOT PREBUILT_TARGET_LIBRARIES) + if(NOT have_executor) + message("All library tests disabled for ${variant}, due to missing executor") + elseif(NOT PREBUILT_TARGET_LIBRARIES) add_libc( "${directory}" "${variant}" @@ -1481,9 +1530,12 @@ function(add_library_variants_for_cpu target_arch) COMPILE_FLAGS MULTILIB_FLAGS PICOLIBC_BUILD_TYPE + EXECUTOR QEMU_MACHINE QEMU_CPU QEMU_PARAMS + FVP_MODEL + FVP_CONFIG BOOT_FLASH_ADDRESS BOOT_FLASH_SIZE FLASH_ADDRESS @@ -1513,9 +1565,12 @@ function(add_library_variants_for_cpu target_arch) COMPILE_FLAGS "${VARIANT_COMPILE_FLAGS}" MULTILIB_FLAGS "${VARIANT_MULTILIB_FLAGS}" PICOLIBC_BUILD_TYPE "${VARIANT_PICOLIBC_BUILD_TYPE}" + EXECUTOR "${VARIANT_EXECUTOR}" QEMU_MACHINE "${VARIANT_QEMU_MACHINE}" QEMU_CPU "${VARIANT_QEMU_CPU}" QEMU_PARAMS "${VARIANT_QEMU_PARAMS}" + FVP_MODEL "${VARIANT_FVP_MODEL}" + FVP_CONFIG "${VARIANT_FVP_CONFIG}" BOOT_FLASH_ADDRESS "${VARIANT_BOOT_FLASH_ADDRESS}" BOOT_FLASH_SIZE "${VARIANT_BOOT_FLASH_SIZE}" FLASH_ADDRESS "${VARIANT_FLASH_ADDRESS}" @@ -1898,20 +1953,17 @@ add_nonexistent_library_variant( MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -march=thumbv8.1m.main+mve" ERROR_MESSAGE "No library available for MVE with soft-float ABI. Try -mfloat-abi=hard." ) -# FIXME: qemu currently has no support for PACBTI-M, so the branch protection -# variants below can't be fully tested in runtime. Since PACBTI-M instructions -# are NOP-compatible we can use the cortex-m55 CPU for now, but these should be -# updated to use a PACBTI-M enabled CPU once this is available. add_library_variants_for_cpu( armv8.1m.main SUFFIX soft_nofp_nomve_pacret_bti COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K + EXECUTOR fvp + FVP_MODEL corstone-310 + FVP_CONFIG "cortex-m85 m-pacbti m-nofp mve-none" + BOOT_FLASH_ADDRESS 0x01000000 + BOOT_FLASH_SIZE 2M FLASH_ADDRESS 0x60000000 FLASH_SIZE 0x1000000 RAM_ADDRESS 0x61000000 @@ -1924,10 +1976,11 @@ add_library_variants_for_cpu( COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K + EXECUTOR fvp + FVP_MODEL corstone-310 + FVP_CONFIG "cortex-m85 m-pacbti m-fp mve-none" + BOOT_FLASH_ADDRESS 0x01000000 + BOOT_FLASH_SIZE 2M FLASH_ADDRESS 0x60000000 FLASH_SIZE 0x1000000 RAM_ADDRESS 0x61000000 @@ -1940,10 +1993,11 @@ add_library_variants_for_cpu( COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K + EXECUTOR fvp + FVP_MODEL corstone-310 + FVP_CONFIG "cortex-m85 m-pacbti m-fp mve-none" + BOOT_FLASH_ADDRESS 0x01000000 + BOOT_FLASH_SIZE 2M FLASH_ADDRESS 0x60000000 FLASH_SIZE 0x1000000 RAM_ADDRESS 0x61000000 @@ -1956,10 +2010,11 @@ add_library_variants_for_cpu( COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti" PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K + EXECUTOR fvp + FVP_MODEL corstone-310 + FVP_CONFIG "cortex-m85 m-pacbti m-nofp mve-int" + BOOT_FLASH_ADDRESS 0x01000000 + BOOT_FLASH_SIZE 2M FLASH_ADDRESS 0x60000000 FLASH_SIZE 0x1000000 RAM_ADDRESS 0x61000000 diff --git a/README.md b/README.md index fe38ef3c..32e7afc1 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Content of this repository is licensed under Apache-2.0. See The resulting binaries are covered under their respective open source licenses, see component links above. +Testing for some targets uses the freely-available but not open-source Arm FVP +models, which have their own licenses. These are not used by default, see +[Building from source](docs/building-from-source.md) for details. + ## Host platforms LLVM Embedded Toolchain for Arm is built and tested on Ubuntu 18.04 LTS. diff --git a/docs/building-from-source.md b/docs/building-from-source.md index fb82f723..f62fac50 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -36,6 +36,26 @@ $ brew install llvm python3 git make ninja qemu cmake $ pip install meson ``` +Some recent targets are not supported by QEMU, for these the Arm FVP models are +used instead. These models are available free-of-change but are not +open-source, and come with their own licenses. + +These models can be downloaded and installed (into the source tree) with the +`fvp/get_fvps.sh` script. This is currently only available for Linux. By +default, `get_fvps.sh` will run the installers for packages which have them, +which will prompt you to agree to their licenses. Some of the packages do not +have installers, instead they place their license file into the +`fvp/license_terms` directory, which you should read before continuing. + +For non-interactive use (for example in CI systems), `get_fvps.sh` can be run +with the `--non-interactive` option, which causes it to implcitly accept all of +the EULAs. If you have previously downloaded and installed the FVPs outside of +the source tree, you can set the `-DFVP_INSTALL_DIR=...` cmake option to set +the path to them. + +If the FVPs are not installed, tests which need them will be skipped, but QEMU +tests will still be run, and all library variants will still be built. + ## Customizing To build additional library variants, edit the `CMakeLists.txt` by adding diff --git a/fvp/config/cortex-m85.cfg b/fvp/config/cortex-m85.cfg new file mode 100644 index 00000000..6bb13804 --- /dev/null +++ b/fvp/config/cortex-m85.cfg @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable GUI visualisation. +mps3_board.visualisation.disable-visualisation=1 + +# Silence output about telnet ports. +# Yes, the terminals are numbered 0, 1, 2 and 5 +mps3_board.telnetterminal0.quiet=1 +mps3_board.telnetterminal1.quiet=1 +mps3_board.telnetterminal2.quiet=1 +mps3_board.telnetterminal5.quiet=1 + +# Enable semihosting +cpu0.semihosting-enable=1 diff --git a/fvp/config/m-fp.cfg b/fvp/config/m-fp.cfg new file mode 100644 index 00000000..a52f3157 --- /dev/null +++ b/fvp/config/m-fp.cfg @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Enable M-profile scalar FPU. This includes the double-precision extension, I +# don't see a parameter to disable that in the Corstone-310 FVP, probably +# because Cortex-M85 can't be configured with an SP-only FPU. +cpu0.FPU=1 diff --git a/fvp/config/m-nofp.cfg b/fvp/config/m-nofp.cfg new file mode 100644 index 00000000..741af109 --- /dev/null +++ b/fvp/config/m-nofp.cfg @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable M-profile scalar FPU +cpu0.FPU=0 diff --git a/fvp/config/m-pacbti.cfg b/fvp/config/m-pacbti.cfg new file mode 100644 index 00000000..c2e866d2 --- /dev/null +++ b/fvp/config/m-pacbti.cfg @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Enable M-profile PAC and BTI +cpu0.CFGPACBTI=1 +cpu0.ID_ISAR5.PACBTI=1 diff --git a/fvp/config/mve-fp.cfg b/fvp/config/mve-fp.cfg new file mode 100644 index 00000000..08da2dca --- /dev/null +++ b/fvp/config/mve-fp.cfg @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Enable integer and floating-point MVE +cpu0.MVE=2 diff --git a/fvp/config/mve-int.cfg b/fvp/config/mve-int.cfg new file mode 100644 index 00000000..d3f728b7 --- /dev/null +++ b/fvp/config/mve-int.cfg @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Enable integer-only MVE +cpu0.MVE=1 diff --git a/fvp/config/mve-none.cfg b/fvp/config/mve-none.cfg new file mode 100644 index 00000000..ecbcf702 --- /dev/null +++ b/fvp/config/mve-none.cfg @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable MVE +cpu0.MVE=0 diff --git a/fvp/config/v8a-aarch32.cfg b/fvp/config/v8a-aarch32.cfg new file mode 100644 index 00000000..7d2ac0d8 --- /dev/null +++ b/fvp/config/v8a-aarch32.cfg @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable GUI visualisation. +bp.vis.disable_visualisation=1 + +# Silence output about telnet ports. +bp.terminal_0.quiet=1 +bp.terminal_1.quiet=1 +bp.terminal_2.quiet=1 +bp.terminal_3.quiet=1 + +# We only want a single core +cluster0.NUM_CORES=1 +cluster1.NUM_CORES=0 + +# All memory is non-secure, so we can boot straight into main DRAM. +bp.secure_memory=0 + +# Boot in AArch32 mode +cluster0.cpu0.CONFIG64=0 diff --git a/fvp/config/v8a-aarch64.cfg b/fvp/config/v8a-aarch64.cfg new file mode 100644 index 00000000..c5176598 --- /dev/null +++ b/fvp/config/v8a-aarch64.cfg @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable GUI visualisation. +bp.vis.disable_visualisation=1 + +# Silence output about telnet ports. +bp.terminal_0.quiet=1 +bp.terminal_1.quiet=1 +bp.terminal_2.quiet=1 +bp.terminal_3.quiet=1 + +# We only want a single core +cluster0.NUM_CORES=1 +cluster1.NUM_CORES=0 + +# All memory is non-secure, so we can boot straight into main DRAM. +bp.secure_memory=0 + +# Boot in AArch64 mode +cluster0.cpu0.CONFIG64=1 diff --git a/fvp/config/v8r-aarch32.cfg b/fvp/config/v8r-aarch32.cfg new file mode 100644 index 00000000..b51a8747 --- /dev/null +++ b/fvp/config/v8r-aarch32.cfg @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable GUI visualisation. +bp.vis.disable_visualisation=1 + +# Silence output about telnet ports. +bp.terminal_0.quiet=1 +bp.terminal_1.quiet=1 +bp.terminal_2.quiet=1 +bp.terminal_3.quiet=1 + +# We only want a single core +cluster0.NUM_CORES=1 + +# AArch32 mode +cluster0.has_aarch64=0 diff --git a/fvp/config/v8r-aarch64.cfg b/fvp/config/v8r-aarch64.cfg new file mode 100644 index 00000000..4ad59b5b --- /dev/null +++ b/fvp/config/v8r-aarch64.cfg @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# Disable GUI visualisation. +bp.vis.disable_visualisation=1 + +# Silence output about telnet ports. +bp.terminal_0.quiet=1 +bp.terminal_1.quiet=1 +bp.terminal_2.quiet=1 +bp.terminal_3.quiet=1 + +# We only want a single core +cluster0.NUM_CORES=1 + +# AArch64 mode +cluster0.has_aarch64=1 + +# Suppress some warnings caused by defaults not valid for AArch64, these values +# all come from the warning message if you leave them at the default. +cluster0.gicv3.cpuintf-mmap-access-level=2 +cluster0.gicv3.SRE-enable-action-on-mmap=2 +cluster0.gicv3.SRE-EL2-enable-RAO=1 +cluster0.gicv3.extended-interrupt-range-support=1 diff --git a/fvp/get_fvps.sh b/fvp/get_fvps.sh new file mode 100755 index 00000000..27d3ae43 --- /dev/null +++ b/fvp/get_fvps.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +# This script downloads the FVP models which we use for testing the toolchain. +# These are available at no cost, but come with EULAs which must be agreed to +# before running them. When run with --non-interactive, this script assumes +# that you agree to these EULAs. If run without that option, the installers for +# some of the packages will present you with the license before installing. The +# AEMv8A and AEMv8R packages do not have installers, instead they place their +# license into the `fvp/install/license_terms' directory. + +set -euxo pipefail + +args=$(getopt --options "" --longoptions "non-interactive" -- "${@}") || exit +eval "set -- ${args}" + +INSTALLER_FLAGS_CORSTONE="" +INSTALLER_FLAGS_CRYPTO="" + +while true; do + case "${1}" in + (--non-interactive) + INSTALLER_FLAGS_CORSTONE="--i-agree-to-the-contained-eula --no-interactive --force" + INSTALLER_FLAGS_CRYPTO="--i-accept-the-end-user-license-agreement --basepath \"$(dirname \"$0\")\"" + shift 1 + ;; + (--) + shift + break + (*) + exit 1 + ;; + esac +done + +URL_CORSONE_310='https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-310/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz?rev=c370b571bdff42d3a0152471eca3d798&hash=1E388EE3B6E8F675D02D2832DBE61946DEC0386A' +URL_BASE_AEM_A='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz' +URL_BASE_AEM_R='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_AEMv8R_11.26_11_Linux64.tgz' +URL_CRYPTO='https://developer.arm.com/-/cdn-downloads/permalink/Fast-Models-Crypto-Plug-in/FM-11.26/FastModels_crypto_11.26.011_Linux64.tgz' + +cd "$(dirname "$0")" + +mkdir -p download +pushd download +DOWNLOAD_DIR="$(pwd)" +wget --content-disposition --no-clobber "${URL_CORSONE_310}" +wget --content-disposition --no-clobber "${URL_BASE_AEM_A}" +wget --content-disposition --no-clobber "${URL_BASE_AEM_R}" +wget --content-disposition --no-clobber "${URL_CRYPTO}" +popd + +mkdir -p install +pushd install + +if [ ! -d "Corstone-310" ]; then +tar -xf ${DOWNLOAD_DIR}/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz +./FVP_Corstone_SSE-310.sh --destination ./Corstone-310 $INSTALLER_FLAGS_CORSTONE +fi + +if [ ! -d "Base_RevC_AEMvA_pkg" ]; then +tar -xf ${DOWNLOAD_DIR}/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz +# (Extracted directly into ./Base_RevC_AEMvA_pkg/, no installer) +fi + +if [ ! -d "AEMv8R_base_pkg" ]; then +tar -xf ${DOWNLOAD_DIR}/FVP_Base_AEMv8R_11.26_11_Linux64.tgz +# (Extracted directly into ./AEMv8R_base_pkg/, no installer) +fi + +if [ ! -d "FastModelsPortfolio_11.26" ]; then +tar -xf ${DOWNLOAD_DIR}/FastModels_crypto_11.26.011_Linux64.tgz +# SDDKW-93582: Non-interactive installation fails if cwd is different. +pushd FastModels_crypto_11.26.011_Linux64 +# This installer doesn't allow providing a default path for interactive +# installation. +./setup.bin $INSTALLER_FLAGS_CRYPTO +popd +fi + +popd diff --git a/test-support/lit-exec-fvp.py b/test-support/lit-exec-fvp.py new file mode 100644 index 00000000..1481c9ff --- /dev/null +++ b/test-support/lit-exec-fvp.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its affiliates + +# This script is a bridge between lit-based tests of LLVM C++ runtime libraries +# (libc++abi, libunwind, libc++) and FVP models. It must handle the same +# command-line arguments as llvm-project/libcxx/utils/run.py. + +from run_fvp import run_fvp +import argparse +import pathlib +import sys + + +def main(): + parser = argparse.ArgumentParser( + description="Run a single test using Arm FVPs" + ) + parser.add_argument( + "--fvp-install-dir", + help="Directory in which FVP models are installed", + required=True, + ) + parser.add_argument( + "--fvp-config-dir", + help="Directory containing FVP config files", + required=True, + ) + main_arg_group.add_argument( + "--fvp-model", + help="model name for FVP", + required=True, + ) + parser.add_argument( + "--fvp-config", + action="append", + help="FVP config file(s) to use", + ) + parser.add_argument( + "--timeout", + type=int, + default=900, + help="timeout, in seconds (default: 900)", + ) + parser.add_argument( + "--execdir", + type=pathlib.Path, + default=pathlib.Path.cwd(), + help="directory to run the program from", + ) + parser.add_argument( + "--codesign_identity", + type=str, + help="ignored, used for compatibility with libc++ tests", + ) + parser.add_argument( + "--env", + type=str, + nargs="*", + help="ignored, used for compatibility with libc++ tests", + ) + parser.add_argument( + "--verbose", + action="store_true", + help="Print verbose output. This may affect test result, as the output " + "will be added to the output of the test.", + ) + parser.add_argument( + "--tarmac", + help="File to write tarmac trace to (slows execution significantly)", + ) + parser.add_argument("image", help="image file to execute") + parser.add_argument( + "arguments", + nargs=argparse.REMAINDER, + default=[], + help="optional arguments for the image", + ) + args = parser.parse_args() + return run_fvp( + args.fvp_install_dir, + args.fvp_config_dir, + args.fvp_model, + args.fvp_config, + args.image, + [args.image] + args.arguments, + args.timeout, + args.execdir, + args.verbose, + args.tarmac, + ) + sys.exit(ret_code) + + +if __name__ == "__main__": + main() diff --git a/test-support/picolibc-test-wrapper.py b/test-support/picolibc-test-wrapper.py index eeb9c276..2451599b 100755 --- a/test-support/picolibc-test-wrapper.py +++ b/test-support/picolibc-test-wrapper.py @@ -1,10 +1,11 @@ #!/usr/bin/env python3 -# Copyright (c) 2023, Arm Limited and affiliates. +# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its affiliates -# This is a wrapper script to run picolibc tests with QEMU. +# This is a wrapper script to run picolibc tests with QEMU or FVPs. from run_qemu import run_qemu +from run_fvp import run_fvp import argparse import pathlib import sys @@ -38,37 +39,72 @@ "picolibc_armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti-build/test/math_errhandling", ] +disabled_tests_fvp = [ + # SDDKW-53824: ":semihosting-features" pseudo-file not implemented. + "test/semihost/semihost-exit-extended", + # SDDKW-25808: SYS_SEEK returns wrong value. + "test/semihost/semihost-seek", + "test/test-fread-fwrite", + "test/posix-io", + # SDDKW-94045: rateInHz port not connected in Corstone-310 FVP. + "test/semihost/semihost-gettimeofday", +] + -def is_disabled(image): - return any([image.endswith(t) for t in disabled_tests]) +def is_disabled(image, use_fvp): + if any([image.endswith(t) for t in disabled_tests]): + return True + if use_fvp and any([image.endswith(t) for t in disabled_tests_fvp]): + return True + return False def run(args): - if is_disabled(args.image): + if is_disabled(args.image, args.qemu_command is None): return EXIT_CODE_SKIP - return run_qemu( - args.qemu_command, - args.qemu_machine, - args.qemu_cpu, - args.qemu_params.split(":") if args.qemu_params else [], - args.image, - ["program-name"] + args.arguments, - None, - pathlib.Path.cwd(), - args.verbose, - ) + # Some picolibc tests expect argv[0] to be literally "program-name", not + # the actual program name. + argv = ["program-name"] + args.arguments + if args.qemu_command: + return run_qemu( + args.qemu_command, + args.qemu_machine, + args.qemu_cpu, + args.qemu_params.split(":") if args.qemu_params else [], + args.image, + argv, + None, + pathlib.Path.cwd(), + args.verbose, + ) + else: + return run_fvp( + args.fvp_install_dir, + args.fvp_config_dir, + args.fvp_model, + args.fvp_config, + args.image, + argv, + None, + pathlib.Path.cwd(), + args.verbose, + args.tarmac, + ) def main(): parser = argparse.ArgumentParser( - description="Run a single test using qemu" + description="Run a single test using either qemu or an FVP" ) - parser.add_argument( - "--qemu-command", required=True, help="qemu-system- path" + main_arg_group = parser.add_mutually_exclusive_group(required=True) + main_arg_group.add_argument( + "--qemu-command", help="qemu-system- path" + ) + main_arg_group.add_argument( + "--fvp-install-dir", help="Directory in which FVP models are installed" ) parser.add_argument( "--qemu-machine", - required=True, help="name of the machine to pass to QEMU", ) parser.add_argument( @@ -76,9 +112,24 @@ def main(): ) parser.add_argument( "--qemu-params", - required=False, help='list of arguments to pass to qemu, separated with ":"', ) + parser.add_argument( + "--fvp-config-dir", help="Directory in which FVP models are installed" + ) + parser.add_argument( + "--fvp-model", + help="model name for FVP", + ) + parser.add_argument( + "--fvp-config", + action="append", + help="FVP config file(s) to use", + ) + parser.add_argument( + "--tarmac", + help="file to wrote tarmac trace to (FVP only)", + ) parser.add_argument( "--verbose", action="store_true", diff --git a/test-support/run_fvp.py b/test-support/run_fvp.py new file mode 100755 index 00000000..1a882d2f --- /dev/null +++ b/test-support/run_fvp.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates + +import subprocess +import sys +from os import path +from dataclasses import dataclass +import shlex + +@dataclass +class FVP: + model_exe: str + tarmac_plugin: str + cmdline_param: str + +MODELS = { + "corstone-310": FVP( + "Corstone-310/models/Linux64_GCC-9.3/FVP_Corstone_SSE-310", + "Corstone-310/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "cpu0.semihosting-cmd_line", + ), + "aem-a": FVP( + "Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3/FVP_Base_RevC-2xAEMvA", + "Base_RevC_AEMvA_pkg/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "cluster0.cpu0.semihosting-cmd_line", + ), + "aem-r": FVP( + "AEMv8R_base_pkg/models/Linux64_GCC-9.3/FVP_BaseR_AEMv8R", + "AEMv8R_base_pkg/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "cluster0.cpu0.semihosting-cmd_line", + ), +} + + +def run_fvp( + fvp_install_dir, + fvp_config_dir, + fvp_model, + fvp_configs, + image, + arguments, + timeout, + working_directory, + verbose, + tarmac_file, +): + """Execute the program using an FVP and return the subprocess return code.""" + if fvp_model not in MODELS: + raise Exception(f"{fvp_model} is not a recognised model name") + model = MODELS[fvp_model] + + command = [path.join(fvp_install_dir, model.model_exe)] + command.extend(["--quiet"]) + for config in fvp_configs: + command.extend(["--config-file", path.join(fvp_config_dir, config + ".cfg")]) + command.extend(["--application", image]) + command.extend(["--parameter", f"{model.cmdline_param}={shlex.join(arguments)}"]) + if tarmac_file is not None: + command.extend([ + "--plugin", + path.join(fvp_install_dir, model.tarmac_plugin), + "--parameter", + "TRACE.TarmacTrace.trace-file=" + tarmac_file, + ]) + + if verbose: + print("running: {}".format(shlex.join(command))) + + result = subprocess.run( + command, + stdout=subprocess.PIPE, + stderr=sys.stderr, + timeout=timeout, + cwd=working_directory, + check=False, + ) + sys.stdout.buffer.write(result.stdout) + return result.returncode + From bd5ecae8e6ad517410fed0143d95fedaf423e2c7 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Fri, 20 Sep 2024 11:57:00 +0200 Subject: [PATCH 045/138] Build libraries even when FVPs not installed (#509) This was the intention of the previous patch, but I put the check in the wrong place, so the actual builds of the library variants which need FVPs were disabled, not just the tests. This doesn't need passing through to the add_newlib or add_llvmlibc functions because we don't run the tests for them yet. --- CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bedb3f19..dbbef62b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -708,6 +708,7 @@ function( default_ram_addr default_ram_size default_stack_size + run_tests ) if(CMAKE_INSTALL_MESSAGE STREQUAL NEVER) set(MESON_INSTALL_QUIET "--quiet") @@ -789,10 +790,12 @@ function( # only in tests step, otherwise, they would be built before install. ExternalProject_Add_StepDependencies(picolibc_${variant} test compiler_rt_${variant}-install) - add_custom_target(check-picolibc-${variant}) - add_dependencies(check-picolibc-${variant} picolibc_${variant}-test) - add_dependencies(check-picolibc check-picolibc-${variant}) - add_dependencies(llvm-toolchain-runtimes picolibc_${variant}) + if(run_tests) + add_custom_target(check-picolibc-${variant}) + add_dependencies(check-picolibc-${variant} picolibc_${variant}-test) + add_dependencies(check-picolibc check-picolibc-${variant}) + add_dependencies(llvm-toolchain-runtimes picolibc_${variant}) + endif() endfunction() function( @@ -1021,6 +1024,7 @@ macro( default_ram_addr default_ram_size default_stack_size + run_tests ) # It would be nice to just pass ${ARGN} to both the underlying functions, # but that has the side effect of expanding any list arguments (e.g. @@ -1042,6 +1046,7 @@ macro( "${default_ram_addr}" "${default_ram_size}" "${default_stack_size}" + "${run_tests}" ) elseif(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) add_newlib( @@ -1435,9 +1440,7 @@ function(add_library_variant target_arch) set(have_executor TRUE) endif() list(JOIN lit_test_executor " " lit_test_executor) - if(NOT have_executor) - message("All library tests disabled for ${variant}, due to missing executor") - elseif(NOT PREBUILT_TARGET_LIBRARIES) + if(NOT PREBUILT_TARGET_LIBRARIES) add_libc( "${directory}" "${variant}" @@ -1452,6 +1455,7 @@ function(add_library_variant target_arch) "${VARIANT_RAM_ADDRESS}" "${VARIANT_RAM_SIZE}" "${VARIANT_STACK_SIZE}" + "${have_executor}" ) add_compiler_rt( "${directory}" @@ -1474,7 +1478,9 @@ function(add_library_variant target_arch) ${VARIANT_ENABLE_RTTI} ) endif() - if(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8") + if(NOT have_executor) + message("All library tests disabled for ${variant}, due to missing executor") + elseif(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8") message("C++ runtime libraries tests disabled for ${variant}") else() add_custom_target(check-llvm-toolchain-runtimes-${variant}) From c9fcdf9a7628ab7ca244fe8283c189ff639ab8c9 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Mon, 30 Sep 2024 12:39:40 +0200 Subject: [PATCH 046/138] Add llvm-strings to the distribution (#511) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbbef62b..68374da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,6 +187,7 @@ set(LLVM_DISTRIBUTION_COMPONENTS llvm-readelf llvm-readobj llvm-size + llvm-strings llvm-strip llvm-symbolizer LTO From 7c2c177a90640febffec552bc081ad408949e00b Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Mon, 30 Sep 2024 12:45:02 +0200 Subject: [PATCH 047/138] Add clang-cpp to the distribution (#512) This is a symlink to clang, which makes it act like the C preprocessor by default. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68374da6..9abe83bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,7 @@ set(BUG_REPORT_URL "https://github.com/ARM-software/LLVM-embedded-toolchain-for- set(LLVM_DISTRIBUTION_COMPONENTS clang-resource-headers clang + clang-cpp dsymutil lld llvm-ar From de4eb46cc92148ed4bd44a34acb6f86f01b4a4eb Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 1 Oct 2024 10:13:04 +0200 Subject: [PATCH 048/138] clang-cpp does not need installing in distribution (#514) The clang-cpp symlink (or copy) is created with the ALWAYS_GENERATE flag in clang's cmake, so it always gets installed, meaning we don't need to add it to LLVM_DISTRIBUTION_COMPONENTS. This was causing windows build failures because the install target was being called for it, but not created. I'm not sure why the Linux build was succeeding despite this, but I've checked that clang-cpp existed in both the Windows and Linux builds of the previous release (18.1.3), so clang-cpp doesn't need to be in this list. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9abe83bd..68374da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,7 +172,6 @@ set(BUG_REPORT_URL "https://github.com/ARM-software/LLVM-embedded-toolchain-for- set(LLVM_DISTRIBUTION_COMPONENTS clang-resource-headers clang - clang-cpp dsymutil lld llvm-ar From 1835df723e15f3dab27a46b44940390dff34de00 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 3 Oct 2024 12:29:35 +0200 Subject: [PATCH 049/138] Generate multilib.yaml for compatible architecture versions and features (#517) This expands multilib-fpus.py (renaming it) to add Match blocks to split the -march options into two sets of options, which will be more useful for libray matching: * A -march= option for each minor version less than or equal to the selected one, so that it will be possible to mark a library as requiring one architecture version, and allowing it to be used for any later version. This strips any feature modifiers off the option, so that they can be matched independently of base architecture version. * A -march option for every feature modifier which is enabled or disabled. This uses the made-up architecture name "armvX", which isn't a valid option, but that doesn't matter to multilib, and this allows matching features independently of the base architecture version. --- CMakeLists.txt | 4 +- multilib-fpus.py => multilib-generate.py | 136 ++++++++++++++++++++--- test/multilib/aarch64.test | 24 +++- test/multilib/armv8a.test | 6 + test/multilib/armv8r.test | 3 + 5 files changed, 152 insertions(+), 21 deletions(-) rename multilib-fpus.py => multilib-generate.py (65%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68374da6..d940d505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2037,7 +2037,7 @@ configure_file( ) set(multilib_yaml_depends - "${CMAKE_CURRENT_SOURCE_DIR}/multilib-fpus.py" + "${CMAKE_CURRENT_SOURCE_DIR}/multilib-generate.py" "${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml" ) if(LIBS_DEPEND_ON_TOOLS) @@ -2049,7 +2049,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml - COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/multilib-fpus.py" + COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/multilib-generate.py" "--clang=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}" "--llvm-source=${llvmproject_SOURCE_DIR}" >> "${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml" diff --git a/multilib-fpus.py b/multilib-generate.py similarity index 65% rename from multilib-fpus.py rename to multilib-generate.py index 992d4873..cc93bbfa 100755 --- a/multilib-fpus.py +++ b/multilib-generate.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 -"""Auto-generate implications between -mfpu options for multilib.yaml.in. +"""Auto-generate implications between command-line options options for +multilib.yaml.in. Each FPU name that clang knows about is mapped to all the FPU names that clang considers to be a subset of it (determined by extracting @@ -21,6 +22,20 @@ d-registers, because the extra 16 d-registers are caller-saved, so setjmp and exceptions need not preserve them. Interrupt handlers would have to preserve them, but our libraries don't define any. + +For architecture extension modifiers on the -march option, we expand these into +options of the form -march=armvX+[no]feature, for each feature which is listed +as enabled or disabled in the input options. Each of these new options has +exactly one feature, so the multilib file can mark a library as depending on +any set of by matching multiple options. The "armvX" architecture version isn't +a valid option, but that doesn't matter to multilib, and means that we don't +need to repeat the matching for every minor version. + +For architecture versions, we expand -march=armvX.Y-a+features to include every +lower or equal architecture version, so that if, for example, a library +requires armv8.3-a, then a link command targeting any later version will be +able to select it. These generated options don't include the feature modifiers, +which can be matched separately if a library requires them. """ import argparse @@ -28,6 +43,7 @@ import os import shlex import subprocess +from dataclasses import dataclass def get_fpu_list(args): @@ -164,21 +180,7 @@ def get_target_features(args, fpu): return features -def main(): - parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter, - ) - parser.add_argument( - "--clang", required=True, help="Path to clang executable." - ) - parser.add_argument( - "--llvm-source", - required=True, - help="Path to root of llvm-project source tree.", - ) - args = parser.parse_args() - +def generate_fpus(args): # Collect all the data: make the list of FPU names, and the set of # features that LLVM maps each one to. fpu_features = { @@ -208,7 +210,109 @@ def main(): print(" Flags:") for sub_fpu in subsets: print(" - -mfpu=" + sub_fpu) + print() + + +def get_extension_list(clang, triple): + """Extract the list of architecture extension flags from clang, by running + it with the --print-supported-extensions option.""" + + command = [ + clang, + "--target=" + triple, + "--print-supported-extensions", + ] + + output = subprocess.check_output( + command, stderr=subprocess.STDOUT + ).decode() + + for line in output.split("\n"): + parts = line.split(maxsplit=1) + # The feature lines will look like this, ignore everything else: + # aes FEAT_AES, FEAT_PMULL Enable AES support + if len(parts) == 2 and parts[1].startswith("FEAT_"): + yield parts[0] + + +def generate_extensions(args): + aarch64_features = get_extension_list(args.clang, "aarch64-none-eabi") + aarch32_features = get_extension_list(args.clang, "arm-none-eabi") + all_features = set(aarch64_features) | set(aarch32_features) + + print("# Expand -march=...+[no]feature... into individual options we can match") + print("# on. We use 'armvX' to represent a feature applied to any architecture, so") + print("# that these don't need to be repeated for every version. Libraries which") + print("# require a particular architecture version or profile should also match on the") + print("# original option to check that.") + + for feature in all_features: + print(f"- Match: -march=armv.*\\+{feature}($|\+.*)") + print(f" Flags:") + print(f" - -march=armvX+{feature}") + print(f"- Match: -march=armv.*\\+no{feature}($|\+.*)") + print(f" Flags:") + print(f" - -march=armvX+no{feature}") + print() + + +@dataclass +class Version: + major: int + minor: int + profile: int + + def __str__(self): + if self.minor == 0: + return f"armv{self.major}-{self.profile}" + else: + return f"armv{self.major}.{self.minor}-{self.profile}" + + @property + def all_compatible(self): + yield self + for compat_minor in range(self.minor): + yield Version(self.major, compat_minor, self.profile) + if self.major == 9: + for compat_minor in range(self.minor + 5 + 1): + yield Version(self.major - 1, compat_minor, self.profile) + +def generate_versions(args): + """Generate match blocks which allow selecting a library build for a + lower-version architecture, for the v8.x-A and v9.x-A minor versions.""" + versions = ( + [Version(8, minor, "a") for minor in range(10)] + + [Version(9, minor, "a") for minor in range(6)] + + [Version(8, minor, "r") for minor in range(1)] + ) + + for match_ver in versions: + print(f"- Match: -march={match_ver}.*") + print(f" Flags:") + for compat_ver in match_ver.all_compatible: + print(f" - -march={compat_ver}") + print() + + + +def main(): + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument( + "--clang", required=True, help="Path to clang executable." + ) + parser.add_argument( + "--llvm-source", + required=True, + help="Path to root of llvm-project source tree.", + ) + args = parser.parse_args() + generate_fpus(args) + generate_extensions(args) + generate_versions(args) if __name__ == "__main__": main() diff --git a/test/multilib/aarch64.test b/test/multilib/aarch64.test index f062fc2a..9bd19c73 100644 --- a/test/multilib/aarch64.test +++ b/test/multilib/aarch64.test @@ -1,3 +1,21 @@ -# RUN: %clang -print-multi-directory --target=aarch64-none-elf | FileCheck %s -# CHECK: aarch64-none-elf/aarch64a_exn_rtti{{$}} -# CHECK-EMPTY: +# RUN: %clang -print-multi-directory --target=aarch64-none-elf | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8-a | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8-a+fp16 | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8.1-a | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8.5-a+nodotprod | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8.9-a | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv9.5-a | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv9.5-a+sve2+sme2 | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mcpu=cortex-a57 | FileCheck %s --check-prefix=AARCH64-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mcpu=cortex-a57+fp16 | FileCheck %s --check-prefix=AARCH64-EXNRTTI + +# AARCH64-EXNRTTI: aarch64-none-elf/aarch64a_exn_rtti{{$}} +# AARCH64-EXNRTTI-EMPTY: +# +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8.5-a+nodotprod -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv9.5-a+sve2+sme2 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mcpu=cortex-a57+fp16 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 +# +# AARCH64: aarch64-none-elf/aarch64a{{$}} +# AARCH64-EMPTY: diff --git a/test/multilib/armv8a.test b/test/multilib/armv8a.test index d74f7104..6f1ec43d 100644 --- a/test/multilib/armv8a.test +++ b/test/multilib/armv8a.test @@ -1,6 +1,9 @@ # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -marm | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -mthumb | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv9.5-a | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv8.2-a+fp16 | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv8.5-a+nodotprod | FileCheck %s # CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: @@ -15,5 +18,8 @@ # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv9.5-a | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv8.2-a+fp16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv8.5-a+nodotprod | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: diff --git a/test/multilib/armv8r.test b/test/multilib/armv8r.test index e9c6a5ba..f5a4bb83 100644 --- a/test/multilib/armv8r.test +++ b/test/multilib/armv8r.test @@ -1,6 +1,8 @@ # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -marm | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -mthumb | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -march=armv8-r+ras | FileCheck %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -mcpu=cortex-r52 | FileCheck %s # CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: @@ -15,5 +17,6 @@ # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mcpu=cortex-r52 | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: From 8a7f8ccab08e8d611ed3ca9dfa40126596c20bc5 Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Thu, 3 Oct 2024 13:45:58 +0100 Subject: [PATCH 050/138] Adjust clang's multilib flags test to cope with missing variant (#504) The clang driver's `print-multi-selection-flags.c` test uses a combination of command line options in one of its RUN lines for which we don't have a valid library variant available. Since the merging of PR #500, this combination of options now trigger an error to inform the user of an unsupported setup, but this error also causes the test to fail. This adds a new patch file for llvm-project to adjust the test accordingly. --- ...th-picolibc-xfail-one-remaining-test.patch | 8 +++--- ...ts-with-picolibc-disable-large-tests.patch | 6 ++--- ...003-Disable-failing-compiler-rt-test.patch | 4 +-- ...-with-picolibc-XFAIL-uses-of-atomics.patch | 8 +++--- ...h-picolibc-mark-two-more-large-tests.patch | 4 +-- ...ust-test-to-cope-with-unsupported-mu.patch | 25 +++++++++++++++++++ 6 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch index 3d0a0dc4..31c067c4 100644 --- a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch +++ b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch @@ -1,14 +1,14 @@ -From 1db48238bfbc5324dadf828532a4c67524dc471b Mon Sep 17 00:00:00 2001 +From fd26b5fd6a882677062a7c495660f22ca2b13cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Mon, 16 Oct 2023 11:35:48 +0200 -Subject: [PATCH] [libc++] tests with picolibc: xfail one remaining test +Subject: [libc++] tests with picolibc: xfail one remaining test --- .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -index d8eff69cb5..e16048df72 100644 +index d8eff69cb53f..e16048df722e 100644 --- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp @@ -17,6 +17,9 @@ @@ -22,5 +22,5 @@ index d8eff69cb5..e16048df72 100644 void f() {} -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch index 8b437199..259b8e95 100644 --- a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch +++ b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch @@ -1,4 +1,4 @@ -From 80000ddfade0f706ad1ebb488a51132a88cbe61d Mon Sep 17 00:00:00 2001 +From 02175d0f237e5d14c6b59ce6b16818927f10368f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 15 Nov 2023 12:18:35 +0100 Subject: [libc++] tests with picolibc: disable large tests @@ -41,7 +41,7 @@ index b5f9089308d2..0a83e75ceceb 100644 set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") find_program(QEMU_SYSTEM_ARM qemu-system-arm REQUIRED) diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index fe5598991b83..65d30a352814 100644 +index 77f79e0d40e8..4b69df08ea28 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -7,7 +7,7 @@ @@ -54,5 +54,5 @@ index fe5598991b83..65d30a352814 100644 // https://llvm.org/PR51407 was not fixed in some previously-released // demanglers, which causes them to run into the infinite loop. -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch index 4f456841..bc869cea 100644 --- a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch +++ b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch @@ -1,4 +1,4 @@ -From c4837fa13ec89cc06b07af8cba8494189520e546 Mon Sep 17 00:00:00 2001 +From d1d619643bedea5759ef56ed42c4d97846f3c789 Mon Sep 17 00:00:00 2001 From: Piotr Przybyla Date: Wed, 15 Nov 2023 16:04:24 +0000 Subject: Disable failing compiler-rt test @@ -18,5 +18,5 @@ index 2ff65a8b9ec3..98611a75e85f 100644 // RUN: %clang_builtins %s %librt -o %t && %run %t -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index 48bf4e88..d0e98d11 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -1,4 +1,4 @@ -From 3b7ada947d511fe0edb7cca0dbdb640d8e1ecd2b Mon Sep 17 00:00:00 2001 +From 46019866b66f8859e7dff666c519c35d5b921291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Thu, 9 Nov 2023 15:25:14 +0100 Subject: [libc++] tests with picolibc: XFAIL uses of atomics @@ -88,10 +88,10 @@ index 000000000000..5ecc58f3e385 +if "has-no-atomics" in config.available_features: + config.unsupported = True diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py -index 6ef40755c59d..6c2960260189 100644 +index 15456171b548..ddd44a63c618 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py -@@ -206,6 +206,21 @@ DEFAULT_FEATURES = [ +@@ -215,6 +215,21 @@ DEFAULT_FEATURES = [ """, ), ), @@ -114,5 +114,5 @@ index 6ef40755c59d..6c2960260189 100644 Feature( name="32-bit-pointer", -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch index 05567625..27c49bdd 100644 --- a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch +++ b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch @@ -1,4 +1,4 @@ -From 8eb9344a4ba97b45cea1a6adec98aff6c6149359 Mon Sep 17 00:00:00 2001 +From e3d01a7a6d51fe1f2d605a49123e72e2f493a532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 22 Nov 2023 16:12:39 +0100 Subject: [libc++] tests with picolibc: mark two more large tests @@ -37,5 +37,5 @@ index 64a6a135adda..057301e6f868 100644 // bool // regex_search(BidirectionalIterator first, BidirectionalIterator last, -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch b/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch new file mode 100644 index 00000000..2b56c224 --- /dev/null +++ b/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch @@ -0,0 +1,25 @@ +From 226969b13351bc60ac0e6776dedf3b8396747ced Mon Sep 17 00:00:00 2001 +From: Lucas Prates +Date: Wed, 18 Sep 2024 11:43:03 +0100 +Subject: [Clang][Driver] Adjust test to cope with unsupported multilib variant + +--- + clang/test/Driver/print-multi-selection-flags.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/test/Driver/print-multi-selection-flags.c b/clang/test/Driver/print-multi-selection-flags.c +index 0116c7f5a03b..e2c89a083e2c 100644 +--- a/clang/test/Driver/print-multi-selection-flags.c ++++ b/clang/test/Driver/print-multi-selection-flags.c +@@ -30,7 +30,7 @@ + // CHECK-MVE: -mfloat-abi=hard + // CHECK-MVE: -mfpu=fp-armv8-fullfp16-sp-d16 + +-// RUN: %clang -print-multi-flags-experimental --target=arm-none-eabi -march=armv8.1m.main+mve+nofp | FileCheck --check-prefix=CHECK-MVENOFP %s ++// RUN: not %clang -print-multi-flags-experimental --target=arm-none-eabi -march=armv8.1m.main+mve+nofp | FileCheck --check-prefix=CHECK-MVENOFP %s + // CHECK-MVENOFP: -march=thumbv8.1m.main{{.*}}+mve{{.*}} + // CHECK-MVENOFP-NOT: -march=thumbv8.1m.main{{.*}}+mve.fp{{.*}} + // CHECK-MVENOFP: -mfpu=none +-- +2.39.5 (Apple Git-154) + From 653dd6f83cd033233d9ac967debc94205038887a Mon Sep 17 00:00:00 2001 From: David Candler Date: Fri, 4 Oct 2024 11:28:44 +0100 Subject: [PATCH 051/138] Add make.bat for exceptions sample The cpp-baremetal-semihosting-exceptions sample is the only sample missing a make.bat for running on Windows. A batch file has now been added based on the others to carry out the same commands as the Makefile, but without the grep commands since these are less likely to be available. --- .../Makefile | 2 +- .../make.bat | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 samples/src/cpp-baremetal-semihosting-exceptions/make.bat diff --git a/samples/src/cpp-baremetal-semihosting-exceptions/Makefile b/samples/src/cpp-baremetal-semihosting-exceptions/Makefile index 349e888d..7465f51a 100644 --- a/samples/src/cpp-baremetal-semihosting-exceptions/Makefile +++ b/samples/src/cpp-baremetal-semihosting-exceptions/Makefile @@ -25,7 +25,7 @@ hello.hex: hello.cpp $(BIN_PATH)/llvm-objcopy -O ihex hello.elf hello.hex hello-exn.hex: hello-exn.cpp - $(BIN_PATH)/clang++ $(MICROBIT_TARGET) $(CRT_SEMIHOST) -print-multi-directory -g -T ../../ldscripts/microbit.ld -o hello.elf $^ | grep "_exn_" + $(BIN_PATH)/clang++ $(MICROBIT_TARGET) $(CRT_SEMIHOST) -print-multi-directory -g -T ../../ldscripts/microbit.ld -o hello-exn.elf $^ | grep "_exn_" $(BIN_PATH)/clang++ $(MICROBIT_TARGET) $(CRT_SEMIHOST) -g -T ../../ldscripts/microbit.ld -o hello-exn.elf $^ $(BIN_PATH)/llvm-objcopy -O ihex hello-exn.elf hello-exn.hex diff --git a/samples/src/cpp-baremetal-semihosting-exceptions/make.bat b/samples/src/cpp-baremetal-semihosting-exceptions/make.bat new file mode 100644 index 00000000..af5110ed --- /dev/null +++ b/samples/src/cpp-baremetal-semihosting-exceptions/make.bat @@ -0,0 +1,64 @@ +@REM Copyright (c) 2024, Arm Limited and affiliates. +@REM SPDX-License-Identifier: Apache-2.0 +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. + +@if [%1]==[] goto :target_empty +@set target=%1 +@goto :make +:target_empty +@set target=build + +:make +@if [%target%]==[build] goto :build +@if [%target%]==[run] goto :run +@if [%target%]==[clean] goto :clean +@echo Error: unknown target "%target%" +@exit /B 1 + +:build +@if [%BIN_PATH%]==[] goto :bin_path_empty +@call :build_fn +@exit /B + +:run +@if exist hello.hex goto :do_run +@if [%BIN_PATH%]==[] goto :bin_path_empty +@call :build_fn +:do_run +qemu-system-arm.exe -M microbit -semihosting -nographic -device loader,file=hello.hex +qemu-system-arm.exe -M microbit -semihosting -nographic -device loader,file=hello-exn.hex +@exit /B + +:clean +if exist hello.elf del /q hello.elf +if exist hello.hex del /q hello.hex +if exist hello-exn.elf del /q hello-exn.elf +if exist hello-exn.hex del /q hello-exn.hex +@exit /B + +:bin_path_empty +@echo Error: BIN_PATH environment variable is not set +@exit /B 1 + +:build_fn +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -print-multi-directory -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -fno-exceptions -fno-rtti -g -T ..\..\ldscripts\microbit.ld -o hello.elf hello.cpp +%BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -print-multi-directory -g -T ..\..\ldscripts\microbit.ld -o hello-exn.elf hello-exn.cpp +%BIN_PATH%\clang++.exe --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -lcrt0-semihost -lsemihost -g -T ..\..\ldscripts\microbit.ld -o hello-exn.elf hello-exn.cpp +%BIN_PATH%\llvm-objcopy.exe -O ihex hello-exn.elf hello-exn.hex +@exit /B + +:build_exn_fn +@exit /B From ea0e845fe0cbc8159b82d2cf9f49a7f0e410a175 Mon Sep 17 00:00:00 2001 From: David Candler Date: Fri, 4 Oct 2024 11:33:29 +0100 Subject: [PATCH 052/138] Fix paths in profiling sample on Windows The cpp-baremetal-semihosting-prof sample will fail if run as instructed, as two programs are missing %BIN_PATH% in the make.bat script. --- samples/src/cpp-baremetal-semihosting-prof/make.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/src/cpp-baremetal-semihosting-prof/make.bat b/samples/src/cpp-baremetal-semihosting-prof/make.bat index cffb9baa..895ceab2 100644 --- a/samples/src/cpp-baremetal-semihosting-prof/make.bat +++ b/samples/src/cpp-baremetal-semihosting-prof/make.bat @@ -37,8 +37,8 @@ @call :build_fn :do_run qemu-system-arm.exe -M microbit -semihosting -nographic -device loader,file=hello.hex -llvm-profdata.exe merge -sparse default.profraw -o hello.profdata -llvm-cov.exe show hello.elf -instr-profile=hello.profdata +%BIN_PATH%\llvm-profdata.exe merge -sparse default.profraw -o hello.profdata +%BIN_PATH%\llvm-cov.exe show hello.elf -instr-profile=hello.profdata @exit /B :clean From 1133650fc3b852a2e1542220f59bb870b7109f75 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 4 Oct 2024 17:36:08 +0100 Subject: [PATCH 053/138] Update llvmlibc.md documentation to include AArch64 support and heap. (#521) Support for AArch64 has been available for AArch64 in llvm-libc for some time, but the docs still claim this isn't supported. Also update the instructions for defining the bounds of the heap for when malloc is used. --- docs/llvmlibc.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/llvmlibc.md b/docs/llvmlibc.md index b9cc6fc8..f09ec028 100644 --- a/docs/llvmlibc.md +++ b/docs/llvmlibc.md @@ -47,6 +47,13 @@ following command line options, in addition to `--target`, `-march` or the symbol `__stack` in addition to whatever other memory layout you want. +* `-Wl,__llvm_libc_heap_limit=0x`_nnnnnn_ if you are using the heap. + The heap start defined by the value of the symbol `_end` which will + be defined by the linker if no linker script is used. Alternatively + use a linker script that defines the symbols `_end` and + `__llvm_libc_heap_limit` in addition to whatever other memory layout + you want. + For example: ``` @@ -55,9 +62,6 @@ clang --config=llvmlibc.cfg --target=arm-none-eabi -march=armv7m -o hello hello. ## Limitations of LLVM libc in LLVM Embedded Toolchain for Arm -At present, this toolchain only builds LLVM libc for AArch32, not for -AArch64. - At present, this toolchain does not build any C++ libraries to go with LLVM libc. From 598ac756d621881183d65caf722b4e640a810f1f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 7 Oct 2024 10:33:20 +0100 Subject: [PATCH 054/138] [multilib.yaml] Rename the FatalError keyword to Error. LLVM PR https://github.com/llvm/llvm-project/pull/110804 made this change at the request of a code reviewer of the original patch. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d940d505..43ad958f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1518,7 +1518,7 @@ function(add_nonexistent_library_variant) ) cmake_parse_arguments(ERR "" "${one_value_args}" "" ${ARGN}) - string(APPEND multilib_yaml_content "- FatalError: \"${ERR_ERROR_MESSAGE}\"\n") + string(APPEND multilib_yaml_content "- Error: \"${ERR_ERROR_MESSAGE}\"\n") string(APPEND multilib_yaml_content " Flags:\n") string(REPLACE " " ";" multilib_flags_list ${ERR_MULTILIB_FLAGS}) From 4a2f0299bdf294245c1f3458651913e1765b7fd7 Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Mon, 7 Oct 2024 14:08:44 +0100 Subject: [PATCH 055/138] Revert "Adjust clang's multilib flags test to cope with missing variant" (#527) Reverts ARM-software/LLVM-embedded-toolchain-for-Arm#504. The upstream change from llvm/llvm-project#109640 has now been merged, allowing tests to specify multilib yaml file using a new command line option. The relevant tests have been updated by that change, so the downstream adjustment is no longer needed. --- ...th-picolibc-xfail-one-remaining-test.patch | 8 +++--- ...ts-with-picolibc-disable-large-tests.patch | 6 ++--- ...003-Disable-failing-compiler-rt-test.patch | 4 +-- ...-with-picolibc-XFAIL-uses-of-atomics.patch | 8 +++--- ...h-picolibc-mark-two-more-large-tests.patch | 4 +-- ...ust-test-to-cope-with-unsupported-mu.patch | 25 ------------------- 6 files changed, 15 insertions(+), 40 deletions(-) delete mode 100644 patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch index 31c067c4..3d0a0dc4 100644 --- a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch +++ b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch @@ -1,14 +1,14 @@ -From fd26b5fd6a882677062a7c495660f22ca2b13cd5 Mon Sep 17 00:00:00 2001 +From 1db48238bfbc5324dadf828532a4c67524dc471b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Mon, 16 Oct 2023 11:35:48 +0200 -Subject: [libc++] tests with picolibc: xfail one remaining test +Subject: [PATCH] [libc++] tests with picolibc: xfail one remaining test --- .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -index d8eff69cb53f..e16048df722e 100644 +index d8eff69cb5..e16048df72 100644 --- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp @@ -17,6 +17,9 @@ @@ -22,5 +22,5 @@ index d8eff69cb53f..e16048df722e 100644 void f() {} -- -2.39.5 (Apple Git-154) +2.34.1 diff --git a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch index 259b8e95..8b437199 100644 --- a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch +++ b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch @@ -1,4 +1,4 @@ -From 02175d0f237e5d14c6b59ce6b16818927f10368f Mon Sep 17 00:00:00 2001 +From 80000ddfade0f706ad1ebb488a51132a88cbe61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 15 Nov 2023 12:18:35 +0100 Subject: [libc++] tests with picolibc: disable large tests @@ -41,7 +41,7 @@ index b5f9089308d2..0a83e75ceceb 100644 set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") find_program(QEMU_SYSTEM_ARM qemu-system-arm REQUIRED) diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index 77f79e0d40e8..4b69df08ea28 100644 +index fe5598991b83..65d30a352814 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -7,7 +7,7 @@ @@ -54,5 +54,5 @@ index 77f79e0d40e8..4b69df08ea28 100644 // https://llvm.org/PR51407 was not fixed in some previously-released // demanglers, which causes them to run into the infinite loop. -- -2.39.5 (Apple Git-154) +2.34.1 diff --git a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch index bc869cea..4f456841 100644 --- a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch +++ b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch @@ -1,4 +1,4 @@ -From d1d619643bedea5759ef56ed42c4d97846f3c789 Mon Sep 17 00:00:00 2001 +From c4837fa13ec89cc06b07af8cba8494189520e546 Mon Sep 17 00:00:00 2001 From: Piotr Przybyla Date: Wed, 15 Nov 2023 16:04:24 +0000 Subject: Disable failing compiler-rt test @@ -18,5 +18,5 @@ index 2ff65a8b9ec3..98611a75e85f 100644 // RUN: %clang_builtins %s %librt -o %t && %run %t -- -2.39.5 (Apple Git-154) +2.34.1 diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index d0e98d11..48bf4e88 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -1,4 +1,4 @@ -From 46019866b66f8859e7dff666c519c35d5b921291 Mon Sep 17 00:00:00 2001 +From 3b7ada947d511fe0edb7cca0dbdb640d8e1ecd2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Thu, 9 Nov 2023 15:25:14 +0100 Subject: [libc++] tests with picolibc: XFAIL uses of atomics @@ -88,10 +88,10 @@ index 000000000000..5ecc58f3e385 +if "has-no-atomics" in config.available_features: + config.unsupported = True diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py -index 15456171b548..ddd44a63c618 100644 +index 6ef40755c59d..6c2960260189 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py -@@ -215,6 +215,21 @@ DEFAULT_FEATURES = [ +@@ -206,6 +206,21 @@ DEFAULT_FEATURES = [ """, ), ), @@ -114,5 +114,5 @@ index 15456171b548..ddd44a63c618 100644 Feature( name="32-bit-pointer", -- -2.39.5 (Apple Git-154) +2.34.1 diff --git a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch index 27c49bdd..05567625 100644 --- a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch +++ b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch @@ -1,4 +1,4 @@ -From e3d01a7a6d51fe1f2d605a49123e72e2f493a532 Mon Sep 17 00:00:00 2001 +From 8eb9344a4ba97b45cea1a6adec98aff6c6149359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 22 Nov 2023 16:12:39 +0100 Subject: [libc++] tests with picolibc: mark two more large tests @@ -37,5 +37,5 @@ index 64a6a135adda..057301e6f868 100644 // bool // regex_search(BidirectionalIterator first, BidirectionalIterator last, -- -2.39.5 (Apple Git-154) +2.34.1 diff --git a/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch b/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch deleted file mode 100644 index 2b56c224..00000000 --- a/patches/llvm-project/0006-Clang-Driver-Adjust-test-to-cope-with-unsupported-mu.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 226969b13351bc60ac0e6776dedf3b8396747ced Mon Sep 17 00:00:00 2001 -From: Lucas Prates -Date: Wed, 18 Sep 2024 11:43:03 +0100 -Subject: [Clang][Driver] Adjust test to cope with unsupported multilib variant - ---- - clang/test/Driver/print-multi-selection-flags.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/test/Driver/print-multi-selection-flags.c b/clang/test/Driver/print-multi-selection-flags.c -index 0116c7f5a03b..e2c89a083e2c 100644 ---- a/clang/test/Driver/print-multi-selection-flags.c -+++ b/clang/test/Driver/print-multi-selection-flags.c -@@ -30,7 +30,7 @@ - // CHECK-MVE: -mfloat-abi=hard - // CHECK-MVE: -mfpu=fp-armv8-fullfp16-sp-d16 - --// RUN: %clang -print-multi-flags-experimental --target=arm-none-eabi -march=armv8.1m.main+mve+nofp | FileCheck --check-prefix=CHECK-MVENOFP %s -+// RUN: not %clang -print-multi-flags-experimental --target=arm-none-eabi -march=armv8.1m.main+mve+nofp | FileCheck --check-prefix=CHECK-MVENOFP %s - // CHECK-MVENOFP: -march=thumbv8.1m.main{{.*}}+mve{{.*}} - // CHECK-MVENOFP-NOT: -march=thumbv8.1m.main{{.*}}+mve.fp{{.*}} - // CHECK-MVENOFP: -mfpu=none --- -2.39.5 (Apple Git-154) - From 1f2f4a940e49f0481d104cd2d425010374e250cb Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Tue, 8 Oct 2024 15:12:46 +0100 Subject: [PATCH 056/138] Update llvm-project patch files to apply cleanly on more recent commits (#528) Due to a recent commit in upstream LLVM, the patch for the `libcxxabi/test/test_demangle.pass.cpp` test now only applies when using 3-way merge. This patch rebases the set of patch files in `patches/llvm-project/*` to apply cleanly on recent commits from llvm/llvm-project. --- CMakeLists.txt | 2 +- ...-tests-with-picolibc-xfail-one-remaining-test.patch | 8 ++++---- ...-libc-tests-with-picolibc-disable-large-tests.patch | 10 +++++----- .../0003-Disable-failing-compiler-rt-test.patch | 4 ++-- ...ibc-tests-with-picolibc-XFAIL-uses-of-atomics.patch | 8 ++++---- ...tests-with-picolibc-mark-two-more-large-tests.patch | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ad958f..2e89f7ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,7 @@ endif() # The patches are generated from custom branch, with followin command: # git format-patch -k origin/main # The patches apply cleanly against llvm-project commit -# ed551e0778a35f00ab60f1c80d83ea8274d8d400. +# 327124ece7d59de56ca0f9faa2cd82af68c011b9. set( llvm_project_patches ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch diff --git a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch index 3d0a0dc4..b92d1efb 100644 --- a/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch +++ b/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch @@ -1,14 +1,14 @@ -From 1db48238bfbc5324dadf828532a4c67524dc471b Mon Sep 17 00:00:00 2001 +From 623881f1ea465f9c1837981db143f7225108580a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Mon, 16 Oct 2023 11:35:48 +0200 -Subject: [PATCH] [libc++] tests with picolibc: xfail one remaining test +Subject: [libc++] tests with picolibc: xfail one remaining test --- .../language.support/support.start.term/quick_exit.pass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp -index d8eff69cb5..e16048df72 100644 +index d8eff69cb53f..e16048df722e 100644 --- a/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp +++ b/libcxx/test/std/language.support/support.start.term/quick_exit.pass.cpp @@ -17,6 +17,9 @@ @@ -22,5 +22,5 @@ index d8eff69cb5..e16048df72 100644 void f() {} -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch index 8b437199..0e9821d2 100644 --- a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch +++ b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch @@ -1,4 +1,4 @@ -From 80000ddfade0f706ad1ebb488a51132a88cbe61d Mon Sep 17 00:00:00 2001 +From 8a0f8650d58f27ca32948554188b98c8978d1eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 15 Nov 2023 12:18:35 +0100 Subject: [libc++] tests with picolibc: disable large tests @@ -41,7 +41,7 @@ index b5f9089308d2..0a83e75ceceb 100644 set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") find_program(QEMU_SYSTEM_ARM qemu-system-arm REQUIRED) diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index fe5598991b83..65d30a352814 100644 +index ad131bb3a8a7..ac612c79f71c 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -7,7 +7,7 @@ @@ -51,8 +51,8 @@ index fe5598991b83..65d30a352814 100644 -// XFAIL: LIBCXX-PICOLIBC-FIXME +// REQUIRES: large_tests - // https://llvm.org/PR51407 was not fixed in some previously-released - // demanglers, which causes them to run into the infinite loop. + // This test exercises support for char array initializer lists added in dd8b266ef. + // UNSUPPORTED: using-built-library-before-llvm-20 -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch index 4f456841..290bf4bf 100644 --- a/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch +++ b/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch @@ -1,4 +1,4 @@ -From c4837fa13ec89cc06b07af8cba8494189520e546 Mon Sep 17 00:00:00 2001 +From 0f8dc80a7642430c8d02c36283766aeb5a59a331 Mon Sep 17 00:00:00 2001 From: Piotr Przybyla Date: Wed, 15 Nov 2023 16:04:24 +0000 Subject: Disable failing compiler-rt test @@ -18,5 +18,5 @@ index 2ff65a8b9ec3..98611a75e85f 100644 // RUN: %clang_builtins %s %librt -o %t && %run %t -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index 48bf4e88..573a1a26 100644 --- a/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -1,4 +1,4 @@ -From 3b7ada947d511fe0edb7cca0dbdb640d8e1ecd2b Mon Sep 17 00:00:00 2001 +From f5b5a95bd02f6d5bc6e80c238c2e8f7e08985d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Thu, 9 Nov 2023 15:25:14 +0100 Subject: [libc++] tests with picolibc: XFAIL uses of atomics @@ -88,10 +88,10 @@ index 000000000000..5ecc58f3e385 +if "has-no-atomics" in config.available_features: + config.unsupported = True diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py -index 6ef40755c59d..6c2960260189 100644 +index 735eb5ac949d..6ca4e8acb3f4 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py -@@ -206,6 +206,21 @@ DEFAULT_FEATURES = [ +@@ -215,6 +215,21 @@ DEFAULT_FEATURES = [ """, ), ), @@ -114,5 +114,5 @@ index 6ef40755c59d..6c2960260189 100644 Feature( name="32-bit-pointer", -- -2.34.1 +2.39.5 (Apple Git-154) diff --git a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch index 05567625..16cfb4a3 100644 --- a/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch +++ b/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch @@ -1,4 +1,4 @@ -From 8eb9344a4ba97b45cea1a6adec98aff6c6149359 Mon Sep 17 00:00:00 2001 +From 0961af52ac015c26829b4dae7fd6879a0b633f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 22 Nov 2023 16:12:39 +0100 Subject: [libc++] tests with picolibc: mark two more large tests @@ -37,5 +37,5 @@ index 64a6a135adda..057301e6f868 100644 // bool // regex_search(BidirectionalIterator first, BidirectionalIterator last, -- -2.34.1 +2.39.5 (Apple Git-154) From 18b561ee8ab60e341ce150c4887f1b3fd4c23e00 Mon Sep 17 00:00:00 2001 From: VladiKrapp-Arm Date: Thu, 10 Oct 2024 11:59:49 +0100 Subject: [PATCH 057/138] [CMake] Fix default install directory (#529) The mechanism for setting the default installation directory to /install is highly dependent on the order of events in the CMakeLists.txt file. Due to recent shifts in the file this has stopped working. The CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT check must happen immediately after the first invocation of project(...). When the llvm-project directory is included first, it is calling project() and then sets the CMAKE_INSTALL_PREFIX to the system default. --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e89f7ad..e1593ec6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,18 +332,24 @@ if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? FetchContent_MakeAvailable(${LLVM_TOOLCHAIN_C_LIBRARY}) endif() +################################################################################################## +# We set all project properties later, this call is just to enable the +# CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT check +project(LLVMEmbeddedToolchainForArm) # We generally want to install to a local directory to see what the # output will look like rather than install into the system, so change # the default accordingly. # See https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.html -# Note that this code only works after the first call to project so it -# can't be moved after the add_subdirectory command below. +# Note that THIS CODE ONLY WORKS AFTER THE FIRST CALL TO PROJECT so it +# can't be moved after the add_subdirectory() command below as it will be too late - +# the llvm project will set it to the default system install directory. if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE ) endif() +################################################################################################## # Whether to try to build C++ libraries. (We can't currently do this # for all choices of C library.) From e823c64b7c786969f8091b8486eac409861c42ef Mon Sep 17 00:00:00 2001 From: David Candler Date: Fri, 11 Oct 2024 13:31:39 +0100 Subject: [PATCH 058/138] Set output names for libcxx shared libraries Although building shared libraries is not enabled, CMake still creates targets for them, and implicitly changes them to static. In order to prevent this duplication of library targets, this patch explicitly sets the output names for shared libraries to something different. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1593ec6..bac3a885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1249,6 +1249,7 @@ function( -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_TEST_PARAMS=executor=${test_executor} + -DLIBCXXABI_SHARED_OUTPUT_NAME="c++abi-shared" -DLIBCXX_ABI_UNSTABLE=ON -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON @@ -1257,12 +1258,14 @@ function( -DLIBCXX_ENABLE_STATIC=ON -DLIBCXX_INCLUDE_BENCHMARKS=OFF -DLIBCXX_TEST_PARAMS=executor=${test_executor} + -DLIBCXX_SHARED_OUTPUT_NAME="c++-shared" -DLIBUNWIND_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_STATIC=ON -DLIBUNWIND_IS_BAREMETAL=ON -DLIBUNWIND_REMEMBER_HEAP_ALLOC=ON -DLIBUNWIND_USE_COMPILER_RT=ON -DLIBUNWIND_TEST_PARAMS=executor=${test_executor} + -DLIBUNWIND_SHARED_OUTPUT_NAME="unwind-shared" -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} -DLLVM_ENABLE_RUNTIMES=libcxxabi,libcxx,libunwind -DRUNTIME_TEST_ARCH_FLAGS=${flags} From b9efd0b2c6c8087066dcfac0befe47206d93fdd5 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Mon, 14 Oct 2024 14:22:23 +0200 Subject: [PATCH 059/138] Fix library variants for v7-R soft-float ABI (#532) We currently build these two library variants for v7-R with the soft-float ABI: * armv7r_soft_nofp * armv7r_soft_vfpv3_d16 The first variant can only be used when the target does not have an FPU, because it does not include bootcode to enable the FPU. This means that we don't have any library variants which can be selected for the single-precision-only FPUs when using the soft-float ABI. For the hard-float ABI, we solve this by having separate library variants for vfpv3xd (SP-only) and vfpv3_d16 (SP+DP). This is important for performance, as it allows the math library to use DP instructions where available. We could do the same thing for the soft-float libraries, however these variants with an FPU are included for completeness, their performance is less important because a user interested in performance would use the hard-float ABI. Thesefore I think we should only include the variant for the minimal FPU, which is vfpv3xd. These libraries are also used for v8-R AArch32, where this change is important because -march=armv8-r implies -mfpu=fpv5-sp-d16 by default, which currently fails to find a library. --- CMakeLists.txt | 6 +++--- test/multilib/armv7r.test | 2 +- test/multilib/armv8r.test | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bac3a885..eaf4fd23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1777,9 +1777,9 @@ add_library_variants_for_cpu( ) add_library_variants_for_cpu( armv7r - SUFFIX soft_vfpv3_d16 - COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3-d16" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabi -mfpu=vfpv3-d16" + SUFFIX soft_vfpv3xd + COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd" + MULTILIB_FLAGS "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd" PICOLIBC_BUILD_TYPE "release" QEMU_MACHINE "none" QEMU_CPU "cortex-r5f" diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index a529b544..7a4e4e3e 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -13,7 +13,7 @@ # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3_d16_exn_rtti{{$}} +# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti{{$}} # SOFT-VFPV3-EMPTY: # RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3XD %s diff --git a/test/multilib/armv8r.test b/test/multilib/armv8r.test index f5a4bb83..0fefb486 100644 --- a/test/multilib/armv8r.test +++ b/test/multilib/armv8r.test @@ -6,6 +6,16 @@ # CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: +# RUN: %clang -print-multi-directory --target=armv8r-none-eabi | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -mfloat-abi=softfp -march=armv8-r | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -marm | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -mthumb | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -mfpu=fpv5-d16 | FileCheck --check-prefix=SOFT-VFPV3 %s +# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti{{$}} +# SOFT-VFPV3-EMPTY: + # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3 %s @@ -18,5 +28,16 @@ # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mcpu=cortex-r52 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv5-d16 | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fp-armv8 | FileCheck --check-prefix=VFPV3 %s # VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} # VFPV3-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv8r-none-eabihf | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -marm | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mthumb | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv5-sp-d16 | FileCheck --check-prefix=VFPV3XD %s +# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# VFPV3XD-EMPTY: From 7803d04e0aa1166bfbcc576599c5252fbac53ce6 Mon Sep 17 00:00:00 2001 From: dcandler <56445371+dcandler@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:32:55 +0100 Subject: [PATCH 060/138] Add additional patch folder for performance patches (#518) This adds a second llvm-project patch directory, intended for performance enhancement patches which can be kept optional to avoid blocking builds if they become out of date with the main branch. A new CMake option controls whether or not to apply the patches, and a new script is included to manage the patching process to make it easier to identify when there is a problem with a patch. --- CMakeLists.txt | 24 ++-- cmake/patch_llvm.py | 134 ++++++++++++++++++ docs/building-from-source.md | 9 ++ .../0000-Placeholder-commit.patch | 22 +++ 4 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 cmake/patch_llvm.py create mode 100644 patches/llvm-project-perf/0000-Placeholder-commit.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index eaf4fd23..f0a31de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,6 +134,11 @@ option( the tools every time you update llvm-project." ON ) +option( + APPLY_LLVM_PERFORMANCE_PATCHES + "During checkout, apply optional downstream patches to + llvm-project to improve performance." +) set( FVP_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fvp/install" CACHE STRING @@ -280,24 +285,17 @@ if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? read_repo_version(${LLVM_TOOLCHAIN_C_LIBRARY} ${LLVM_TOOLCHAIN_C_LIBRARY}) endif() -# The patches are generated from custom branch, with followin command: -# git format-patch -k origin/main -# The patches apply cleanly against llvm-project commit -# 327124ece7d59de56ca0f9faa2cd82af68c011b9. -set( - llvm_project_patches - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-libc-tests-with-picolibc-xfail-one-remaining-test.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-mark-two-more-large-tests.patch -) +set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project) +if(APPLY_LLVM_PERFORMANCE_PATCHES) + set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project-perf) +endif() + FetchContent_Declare(llvmproject GIT_REPOSITORY https://github.com/llvm/llvm-project.git GIT_TAG "${llvmproject_TAG}" GIT_SHALLOW "${llvmproject_SHALLOW}" GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git am -k --ignore-whitespace --3way ${llvm_project_patches} + PATCH_COMMAND ${LLVM_PATCH_COMMAND} # Add the llvm subdirectory later to ensure that # LLVMEmbeddedToolchainForArm is the first project declared. # Otherwise CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT diff --git a/cmake/patch_llvm.py b/cmake/patch_llvm.py new file mode 100644 index 00000000..85bf535b --- /dev/null +++ b/cmake/patch_llvm.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 + +""" +Script to apply a set of patches to llvm-project sources. +""" + +import argparse +import os +import pathlib +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "patchdir", + help="Set of patches to apply. This should be a directory containing one or more ordered *.patch files.", + ) + parser.add_argument( + "--llvm_dir", + help="Directory of the llvm-project git checkout, if not the current directory.", + ) + parser.add_argument( + "--method", + choices=["am", "apply"], + default="apply", + help="Git command to use. git am will add each patch as a commit, whereas git apply will leave patched changes staged.", + ) + parser.add_argument( + "--reset", + help="Clean and hard reset the repo to a specified commit before patching.", + ) + parser.add_argument( + "--restore_on_fail", + action="store_true", + help="If a patch in a series cannot be applied, restore the original state instead of leaving patches missing. Return code will be 2 instead of 1.", + ) + args = parser.parse_args() + + if args.llvm_dir: + git_cmd = ["git", "-C", args.llvm_dir] + else: + git_cmd = ["git"] + + if args.reset: + reset_args = git_cmd + ["reset", "--quiet", "--hard", args.reset] + subprocess.check_output(reset_args) + clean_args = git_cmd + ["clean", "--quiet", "--force", "-dx", args.reset] + subprocess.check_output(clean_args) + + abs_patch_dir = os.path.abspath(args.patchdir) + patch_list = list(pathlib.Path(abs_patch_dir).glob("*.patch")) + patch_list.sort() + + print(f"Found {len(patch_list)} patches to apply:") + print("\n".join(p.name for p in patch_list)) + + if args.method == "am": + merge_args = git_cmd + ["am", "-k", "--ignore-whitespace", "--3way"] + for patch in patch_list: + merge_args.append(str(patch)) + p = subprocess.run(merge_args, capture_output=True, text=True) + print(p.stdout) + print(p.stderr) + + if p.returncode == 0: + print(f"All patches applied.") + sys.exit(0) + if args.restore_on_fail: + # Check that the operation can be aborted. + # git am doesn't give any specific return codes, + # so check for unresolved working files. + rebase_apply_path = os.path.join(".git", "rebase-apply") + if args.llvm_dir: + rebase_apply_path = os.path.join(args.llvm_dir, rebase_apply_path) + if os.path.isdir(rebase_apply_path): + print("Aborting git am...") + subprocess.run(git_cmd + ["am", "--abort"], check=True) + print(f"Abort successful.") + sys.exit(2) + else: + print("Unable to abort.") + sys.exit(1) + else: + applied_patches = [] + for current_patch in patch_list: + print(f"Checking {current_patch.name}...") + # Check that the patch applies before trying to apply it. + apply_check_args = git_cmd + [ + "apply", + "--ignore-whitespace", + "--3way", + "--check", + str(current_patch), + ] + p_check = subprocess.run(apply_check_args) + + if p_check.returncode == 0: + # Patch will apply. + print(f"Applying {current_patch.name}...") + apply_args = git_cmd + [ + "apply", + "--ignore-whitespace", + "--3way", + str(current_patch), + ] + apply_args = subprocess.run(apply_args, check=True) + applied_patches.append(current_patch) + else: + # Patch won't apply. + print(f"Unable to apply {current_patch.name}") + if args.restore_on_fail: + # Remove any patches that have already been applied. + while len(applied_patches) > 0: + previous_patch = applied_patches.pop() + print(f"Reversing {previous_patch.name}...") + reverse_args = git_cmd + [ + "apply", + "--ignore-whitespace", + "--3way", + "--reverse", + str(previous_patch), + ] + p_check = subprocess.run(reverse_args, check=True) + print( + f"Rollback successful, failure occured on {current_patch.name}" + ) + sys.exit(2) + sys.exit(1) + print(f"All patches applied.") + + +main() diff --git a/docs/building-from-source.md b/docs/building-from-source.md index f62fac50..823d2ab7 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -148,3 +148,12 @@ The same build directory can be used for both native and MinGW toolchains. See [patches](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/tree/main/patches) directory for the current set of differences from upstream. + +The patches for llvm-project are split between two folders, llvm-project and +llvm-project-perf. The former are generally required for building and +successfully running all tests. The patches in llvm-project-perf are optional, +and designed to improve performance in certain circumstances. + +To reduce divergence from upstream and potential patch conflicts, the +performance patches are not applied by default, but can be enabled for an +automatic checkout with the APPLY_LLVM_PERFORMANCE_PATCHES option. diff --git a/patches/llvm-project-perf/0000-Placeholder-commit.patch b/patches/llvm-project-perf/0000-Placeholder-commit.patch new file mode 100644 index 00000000..ff8059cb --- /dev/null +++ b/patches/llvm-project-perf/0000-Placeholder-commit.patch @@ -0,0 +1,22 @@ +From e79697a54cba9bfc1a755ed048e42054d679de61 Mon Sep 17 00:00:00 2001 +From: David Candler +Date: Wed, 2 Oct 2024 14:13:31 +0100 +Subject: [PATCH] Placeholder commit + +--- + .gitignore | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.gitignore b/.gitignore +index 0e7c6c790013..dfa0b8da0ccd 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,4 +1,4 @@ +-#==============================================================================# ++#==============================================================================# + # This file specifies intentionally untracked files that git should ignore. + # See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html + # +-- +2.34.1 + From 52afaf0ecd19353ec4413f743c0bf62c400bb0c9 Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Mon, 14 Oct 2024 12:41:52 +0100 Subject: [PATCH 061/138] Add -enable-dfa-jump-thread to Omax.cfg This optimization sees some good improvements and the downstream equivalent is enabled for -Omax on Arm Compiler 6. --- Omax.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/Omax.cfg b/Omax.cfg index 7cf623bf..68916319 100644 --- a/Omax.cfg +++ b/Omax.cfg @@ -5,3 +5,4 @@ -mllvm -unroll-max-iteration-count-to-analyze=20 \ -mllvm -lsr-complexity-limit=1073741823 \ -mllvm -force-attribute=main:norecurse \ +-mllvm -enable-dfa-jump-thread \ From f9604677d8cb6625425c14b30ff3c2932e70b5d9 Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Tue, 15 Oct 2024 10:27:28 +0100 Subject: [PATCH 062/138] Disable assertions for libunwind (#534) When building the embedded toolchain, we currently disable assertions for libcxxabi, but assertions for libunwind are still enabled. This causes some of the logging functionality from libunwind to be included in the build, which in turn imposes a dependency on IO functionality that might not be available on baremetal environemnts. This patch disables assertions for libunwind using the `-DLIBUNWIND_ENABLE_ASSERTIONS=OFF` option, removing the issue. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0a31de7..cc7bcb5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1257,6 +1257,7 @@ function( -DLIBCXX_INCLUDE_BENCHMARKS=OFF -DLIBCXX_TEST_PARAMS=executor=${test_executor} -DLIBCXX_SHARED_OUTPUT_NAME="c++-shared" + -DLIBUNWIND_ENABLE_ASSERTIONS=OFF -DLIBUNWIND_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_STATIC=ON -DLIBUNWIND_IS_BAREMETAL=ON From 557d79432e6b3410e8894e8ea6389b033873d4c4 Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Tue, 15 Oct 2024 11:31:17 +0100 Subject: [PATCH 063/138] Add Loop Flatten and Unroll and Jam optimizations to Omax cfg These optimizations see some good improvements and the downstream equivalents are enabled for -Omax on Arm Compiler 6. --- Omax.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Omax.cfg b/Omax.cfg index 68916319..6918418c 100644 --- a/Omax.cfg +++ b/Omax.cfg @@ -6,3 +6,5 @@ -mllvm -lsr-complexity-limit=1073741823 \ -mllvm -force-attribute=main:norecurse \ -mllvm -enable-dfa-jump-thread \ +-mllvm -enable-loop-flatten \ +-mllvm -enable-unroll-and-jam \ From 41e8b9f6515214ccd955cb6df9e48ba092a3f84b Mon Sep 17 00:00:00 2001 From: VladiKrapp-Arm Date: Wed, 16 Oct 2024 11:16:39 +0100 Subject: [PATCH 064/138] [Pipelines] Additional unrolling in LTO (#536) Some workloads require specific sequences of events to happen to fully simplify. This adds an extra full unrolling pass to help these cases on the cores with branch predictors. It helps produce simplified loops, which can then be SROA'd allowing further simplification, which can be important for performance. The feature adds extra compile time to get extra performance and is enabled by the opt flag 'extra-LTO-loop-unroll' (off by default). Original patch by David Green (david.green@arm.com) --- OmaxLTO.cfg | 3 +- README.md | 1 + docs/optimization-flags.md | 9 +++ .../0000-Placeholder-commit.patch | 22 -------- .../0001-LTOpasses-add-loop-unroll.patch | 55 +++++++++++++++++++ 5 files changed, 67 insertions(+), 23 deletions(-) create mode 100644 docs/optimization-flags.md delete mode 100644 patches/llvm-project-perf/0000-Placeholder-commit.patch create mode 100644 patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch diff --git a/OmaxLTO.cfg b/OmaxLTO.cfg index 5c029b91..f7a11a59 100644 --- a/OmaxLTO.cfg +++ b/OmaxLTO.cfg @@ -1,3 +1,4 @@ -flto=full \ -fvirtual-function-elimination \ --fwhole-program-vtables +-fwhole-program-vtables \ +-mllvm -extra-LTO-loop-unroll=true diff --git a/README.md b/README.md index 32e7afc1..ad7e865a 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,7 @@ and/or increased memory usage during linking. Some of the options in the config corresponding optimisation passes in the [LLVM project](https://github.com/llvm/llvm-project) to find out more. Users are also encouraged to create their own configs and tune their own flag parameters. +Information on LLVM Embedded Toolchain for Arm specific optimization flags is available in [Optimization Flags](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/blob/main/docs/optimization-flags.md) Binary releases of the LLVM Embedded Toolchain for Arm are based on release branches of the upstream LLVM Project, thus can safely be used with all tools diff --git a/docs/optimization-flags.md b/docs/optimization-flags.md new file mode 100644 index 00000000..f67f6412 --- /dev/null +++ b/docs/optimization-flags.md @@ -0,0 +1,9 @@ +Additional optimization flags +============================= + +## Additional loop unroll in the LTO pipeline +In some cases it is benefitial to perform an additional loop unroll pass so that extra information becomes available to later passes, e.g. SROA. +Use cases where this could be beneficial - multiple (N>=4) nested loops. + +### Usage: + -mllvm -extra-LTO-loop-unroll=true/false diff --git a/patches/llvm-project-perf/0000-Placeholder-commit.patch b/patches/llvm-project-perf/0000-Placeholder-commit.patch deleted file mode 100644 index ff8059cb..00000000 --- a/patches/llvm-project-perf/0000-Placeholder-commit.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e79697a54cba9bfc1a755ed048e42054d679de61 Mon Sep 17 00:00:00 2001 -From: David Candler -Date: Wed, 2 Oct 2024 14:13:31 +0100 -Subject: [PATCH] Placeholder commit - ---- - .gitignore | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/.gitignore b/.gitignore -index 0e7c6c790013..dfa0b8da0ccd 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,4 +1,4 @@ --#==============================================================================# -+#==============================================================================# - # This file specifies intentionally untracked files that git should ignore. - # See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html - # --- -2.34.1 - diff --git a/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch b/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch new file mode 100644 index 00000000..88c68109 --- /dev/null +++ b/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch @@ -0,0 +1,55 @@ +From 4adfc5231d2c0182d6278b4aa75eec57648e5dd4 Mon Sep 17 00:00:00 2001 +From: Vladi Krapp +Date: Tue, 3 Sep 2024 14:12:48 +0100 +Subject: [Pipelines] Additional unrolling in LTO + +Some workloads require specific sequences of events to happen +to fully simplify. This adds an extra full unrolling pass to help these +cases on the cores with branch predictors. It helps produce simplified +loops, which can then be SROA'd allowing further simplification, which +can be important for performance. +Feature adds extra compile time to get extra performance and +is enabled by the opt flag 'extra-LTO-loop-unroll' (off by default). + +Original patch by David Green (david.green@arm.com) +--- + llvm/lib/Passes/PassBuilderPipelines.cpp | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp +index 1184123c7710..6dc45d85927a 100644 +--- a/llvm/lib/Passes/PassBuilderPipelines.cpp ++++ b/llvm/lib/Passes/PassBuilderPipelines.cpp +@@ -332,6 +332,10 @@ namespace llvm { + extern cl::opt MaxDevirtIterations; + } // namespace llvm + ++static cl::opt LTOExtraLoopUnroll( ++ "extra-LTO-loop-unroll", cl::init(false), cl::Hidden, ++ cl::desc("Perform extra loop unrolling pass to assist SROA")); ++ + void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM, + OptimizationLevel Level) { + for (auto &C : PeepholeEPCallbacks) +@@ -1940,6 +1944,18 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, + MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass())); + + FunctionPassManager FPM; ++ ++ if (LTOExtraLoopUnroll) { ++ LoopPassManager OmaxLPM; ++ OmaxLPM.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(), ++ /* OnlyWhenForced= */ !PTO.LoopUnrolling, ++ PTO.ForgetAllSCEVInLoopUnroll)); ++ FPM.addPass( ++ createFunctionToLoopPassAdaptor(std::move(OmaxLPM), ++ /*UseMemorySSA=*/false, ++ /*UseBlockFrequencyInfo=*/true)); ++ } ++ + // The IPO Passes may leave cruft around. Clean up after them. + FPM.addPass(InstCombinePass()); + invokePeepholeEPCallbacks(FPM, Level); +-- +2.34.1 + From 8b733dd67d92b581ece5a69c0e436b30c00e2514 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 18 Oct 2024 13:02:43 +0100 Subject: [PATCH 065/138] Add LLVM libc sample (#538) This will be built into the LLVM libc overlay package. Sample installs to samples/src/llvmlibc/baremetal-semihosting. * Add llvmlibc-samples directory to contain LLVM libc specific samples. * Add single baremetal-semihosting sample using LLVM libc. Sample contains a number of calls to LLVM libc functionality: * heap. * printf. * string library. * math library. A special linker script is used to set the bounds of the heap. This uses different linker defined symbols to picolibc. The crt0.S from the existing llvmlibc-support can't be used directly as the RW and ZI from the linker script need initializing. --- CMakeLists.txt | 6 + docs/llvmlibc.md | 9 + .../llvmlibc/baremetal-semihosting/Makefile | 37 +++ .../baremetal-semihosting/crt0llvmlibc.c | 41 +++ .../llvmlibc/baremetal-semihosting/hello.c | 46 ++++ .../microbit-llvmlibc.ld | 241 ++++++++++++++++++ .../llvmlibc/baremetal-semihosting/vector.c | 56 ++++ 7 files changed, 436 insertions(+) create mode 100644 llvmlibc-samples/src/llvmlibc/baremetal-semihosting/Makefile create mode 100644 llvmlibc-samples/src/llvmlibc/baremetal-semihosting/crt0llvmlibc.c create mode 100644 llvmlibc-samples/src/llvmlibc/baremetal-semihosting/hello.c create mode 100644 llvmlibc-samples/src/llvmlibc/baremetal-semihosting/microbit-llvmlibc.ld create mode 100644 llvmlibc-samples/src/llvmlibc/baremetal-semihosting/vector.c diff --git a/CMakeLists.txt b/CMakeLists.txt index cc7bcb5a..60ec6c68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,6 +378,12 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) COMPONENT llvm-toolchain-llvmlibc-configs ) + install( + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc-samples/src + DESTINATION samples + COMPONENT llvm-toolchain-llvmlibc-configs + ) # We aren't yet able to build C++ libraries to go with llvm-libc set(CXX_LIBS OFF) diff --git a/docs/llvmlibc.md b/docs/llvmlibc.md index f09ec028..d793b350 100644 --- a/docs/llvmlibc.md +++ b/docs/llvmlibc.md @@ -54,12 +54,21 @@ following command line options, in addition to `--target`, `-march` or `__llvm_libc_heap_limit` in addition to whatever other memory layout you want. +* LLVM libc does not define errno. If you are using a function that + sets errno then you must implement the function `int *__llvm_libc_errno()` + that returns the address of your definition of errno. + For example: ``` clang --config=llvmlibc.cfg --target=arm-none-eabi -march=armv7m -o hello hello.c -lsemihost -lcrt0 -Wl,--defsym=__stack=0x200000 ``` +## Samples + +The overlay package installs a llvmlibc directory in the samples/src +directory containing sample programs that use LLVM libc. + ## Limitations of LLVM libc in LLVM Embedded Toolchain for Arm At present, this toolchain does not build any C++ libraries to go with diff --git a/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/Makefile b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/Makefile new file mode 100644 index 00000000..2197d30a --- /dev/null +++ b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (c) 2020-2024, Arm Limited and affiliates. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include ../../../Makefile.conf + +build: hello.elf + +hello.elf: *.c + ../$(BIN_PATH)/clang --config=llvmlibc.cfg $(MICROBIT_TARGET) -nostartfiles -lsemihost -g -fno-exceptions -fno-rtti -T microbit-llvmlibc.ld -o hello.elf $^ + +%.hex: %.elf + ../$(BIN_PATH)/llvm-objcopy -O ihex $< $@ + +run: hello.hex + qemu-system-arm -M microbit -semihosting -nographic -device loader,file=$< + +debug: hello.hex + qemu-system-arm -M microbit -semihosting -nographic -device loader,file=$< -s -S + +clean: + rm -f *.elf *.hex + +.PHONY: clean run debug diff --git a/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/crt0llvmlibc.c b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/crt0llvmlibc.c new file mode 100644 index 00000000..28c3fb01 --- /dev/null +++ b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/crt0llvmlibc.c @@ -0,0 +1,41 @@ +// Copyright (c) 2024, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include + +extern int main(int argc, char** argv); + +extern void _platform_init(); + +extern char __data_source[]; +extern char __data_start[]; +extern char __data_end[]; +extern char __data_size[]; +extern char __bss_start[]; +extern char __bss_end[]; +extern char __bss_size[]; +extern char __tls_base[]; +extern char __tdata_end[]; +extern char __tls_end[]; + +void _start(void) { + memcpy(__data_start, __data_source, (size_t) __data_size); + memset(__bss_start, 0, (size_t) __bss_size); + _platform_init(); + _Exit(main(0, NULL)); +} diff --git a/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/hello.c b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/hello.c new file mode 100644 index 00000000..65455d53 --- /dev/null +++ b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/hello.c @@ -0,0 +1,46 @@ +// Copyright (c) 2024, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include + +// Implementation of errno +int *__llvm_libc_errno() { + static int internal_err; + return &internal_err; +} + +// Example that uses heap, string and math library. + +int main(void) { + const char *hello_s = "hello "; + const char *world_s = "world"; + const size_t hello_s_len = strlen(hello_s); + const size_t world_s_len = strlen(world_s); + const size_t out_s_len = hello_s_len + world_s_len + 1; + char *out_s = (char*) malloc(out_s_len); + assert(out_s_len >= hello_s_len + 1); + strncpy(out_s, hello_s, hello_s_len + 1); + assert(out_s_len >= strlen(out_s) + world_s_len + 1); + strncat(out_s, world_s, world_s_len + 1); + // 2024-10-17 Embedded printf implementation does not currently + // support printing floating point numbers. + printf("%s %li\n", out_s, lround(400000 * atanf(1.0f))); + free(out_s); + return 0; +} diff --git a/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/microbit-llvmlibc.ld b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/microbit-llvmlibc.ld new file mode 100644 index 00000000..e74a19af --- /dev/null +++ b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/microbit-llvmlibc.ld @@ -0,0 +1,241 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright © 2019 Keith Packard + * Copyright (c) 2024, Arm Limited and affiliates. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Linker script adapted from picolibc linker script + * llvm-libc uses different linker defined symbols for heap placement. + */ + +/* Hard-coded for Cortex-M0 */ +MEMORY +{ + boot_flash (rx!w) : + ORIGIN = 0x00000000, + LENGTH = 0x3000 + flash (rx!w) : + ORIGIN = 0x3000, + LENGTH = 0x3d000 + ram (w!rx) : + ORIGIN = 0x20000000, + LENGTH = 0x4000 +} + +PHDRS +{ + text_boot_flash PT_LOAD; + text PT_LOAD; + ram_init PT_LOAD; + ram PT_LOAD; + tls PT_TLS; +} + +SECTIONS +{ + PROVIDE(__stack = ORIGIN(ram) + LENGTH(ram)); + + .boot_flash : { + KEEP (*(.vectors)) + } >boot_flash AT>boot_flash :text_boot_flash + + .text : { + + /* code */ + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.* .opd .opd.*) + PROVIDE (__start___lcxx_override = .); + *(__lcxx_override) + PROVIDE (__stop___lcxx_override = .); + *(.gnu.linkonce.t.*) + KEEP (*(.fini .fini.*)) + __text_end = .; + + PROVIDE (__etext = __text_end); + PROVIDE (_etext = __text_end); + PROVIDE (etext = __text_end); + + /* Need to pre-align so that the symbols come after padding */ + . = ALIGN(8); + + /* lists of constructors and destructors */ + PROVIDE_HIDDEN ( __preinit_array_start = . ); + KEEP (*(.preinit_array)) + PROVIDE_HIDDEN ( __preinit_array_end = . ); + + PROVIDE_HIDDEN ( __init_array_start = . ); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) + KEEP (*(.init_array .ctors)) + PROVIDE_HIDDEN ( __init_array_end = . ); + + PROVIDE_HIDDEN ( __fini_array_start = . ); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) + KEEP (*(.fini_array .dtors)) + PROVIDE_HIDDEN ( __fini_array_end = . ); + + } >flash AT>flash :text + + .rodata : { + + /* read-only data */ + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) + + *(.srodata.cst16) + *(.srodata.cst8) + *(.srodata.cst4) + *(.srodata.cst2) + *(.srodata .srodata.*) + + } >flash AT>flash :text + + .data.rel.ro : { + + /* data that needs relocating */ + *(.data.rel.ro .data.rel.ro.*) + + } >flash AT>flash :text + + + /* + * Needs to be in its own segment with the PLT entries first + * so that the linker will compute the offsets to those + * entries correctly. + */ + .got : { + *(.got.plt) + *(.got) + } >flash AT>flash :text + + .except_ordered : { + *(.gcc_except_table *.gcc_except_table.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >flash AT>flash :text + + .except_unordered : { + . = ALIGN(8); + + PROVIDE(__exidx_start = .); + *(.ARM.exidx*) + PROVIDE(__exidx_end = .); + } >flash AT>flash :text + + + .data : /* For ld.bfd: ALIGN_WITH_INPUT */ { + *(.data .data.*) + *(.gnu.linkonce.d.*) + + /* Need to pre-align so that the symbols come after padding */ + . = ALIGN(8); + + PROVIDE( __global_pointer$ = . + 0x800 ); + PROVIDE( _gp = . + 0x8000); + *(.sdata .sdata.* .sdata2.*) + *(.gnu.linkonce.s.*) + } >ram AT>flash :ram_init + PROVIDE(__data_start = ADDR(.data)); + PROVIDE(__data_source = LOADADDR(.data)); + + /* Thread local initialized data. This gets + * space allocated as it is expected to be placed + * in ram to be used as a template for TLS data blocks + * allocated at runtime. We're slightly abusing that + * by placing the data in flash where it will be copied + * into the allocate ram addresses by the existing + * data initialization code in crt0. + * BFD includes .tbss alignment when computing .tdata + * alignment, but for ld.lld we have to explicitly pad + * as it only guarantees usage as a TLS template works + * rather than supporting this use case. + */ + .tdata : ALIGN(__tls_align) /* For ld.bfd: ALIGN_WITH_INPUT */ { + *(.tdata .tdata.* .gnu.linkonce.td.*) + PROVIDE(__data_end = .); + PROVIDE(__tdata_end = .); + } >ram AT>flash :tls :ram_init + PROVIDE( __tls_base = ADDR(.tdata)); + PROVIDE( __tdata_start = ADDR(.tdata)); + PROVIDE( __tdata_source = LOADADDR(.tdata) ); + PROVIDE( __tdata_source_end = LOADADDR(.tdata) + SIZEOF(.tdata) ); + PROVIDE( __data_source_end = __tdata_source_end ); + PROVIDE( __tdata_size = SIZEOF(.tdata) ); + + PROVIDE( __edata = __data_end ); + PROVIDE( _edata = __data_end ); + PROVIDE( edata = __data_end ); + PROVIDE( __data_size = __data_end - __data_start ); + PROVIDE( __data_source_size = __data_source_end - __data_source ); + + .tbss (NOLOAD) : { + *(.tbss .tbss.* .gnu.linkonce.tb.*) + *(.tcommon) + PROVIDE( __tls_end = . ); + PROVIDE( __tbss_end = . ); + } >ram AT>ram :tls :ram + PROVIDE( __bss_start = ADDR(.tbss)); + PROVIDE( __tbss_start = ADDR(.tbss)); + PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); + PROVIDE( __tbss_size = SIZEOF(.tbss) ); + PROVIDE( __tls_size = __tls_end - __tls_base ); + PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); + PROVIDE( __tls_size_align = (__tls_size + __tls_align - 1) & ~(__tls_align - 1)); + PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) ); + PROVIDE( __arm64_tls_tcb_offset = MAX(16, __tls_align) ); + + .bss (NOLOAD) : { + *(.sbss*) + *(.gnu.linkonce.sb.*) + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + + /* Align the heap */ + . = ALIGN(8); + __bss_end = .; + } >ram AT>ram :ram + PROVIDE( __non_tls_bss_start = ADDR(.bss) ); + PROVIDE( __end = __bss_end ); + _end = __bss_end; + PROVIDE( end = __bss_end ); + PROVIDE( __bss_size = __bss_end - __bss_start ); + + /* Make the rest of memory available for heap storage + * LLVM libc denotes heap with [__end, __llvm_libc_heap_limit) + */ + PROVIDE (__llvm_libc_heap_limit = __stack - (DEFINED(__stack_size) ? __stack_size : 4K)); +} + +ASSERT( __data_size == __data_source_size, "ERROR: .data/.tdata flash size does not match RAM size"); + diff --git a/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/vector.c b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/vector.c new file mode 100644 index 00000000..9ac444f6 --- /dev/null +++ b/llvmlibc-samples/src/llvmlibc/baremetal-semihosting/vector.c @@ -0,0 +1,56 @@ +// Copyright (c) 2024, Arm Limited and affiliates. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include + +/* Adapted from https://developer.arm.com/documentation/107565/0101/Use-case-examples/Generic-Information/What-is-inside-a-program-image-/Vector-table */ + +extern void __llvm_libc_exit(); + +extern uint8_t __stack[]; + +extern void _start(void); + + +void NMI_Handler() {} +void HardFault_Handler() { __llvm_libc_exit(); } +void MemManage_Handler() { __llvm_libc_exit(); } +void BusFault_Handler() { __llvm_libc_exit(); } +void UsageFault_Handler() { __llvm_libc_exit(); } +void SVC_Handler() {} +void DebugMon_Handler() {} +void PendSV_Handler() {} +void SysTick_Handler() {} +typedef void(*VECTOR_TABLE_Type)(void); +const VECTOR_TABLE_Type __VECTOR_TABLE[496] __attribute__((section(".vectors"))) __attribute__((aligned(128))) = { + (VECTOR_TABLE_Type)__stack, /* Initial Stack Pointer */ + _start, /* Reset Handler */ + NMI_Handler, /* NMI Handler */ + HardFault_Handler, /* Hard Fault Handler */ + MemManage_Handler, /* MPU Fault Handler */ + BusFault_Handler, /* Bus Fault Handler */ + UsageFault_Handler, /* Usage Fault Handler */ + 0, /* Reserved */ + 0, /* Reserved */ + 0, /* Reserved */ + 0, /* Reserved */ + SVC_Handler, /* SVC Handler */ + DebugMon_Handler, /* Debug Monitor Handler */ + 0, /* Reserved */ + PendSV_Handler, /* PendSV Handler */ + SysTick_Handler, /* SysTick Handler */ + /* Unused */ +}; From d8d3fd2945a58a10b6e3d929380dd0b93f0b8e47 Mon Sep 17 00:00:00 2001 From: dcandler <56445371+dcandler@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:44:10 +0100 Subject: [PATCH 066/138] Update picolibc patch file (#541) Patch no longer cleanly applies, so this updates the diff. --- patches/picolibc.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/picolibc.patch b/patches/picolibc.patch index ba5b17a6..a77d8795 100644 --- a/patches/picolibc.patch +++ b/patches/picolibc.patch @@ -1,8 +1,8 @@ diff --git a/meson.build b/meson.build -index 0fdfa0412..8e679f166 100644 +index f90f5b818..2f8d63733 100644 --- a/meson.build +++ b/meson.build -@@ -1224,6 +1224,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') +@@ -1310,6 +1310,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') error('newlib-retargetable-locking and newlib-multithread must be set to the same value') endif @@ -22,13 +22,13 @@ index 0fdfa0412..8e679f166 100644 cc.has_argument('-fno-tree-loop-distribute-patterns'), description: 'Compiler flag to prevent detecting memcpy/memset patterns') diff --git a/picolibc.ld.in b/picolibc.ld.in -index b97ea3300..04b94f35c 100644 +index 7b63ba172..cda5e1e7e 100644 --- a/picolibc.ld.in +++ b/picolibc.ld.in @@ -68,6 +68,9 @@ SECTIONS - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.* .opd .opd.*) + *(.literal.unlikely .text.unlikely .literal.unlikely.* .text.unlikely.*) + *(.literal.startup .text.startup .literal.startup.* .text.startup.*) + *(.literal .text .literal.* .text.* .opd .opd.*) + PROVIDE (__start___lcxx_override = .); + *(__lcxx_override) + PROVIDE (__stop___lcxx_override = .); From 61da472fabc4a17d9e2c50641708b5abf339eae7 Mon Sep 17 00:00:00 2001 From: dcandler <56445371+dcandler@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:50:07 +0100 Subject: [PATCH 067/138] Remove armv4t/armv5t from check-all targets (#540) The picolibc, compiler-rt and libcxx tests for armv4t and armv5t variants currently hang until a timeout is reached. Rather than disable the tests, this patch removes them from the check-all targets. This allows the tests to still be run while investigating the issue, but does not interrupt overall testing of the toolchain. --- ...armv4t-armv5t-from-check-all-targets.patch | 60 +++++++++++++++++++ 0001-Update-picolibc-patch-file.patch | 46 ++++++++++++++ CMakeLists.txt | 26 ++++++-- 3 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 0001-Remove-armv4t-armv5t-from-check-all-targets.patch create mode 100644 0001-Update-picolibc-patch-file.patch diff --git a/0001-Remove-armv4t-armv5t-from-check-all-targets.patch b/0001-Remove-armv4t-armv5t-from-check-all-targets.patch new file mode 100644 index 00000000..fbc6857c --- /dev/null +++ b/0001-Remove-armv4t-armv5t-from-check-all-targets.patch @@ -0,0 +1,60 @@ +From 8e51f55289eef78b08edb845023c1a7c9c0191b5 Mon Sep 17 00:00:00 2001 +From: David Candler +Date: Wed, 23 Oct 2024 14:40:58 +0100 +Subject: [PATCH] Remove armv4t/armv5t from check-all targets + +The compiler-rt and libcxx tests for armv4t and armv5t variants +currently hang until a timeout is reached. Rather than disable the +tests, this patch removes them from the check-all targets. This +allows the tests to still be run while investigating the issue, but +does not interrupt overall testing of the toolchain. +--- + CMakeLists.txt | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 60ec6c6..fa5b462 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1310,7 +1310,11 @@ function(add_compiler_rt_tests variant) + ) + add_custom_target(check-compiler-rt-${variant}) + add_dependencies(check-compiler-rt-${variant} compiler_rt_${variant}-check-compiler-rt) +- add_dependencies(check-compiler-rt check-compiler-rt-${variant}) ++ # Do not add armv4 or armv5 tests to the check-all ++ # targets as they currently hang. ++ if(NOT VARIANT_COMPILE_FLAGS MATCHES "-march=armv4|5") ++ add_dependencies(check-compiler-rt check-compiler-rt-${variant}) ++ endif() + add_dependencies(check-llvm-toolchain-runtimes-${variant} check-compiler-rt-${variant}) + endfunction() + +@@ -1334,7 +1338,11 @@ function(add_libcxx_libcxxabi_libunwind_tests variant) + ) + add_custom_target(${check_target}-${variant_with_extensions}) + add_dependencies(${check_target}-${variant_with_extensions} ${target_name}-${check_target}) +- add_dependencies(${check_target} ${target_name}-${check_target}) ++ # Do not add armv4 or armv5 tests to the check-all ++ # targets as they currently hang. ++ if(NOT variant MATCHES "-march=armv4|5") ++ add_dependencies(${check_target} ${target_name}-${check_target}) ++ endif() + add_dependencies(check-llvm-toolchain-runtimes-${variant} ${check_target}-${variant_with_extensions}) + endforeach() + endfunction() +@@ -1499,7 +1507,11 @@ function(add_library_variant target_arch) + message("C++ runtime libraries tests disabled for ${variant}") + else() + add_custom_target(check-llvm-toolchain-runtimes-${variant}) +- add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) ++ # Do not add armv4 or armv5 tests to the check-all ++ # targets as they currently hang. ++ if(NOT VARIANT_COMPILE_FLAGS MATCHES "-march=armv4|5") ++ add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) ++ endif() + add_compiler_rt_tests("${variant}") + if(CXX_LIBS) + add_libcxx_libcxxabi_libunwind_tests("${variant}") +-- +2.34.1 + diff --git a/0001-Update-picolibc-patch-file.patch b/0001-Update-picolibc-patch-file.patch new file mode 100644 index 00000000..7a7c8c89 --- /dev/null +++ b/0001-Update-picolibc-patch-file.patch @@ -0,0 +1,46 @@ +From 2f9a405df7f3e211eab7bb44dcb3a5b3b88665d8 Mon Sep 17 00:00:00 2001 +From: David Candler +Date: Thu, 24 Oct 2024 10:07:57 +0100 +Subject: [PATCH] Update picolibc patch file + +Patch no longer cleanly applies, so this updates the diff. +--- + patches/picolibc.patch | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/patches/picolibc.patch b/patches/picolibc.patch +index ba5b17a..a77d879 100644 +--- a/patches/picolibc.patch ++++ b/patches/picolibc.patch +@@ -1,8 +1,8 @@ + diff --git a/meson.build b/meson.build +-index 0fdfa0412..8e679f166 100644 ++index f90f5b818..2f8d63733 100644 + --- a/meson.build + +++ b/meson.build +-@@ -1224,6 +1224,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') ++@@ -1310,6 +1310,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') + error('newlib-retargetable-locking and newlib-multithread must be set to the same value') + endif + +@@ -22,13 +22,13 @@ index 0fdfa0412..8e679f166 100644 + cc.has_argument('-fno-tree-loop-distribute-patterns'), + description: 'Compiler flag to prevent detecting memcpy/memset patterns') + diff --git a/picolibc.ld.in b/picolibc.ld.in +-index b97ea3300..04b94f35c 100644 ++index 7b63ba172..cda5e1e7e 100644 + --- a/picolibc.ld.in + +++ b/picolibc.ld.in + @@ -68,6 +68,9 @@ SECTIONS +- *(.text.unlikely .text.unlikely.*) +- *(.text.startup .text.startup.*) +- *(.text .text.* .opd .opd.*) ++ *(.literal.unlikely .text.unlikely .literal.unlikely.* .text.unlikely.*) ++ *(.literal.startup .text.startup .literal.startup.* .text.startup.*) ++ *(.literal .text .literal.* .text.* .opd .opd.*) + + PROVIDE (__start___lcxx_override = .); + + *(__lcxx_override) + + PROVIDE (__stop___lcxx_override = .); +-- +2.34.1 + diff --git a/CMakeLists.txt b/CMakeLists.txt index 60ec6c68..cefbcb35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -804,8 +804,12 @@ function( if(run_tests) add_custom_target(check-picolibc-${variant}) add_dependencies(check-picolibc-${variant} picolibc_${variant}-test) - add_dependencies(check-picolibc check-picolibc-${variant}) - add_dependencies(llvm-toolchain-runtimes picolibc_${variant}) + # Do not add armv4 or armv5 tests to the check-all + # targets as they currently hang. + if(NOT variant MATCHES "armv4|5") + add_dependencies(check-picolibc check-picolibc-${variant}) + add_dependencies(llvm-toolchain-runtimes picolibc_${variant}) + endif() endif() endfunction() @@ -1310,7 +1314,11 @@ function(add_compiler_rt_tests variant) ) add_custom_target(check-compiler-rt-${variant}) add_dependencies(check-compiler-rt-${variant} compiler_rt_${variant}-check-compiler-rt) - add_dependencies(check-compiler-rt check-compiler-rt-${variant}) + # Do not add armv4 or armv5 tests to the check-all + # targets as they currently hang. + if(NOT variant MATCHES "armv4|5") + add_dependencies(check-compiler-rt check-compiler-rt-${variant}) + endif() add_dependencies(check-llvm-toolchain-runtimes-${variant} check-compiler-rt-${variant}) endfunction() @@ -1334,7 +1342,11 @@ function(add_libcxx_libcxxabi_libunwind_tests variant) ) add_custom_target(${check_target}-${variant_with_extensions}) add_dependencies(${check_target}-${variant_with_extensions} ${target_name}-${check_target}) - add_dependencies(${check_target} ${target_name}-${check_target}) + # Do not add armv4 or armv5 tests to the check-all + # targets as they currently hang. + if(NOT variant MATCHES "armv4|5") + add_dependencies(${check_target} ${target_name}-${check_target}) + endif() add_dependencies(check-llvm-toolchain-runtimes-${variant} ${check_target}-${variant_with_extensions}) endforeach() endfunction() @@ -1499,7 +1511,11 @@ function(add_library_variant target_arch) message("C++ runtime libraries tests disabled for ${variant}") else() add_custom_target(check-llvm-toolchain-runtimes-${variant}) - add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) + # Do not add armv4 or armv5 tests to the check-all + # targets as they currently hang. + if(NOT variant MATCHES "armv4|5") + add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) + endif() add_compiler_rt_tests("${variant}") if(CXX_LIBS) add_libcxx_libcxxabi_libunwind_tests("${variant}") From 7bd8ccd40827d0359fb07436c3015a7e76ab7aaf Mon Sep 17 00:00:00 2001 From: dcandler <56445371+dcandler@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:14:19 +0100 Subject: [PATCH 068/138] Remove spurious patch files (#542) My last push included a couple of patch files in the root by mistake, which should be removed. The actual contents of these patches have already been applied now. --- ...armv4t-armv5t-from-check-all-targets.patch | 60 ------------------- 0001-Update-picolibc-patch-file.patch | 46 -------------- 2 files changed, 106 deletions(-) delete mode 100644 0001-Remove-armv4t-armv5t-from-check-all-targets.patch delete mode 100644 0001-Update-picolibc-patch-file.patch diff --git a/0001-Remove-armv4t-armv5t-from-check-all-targets.patch b/0001-Remove-armv4t-armv5t-from-check-all-targets.patch deleted file mode 100644 index fbc6857c..00000000 --- a/0001-Remove-armv4t-armv5t-from-check-all-targets.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 8e51f55289eef78b08edb845023c1a7c9c0191b5 Mon Sep 17 00:00:00 2001 -From: David Candler -Date: Wed, 23 Oct 2024 14:40:58 +0100 -Subject: [PATCH] Remove armv4t/armv5t from check-all targets - -The compiler-rt and libcxx tests for armv4t and armv5t variants -currently hang until a timeout is reached. Rather than disable the -tests, this patch removes them from the check-all targets. This -allows the tests to still be run while investigating the issue, but -does not interrupt overall testing of the toolchain. ---- - CMakeLists.txt | 18 +++++++++++++++--- - 1 file changed, 15 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 60ec6c6..fa5b462 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1310,7 +1310,11 @@ function(add_compiler_rt_tests variant) - ) - add_custom_target(check-compiler-rt-${variant}) - add_dependencies(check-compiler-rt-${variant} compiler_rt_${variant}-check-compiler-rt) -- add_dependencies(check-compiler-rt check-compiler-rt-${variant}) -+ # Do not add armv4 or armv5 tests to the check-all -+ # targets as they currently hang. -+ if(NOT VARIANT_COMPILE_FLAGS MATCHES "-march=armv4|5") -+ add_dependencies(check-compiler-rt check-compiler-rt-${variant}) -+ endif() - add_dependencies(check-llvm-toolchain-runtimes-${variant} check-compiler-rt-${variant}) - endfunction() - -@@ -1334,7 +1338,11 @@ function(add_libcxx_libcxxabi_libunwind_tests variant) - ) - add_custom_target(${check_target}-${variant_with_extensions}) - add_dependencies(${check_target}-${variant_with_extensions} ${target_name}-${check_target}) -- add_dependencies(${check_target} ${target_name}-${check_target}) -+ # Do not add armv4 or armv5 tests to the check-all -+ # targets as they currently hang. -+ if(NOT variant MATCHES "-march=armv4|5") -+ add_dependencies(${check_target} ${target_name}-${check_target}) -+ endif() - add_dependencies(check-llvm-toolchain-runtimes-${variant} ${check_target}-${variant_with_extensions}) - endforeach() - endfunction() -@@ -1499,7 +1507,11 @@ function(add_library_variant target_arch) - message("C++ runtime libraries tests disabled for ${variant}") - else() - add_custom_target(check-llvm-toolchain-runtimes-${variant}) -- add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) -+ # Do not add armv4 or armv5 tests to the check-all -+ # targets as they currently hang. -+ if(NOT VARIANT_COMPILE_FLAGS MATCHES "-march=armv4|5") -+ add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) -+ endif() - add_compiler_rt_tests("${variant}") - if(CXX_LIBS) - add_libcxx_libcxxabi_libunwind_tests("${variant}") --- -2.34.1 - diff --git a/0001-Update-picolibc-patch-file.patch b/0001-Update-picolibc-patch-file.patch deleted file mode 100644 index 7a7c8c89..00000000 --- a/0001-Update-picolibc-patch-file.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 2f9a405df7f3e211eab7bb44dcb3a5b3b88665d8 Mon Sep 17 00:00:00 2001 -From: David Candler -Date: Thu, 24 Oct 2024 10:07:57 +0100 -Subject: [PATCH] Update picolibc patch file - -Patch no longer cleanly applies, so this updates the diff. ---- - patches/picolibc.patch | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/patches/picolibc.patch b/patches/picolibc.patch -index ba5b17a..a77d879 100644 ---- a/patches/picolibc.patch -+++ b/patches/picolibc.patch -@@ -1,8 +1,8 @@ - diff --git a/meson.build b/meson.build --index 0fdfa0412..8e679f166 100644 -+index f90f5b818..2f8d63733 100644 - --- a/meson.build - +++ b/meson.build --@@ -1224,6 +1224,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') -+@@ -1310,6 +1310,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') - error('newlib-retargetable-locking and newlib-multithread must be set to the same value') - endif - -@@ -22,13 +22,13 @@ index 0fdfa0412..8e679f166 100644 - cc.has_argument('-fno-tree-loop-distribute-patterns'), - description: 'Compiler flag to prevent detecting memcpy/memset patterns') - diff --git a/picolibc.ld.in b/picolibc.ld.in --index b97ea3300..04b94f35c 100644 -+index 7b63ba172..cda5e1e7e 100644 - --- a/picolibc.ld.in - +++ b/picolibc.ld.in - @@ -68,6 +68,9 @@ SECTIONS -- *(.text.unlikely .text.unlikely.*) -- *(.text.startup .text.startup.*) -- *(.text .text.* .opd .opd.*) -+ *(.literal.unlikely .text.unlikely .literal.unlikely.* .text.unlikely.*) -+ *(.literal.startup .text.startup .literal.startup.* .text.startup.*) -+ *(.literal .text .literal.* .text.* .opd .opd.*) - + PROVIDE (__start___lcxx_override = .); - + *(__lcxx_override) - + PROVIDE (__stop___lcxx_override = .); --- -2.34.1 - From 5993037f9f3c87c11ac9ff1eed0117e39112a703 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 28 Oct 2024 11:31:25 +0000 Subject: [PATCH 069/138] Fix Python SyntaxWarning in two f-string literals. Building on Ubuntu 24.04, multilib-generate.py provokes some SyntaxWarning messages from Python 3.12, because of cases where we'd written `\+` in a string, intended to be emitted literally. 3.12 still _does_ emit it literally, but prints a warning pointing out that we should properly escape the backslash, writing it as `\\+`. --- multilib-generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multilib-generate.py b/multilib-generate.py index cc93bbfa..e0e05700 100755 --- a/multilib-generate.py +++ b/multilib-generate.py @@ -247,10 +247,10 @@ def generate_extensions(args): print("# original option to check that.") for feature in all_features: - print(f"- Match: -march=armv.*\\+{feature}($|\+.*)") + print(f"- Match: -march=armv.*\\+{feature}($|\\+.*)") print(f" Flags:") print(f" - -march=armvX+{feature}") - print(f"- Match: -march=armv.*\\+no{feature}($|\+.*)") + print(f"- Match: -march=armv.*\\+no{feature}($|\\+.*)") print(f" Flags:") print(f" - -march=armvX+no{feature}") print() From 4fbf4660e804a1d71a7e7c7bd9bdcc04390a1faa Mon Sep 17 00:00:00 2001 From: VladiKrapp-Arm Date: Mon, 28 Oct 2024 12:54:36 +0000 Subject: [PATCH 070/138] [OmaxLTO] Fix the flag to be supplied to the LTO plugin (#544) The flag to add the extra loop unroll pass was previously provided to opt and was not actually working, as it's supposed to be provided to the LTO plugin. --- OmaxLTO.cfg | 3 ++- docs/optimization-flags.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OmaxLTO.cfg b/OmaxLTO.cfg index f7a11a59..9d7b5208 100644 --- a/OmaxLTO.cfg +++ b/OmaxLTO.cfg @@ -1,4 +1,5 @@ -flto=full \ -fvirtual-function-elimination \ -fwhole-program-vtables \ --mllvm -extra-LTO-loop-unroll=true +-Wl,-plugin-opt=-extra-LTO-loop-unroll=true + diff --git a/docs/optimization-flags.md b/docs/optimization-flags.md index f67f6412..6739601d 100644 --- a/docs/optimization-flags.md +++ b/docs/optimization-flags.md @@ -6,4 +6,4 @@ In some cases it is benefitial to perform an additional loop unroll pass so that Use cases where this could be beneficial - multiple (N>=4) nested loops. ### Usage: - -mllvm -extra-LTO-loop-unroll=true/false + -Wl,-plugin-opt=-extra-LTO-loop-unroll=true/false From 4a2939ffb01814a190e0a0dc73268915b312252d Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Fri, 1 Nov 2024 09:12:00 +0000 Subject: [PATCH 071/138] [libcxx] Add downstream patch to enable `char8_t` related functions (#549) LLVM libcxx does not define the `char8_t` related functions, instead delegating their definitions to the underlying C library. libcxx defines a macro called `_LIBCPP_HAS_C8RTOMB_MBRTOC8` when it infers that the underlying C library provides these functions. picolibc provides the `char8_t` related functions regardless of the C++ version used, but this support only landed after version 1.8.8 and, at the time of writing, has not made into any released version yet. This is a temporary fix and should be removed when a picolibc release includes the support for `char8_t` and its related functions. When it's time to implement a proper solution, one needs to create logic to detect the picolibc version and define the macro accordingly. The macros that govern picolibc version are in `picolibc.h`. --- ...6-Define-_LIBCPP_HAS_C8RTOMB_MBRTOC8.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 patches/llvm-project/0006-Define-_LIBCPP_HAS_C8RTOMB_MBRTOC8.patch diff --git a/patches/llvm-project/0006-Define-_LIBCPP_HAS_C8RTOMB_MBRTOC8.patch b/patches/llvm-project/0006-Define-_LIBCPP_HAS_C8RTOMB_MBRTOC8.patch new file mode 100644 index 00000000..ac73bd5e --- /dev/null +++ b/patches/llvm-project/0006-Define-_LIBCPP_HAS_C8RTOMB_MBRTOC8.patch @@ -0,0 +1,55 @@ +From 9011c0e821d5b1563dc2dc6370f29c529e55f41f Mon Sep 17 00:00:00 2001 +From: Victor Campos +Date: Thu, 31 Oct 2024 09:58:34 +0000 +Subject: Define _LIBCPP_HAS_C8RTOMB_MBRTOC8 + +LLVM libcxx does not define the `char8_t` related functions, instead +delegating their definitions to the underlying C library. + +libcxx defines a macro called `_LIBCPP_HAS_C8RTOMB_MBRTOC8` when it +infers that the underlying C library provides these functions. + +picolibc provides the `char8_t` related functions regardless of the C++ +version used, but this support only landed after version 1.8.8 and, at +the time of writing, has not made into any released version yet. + +This is a temporary fix and should be removed when a picolibc release +includes the support for `char8_t` and its related functions. When it's +time to implement a proper solution, one needs to create logic to detect +the picolibc version and define the macro accordingly. The macros that +govern picolibc version are in `picolibc.h`. +--- + libcxx/include/__config | 17 ++--------------- + 1 file changed, 2 insertions(+), 15 deletions(-) + +diff --git a/libcxx/include/__config b/libcxx/include/__config +index 1cf80a46686a..615433869a4e 100644 +--- a/libcxx/include/__config ++++ b/libcxx/include/__config +@@ -1021,21 +1021,8 @@ typedef __char32_t char32_t; + // functions is gradually being added to existing C libraries. The conditions + // below check for known C library versions and conditions under which these + // functions are declared by the C library. +-// +-// GNU libc 2.36 and newer declare c8rtomb() and mbrtoc8() in C++ modes if +-// __cpp_char8_t is defined or if C2X extensions are enabled. Determining +-// the latter depends on internal GNU libc details that are not appropriate +-// to depend on here, so any declarations present when __cpp_char8_t is not +-// defined are ignored. +-# if defined(_LIBCPP_GLIBC_PREREQ) +-# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t) +-# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1 +-# else +-# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0 +-# endif +-# else +-# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0 +-# endif ++// For picolibc: ++#define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1 + + // There are a handful of public standard library types that are intended to + // support CTAD but don't need any explicit deduction guides to do so. This +-- +2.43.0 + From 11f7cf9d1bdfa0b1baabcf6b21ecbd6fb97891f8 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Fri, 1 Nov 2024 15:27:04 +0000 Subject: [PATCH 072/138] [libcxx] Remove xfails for char16_t (#551) picolibc added support for `char16_t` on trunk. However we can't yet remove the xfails in upstream because it firstly needs to pick up on a picolibc release that includes that support. This is a patch which must be upstreamed once llvm-project updates its picolibc version to one that has `char16_t` support. --- ...ails-due-to-picolibc-s-support-for-c.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 patches/llvm-project/0007-libcxx-Remove-xfails-due-to-picolibc-s-support-for-c.patch diff --git a/patches/llvm-project/0007-libcxx-Remove-xfails-due-to-picolibc-s-support-for-c.patch b/patches/llvm-project/0007-libcxx-Remove-xfails-due-to-picolibc-s-support-for-c.patch new file mode 100644 index 00000000..0929944a --- /dev/null +++ b/patches/llvm-project/0007-libcxx-Remove-xfails-due-to-picolibc-s-support-for-c.patch @@ -0,0 +1,47 @@ +From 2c6b08baa20bb4a7e4a936ecf286a1c9e1f0f8c9 Mon Sep 17 00:00:00 2001 +From: Victor Campos +Date: Thu, 31 Oct 2024 14:03:58 +0000 +Subject: [libcxx] Remove xfails due to picolibc's support for char16_t and + char32_t + +picolibc recently +([link](https://github.com/picolibc/picolibc/commit/f6f68758fe2aa62854f49b90c3daeeb08242b512)) +added support for char16_t and char32_t. + +These xfails aren't needed anymore. +--- + libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp | 3 --- + libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp | 3 --- + 2 files changed, 6 deletions(-) + +diff --git a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp +index a1560c8ee585..2b6455466681 100644 +--- a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp ++++ b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp +@@ -11,9 +11,6 @@ + // Apple platforms don't provide yet, so these tests fail. + // XFAIL: target={{.+}}-apple-{{.+}} + +-// mbrtoc16 not defined. +-// XFAIL: LIBCXX-PICOLIBC-FIXME +- + // + + #include +diff --git a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp +index 2076384deb2b..db00cbde3336 100644 +--- a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp ++++ b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp +@@ -11,9 +11,6 @@ + // Apple platforms don't provide yet, so these tests fail. + // XFAIL: target={{.+}}-apple-{{.+}} + +-// mbrtoc16 not defined. +-// XFAIL: LIBCXX-PICOLIBC-FIXME +- + // + + #include +-- +2.43.0 + From cd41a86a7594d7338cf18b69139b97841cbc483b Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Mon, 4 Nov 2024 10:06:42 +0000 Subject: [PATCH 073/138] Patch file for alternative MEMCPY LDM/STM inlining for Cortex m7 (#548) Performance improvements have been seen of around 1 to 2% on selected benchmarks when LD/ST inlining is preferred over LDM/STM for Cortex m7. This adds a patch file that enables this optimisation. --- ...ble-MEMCPY-LDM-STM-inlining-for-v7-m.patch | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch diff --git a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch new file mode 100644 index 00000000..38d3e2d8 --- /dev/null +++ b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch @@ -0,0 +1,217 @@ +From 61af6af10d10a08b81d3924fa5b35bfb548b2a05 Mon Sep 17 00:00:00 2001 +From: nasmnc01 +Author: Scott Douglass +Date: Tue, 13 Aug 2024 10:55:51 +0100 +Subject: [PATCH] [ARM][CodeGen] Prefer MEMCPY LDM/STM inlining for v7-m + +This patch changes the behaviour of memcpy inlining on v7m targets. +The old behaviour was to inline memcpys with LDM/STM instructions. +Alternatively, using LD/ST instructions for memcpy inlining allowed +for performance gains of 1% to 2% on selected benchmarks. + +Co-authored-by: Nashe Mncube +--- + llvm/lib/Target/ARM/ARMFeatures.td | 5 + + llvm/lib/Target/ARM/ARMProcessors.td | 2 +- + llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 121 ++++++++++++++ + llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + + llvm/lib/Target/ARM/ARMSubtarget.h | 2 + + llvm/test/CodeGen/ARM/memcpy-v7m.ll | 165 ++++++++++++++++++++ + 6 files changed, 300 insertions(+), 1 deletion(-) + create mode 100644 llvm/test/CodeGen/ARM/memcpy-v7m.ll + +diff --git a/llvm/lib/Target/ARM/ARMFeatures.td b/llvm/lib/Target/ARM/ARMFeatures.td +index bb437698296c..f7fa00aba424 100644 +--- a/llvm/lib/Target/ARM/ARMFeatures.td ++++ b/llvm/lib/Target/ARM/ARMFeatures.td +@@ -510,6 +510,11 @@ def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler", + "DisablePostRAScheduler", "true", + "Don't schedule again after register allocation">; + ++def FeatureUseInlineMemcpyAsLdSt : ++ SubtargetFeature<"use-inline-memcpy-ldst", "UseInlineMemcpyAsLdSt", ++ "true", "Use memcpy inlining as LD/ST instructions">; ++ ++ + // Armv8.5-A extensions + + // Has speculation barrier. +diff --git a/llvm/lib/Target/ARM/ARMProcessors.td b/llvm/lib/Target/ARM/ARMProcessors.td +index b94a5fc16146..ffb0c86bc687 100644 +--- a/llvm/lib/Target/ARM/ARMProcessors.td ++++ b/llvm/lib/Target/ARM/ARMProcessors.td +@@ -96,7 +96,7 @@ def ProcR52plus : SubtargetFeature<"r52plus", "ARMProcFamily", "CortexR52plus", + def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3", + "Cortex-M3 ARM processors", []>; + def ProcM7 : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7", +- "Cortex-M7 ARM processors", []>; ++ "Cortex-M7 ARM processors", [FeatureUseInlineMemcpyAsLdSt]>; + + //===----------------------------------------------------------------------===// + // ARM processors +diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +index c57825949c1c..12db2ab1fca2 100644 +--- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp ++++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +@@ -12,6 +12,7 @@ + + #include "ARMTargetMachine.h" + #include "ARMTargetTransformInfo.h" ++#include "llvm/ADT/SmallVector.h" + #include "llvm/CodeGen/SelectionDAG.h" + #include "llvm/IR/DerivedTypes.h" + #include "llvm/Support/CommandLine.h" +@@ -138,6 +139,122 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( + return CallResult.second; + } + ++SDValue ARMSelectionDAGInfo::EmitMemcpyAsLdSt( ++ SelectionDAG &DAG, SDLoc dl, const ARMSubtarget &Subtarget, SDValue Chain, ++ SDValue Dst, SDValue Src, uint64_t SizeVal, bool isVolatile, ++ MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const { ++ // Do repeated batches of 4-byte loads and stores. ++ unsigned BytesLeft = SizeVal & 3; ++ unsigned NumMemOps = SizeVal >> 2; ++ unsigned EmittedNumMemOps = 0; ++ EVT VT = MVT::i32; ++ unsigned VTSize = 4; ++ unsigned I = 0; ++ // Emit a maximum of 4 loads in Thumb1 since we have fewer registers ++ const unsigned MaxLoads = Subtarget.isThumb1Only() ? 4 : 6; ++ SmallVector TFOps(6); ++ SmallVector Loads(6); ++ uint64_t SrcOff = 0, DstOff = 0; ++ ++ MachineMemOperand::Flags MOFlags = MachineMemOperand::Flags::MONone; ++ if (isVolatile) ++ MOFlags = MachineMemOperand::Flags::MOVolatile; ++ MachineMemOperand::Flags LoadMOFlags = MOFlags; ++ if (SrcPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), ++ DAG.getDataLayout())) ++ LoadMOFlags |= MachineMemOperand::Flags::MODereferenceable; ++ if (auto *V = SrcPtrInfo.V.dyn_cast()) ++ if (isa(V) && cast(V)->isConstant()) ++ LoadMOFlags |= MachineMemOperand::Flags::MOInvariant; ++ MachineMemOperand::Flags StoreMOFlags = MOFlags; ++ if (DstPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), ++ DAG.getDataLayout())) ++ StoreMOFlags |= MachineMemOperand::Flags::MODereferenceable; ++ ++ // Emit up to MaxLoads loads, then a TokenFactor barrier, then the ++ // same number of stores. The loads and stores may get combined into ++ // ldm/stm later on. ++ while (EmittedNumMemOps < NumMemOps) { ++ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { ++ Loads[I] = DAG.getLoad(VT, dl, Chain, ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, ++ DAG.getConstant(SrcOff, dl, MVT::i32)), ++ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), ++ LoadMOFlags); ++ TFOps[I] = Loads[I].getValue(1); ++ SrcOff += VTSize; ++ } ++ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ++ ArrayRef(TFOps.data(), I)); ++ ++ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { ++ TFOps[I] = DAG.getStore( ++ Chain, dl, Loads[I], ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, ++ DAG.getConstant(DstOff, dl, MVT::i32)), ++ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), StoreMOFlags); ++ DstOff += VTSize; ++ } ++ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ++ ArrayRef(TFOps.data(), I)); ++ ++ EmittedNumMemOps += I; ++ } ++ ++ if (BytesLeft == 0) ++ return Chain; ++ ++ // Issue loads / stores for the trailing (1 - 3) bytes. ++ unsigned BytesLeftSave = BytesLeft; ++ I = 0; ++ while (BytesLeft) { ++ if (BytesLeft >= 2) { ++ VT = MVT::i16; ++ VTSize = 2; ++ } else { ++ VT = MVT::i8; ++ VTSize = 1; ++ } ++ ++ Loads[I] = DAG.getLoad(VT, dl, Chain, ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, ++ DAG.getConstant(SrcOff, dl, MVT::i32)), ++ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), ++ LoadMOFlags); ++ ++ TFOps[I] = Loads[I].getValue(1); ++ ++I; ++ SrcOff += VTSize; ++ BytesLeft -= VTSize; ++ } ++ Chain = ++ DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps.data(), I)); ++ ++ I = 0; ++ BytesLeft = BytesLeftSave; ++ while (BytesLeft) { ++ if (BytesLeft >= 2) { ++ VT = MVT::i16; ++ VTSize = 2; ++ } else { ++ VT = MVT::i8; ++ VTSize = 1; ++ } ++ ++ TFOps[I] = DAG.getStore(Chain, dl, Loads[I], ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, ++ DAG.getConstant(DstOff, dl, MVT::i32)), ++ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), ++ StoreMOFlags); ++ ++I; ++ DstOff += VTSize; ++ BytesLeft -= VTSize; ++ } ++ ++ return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ++ ArrayRef(TFOps.data(), I)); ++} ++ + static bool shouldGenerateInlineTPLoop(const ARMSubtarget &Subtarget, + const SelectionDAG &DAG, + ConstantSDNode *ConstantSize, +@@ -192,6 +309,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( + return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, + Alignment.value(), RTLIB::MEMCPY); + ++ if (Subtarget.UseInlineMemcpyAsLdSt) ++ return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, ++ isVolatile, DstPtrInfo, SrcPtrInfo); ++ + unsigned BytesLeft = SizeVal & 3; + unsigned NumMemOps = SizeVal >> 2; + unsigned EmittedNumMemOps = 0; +diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +index 275b1c0f8dc0..6ff422c15b12 100644 +--- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h ++++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +@@ -44,6 +44,12 @@ public: + MachinePointerInfo DstPtrInfo, + MachinePointerInfo SrcPtrInfo) const override; + ++ SDValue EmitMemcpyAsLdSt(SelectionDAG &DAG, SDLoc dl, ++ const ARMSubtarget &Subtarget, SDValue Chain, ++ SDValue Dst, SDValue Src, uint64_t SizeVal, ++ bool isVolatile, MachinePointerInfo DstPtrInfo, ++ MachinePointerInfo SrcPtrInfo) const; ++ + SDValue + EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, + SDValue Dst, SDValue Src, SDValue Size, +-- +2.34.1 + From fd4dcd54acd27d120c11e7bd115c4f8e8be0cb72 Mon Sep 17 00:00:00 2001 From: Rin Dobrescu Date: Mon, 4 Nov 2024 10:43:18 +0000 Subject: [PATCH 074/138] Add aarch64_sme_accessible to newlib patch (#547) To check for SME support, compiler-rt makes a call to __aarch64_sme_accessible(). It expects this symbol to be defined in newlib, which is currently incorrect. This patch extends newlib.patch to add the definition of __aarch64_sme_accessible. Co-authored-by: Rin Dobrescu --- patches/newlib.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/patches/newlib.patch b/patches/newlib.patch index 489aae31..f520a7fc 100644 --- a/patches/newlib.patch +++ b/patches/newlib.patch @@ -1,3 +1,20 @@ +diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c +index 7343cc61f..2c4b63c17 100644 +--- a/libgloss/aarch64/syscalls.c ++++ b/libgloss/aarch64/syscalls.c +@@ -172,6 +172,12 @@ newslot (void) + return i; + } + ++int __aarch64_sme_accessible() { ++ int result = 0; ++ asm volatile ( "mrs %x[result], id_aa64pfr1_el1" : [result]"=r"(result) : : ); ++ return (result & 0x3000000) != 0; ++} ++ + void + initialise_monitor_handles (void) + { diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu-init/rdimon-aem.S index 95b86e4d4..b91034ae6 100644 --- a/libgloss/arm/cpu-init/rdimon-aem.S From 4dab6f6367244d1d7ce17adf086c21c7296f7c39 Mon Sep 17 00:00:00 2001 From: VladiKrapp-Arm Date: Tue, 5 Nov 2024 10:58:37 +0000 Subject: [PATCH 075/138] [BuildFix] Add public subtarget property (#557) --- ...Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch index 38d3e2d8..a96896f5 100644 --- a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch +++ b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch @@ -188,7 +188,7 @@ index c57825949c1c..12db2ab1fca2 100644 return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, Alignment.value(), RTLIB::MEMCPY); -+ if (Subtarget.UseInlineMemcpyAsLdSt) ++ if (Subtarget.allowInlineMemcpyAsLdSt()) + return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, + isVolatile, DstPtrInfo, SrcPtrInfo); + @@ -212,6 +212,19 @@ index 275b1c0f8dc0..6ff422c15b12 100644 SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, +diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h +index 2f7af05a259f..0acf919b1360 100644 +--- a/llvm/lib/Target/ARM/ARMSubtarget.h ++++ b/llvm/lib/Target/ARM/ARMSubtarget.h +@@ -523,6 +523,8 @@ public: + bool ignoreCSRForAllocationOrder(const MachineFunction &MF, + unsigned PhysReg) const override; + unsigned getGPRAllocationOrder(const MachineFunction &MF) const; ++ ++ bool allowInlineMemcpyAsLdSt() const { return UseInlineMemcpyAsLdSt; } + }; + + } // end namespace llvm -- 2.34.1 From 034c76030ed9116d259e300bac7df016226d29a6 Mon Sep 17 00:00:00 2001 From: Vladi Krapp Date: Tue, 5 Nov 2024 12:21:40 +0000 Subject: [PATCH 076/138] [Target] Use autogenerated getter for property --- ...ble-MEMCPY-LDM-STM-inlining-for-v7-m.patch | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch index a96896f5..4cc98e1a 100644 --- a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch +++ b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch @@ -11,14 +11,6 @@ for performance gains of 1% to 2% on selected benchmarks. Co-authored-by: Nashe Mncube --- - llvm/lib/Target/ARM/ARMFeatures.td | 5 + - llvm/lib/Target/ARM/ARMProcessors.td | 2 +- - llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 121 ++++++++++++++ - llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + - llvm/lib/Target/ARM/ARMSubtarget.h | 2 + - llvm/test/CodeGen/ARM/memcpy-v7m.ll | 165 ++++++++++++++++++++ - 6 files changed, 300 insertions(+), 1 deletion(-) - create mode 100644 llvm/test/CodeGen/ARM/memcpy-v7m.ll diff --git a/llvm/lib/Target/ARM/ARMFeatures.td b/llvm/lib/Target/ARM/ARMFeatures.td index bb437698296c..f7fa00aba424 100644 @@ -188,7 +180,7 @@ index c57825949c1c..12db2ab1fca2 100644 return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, Alignment.value(), RTLIB::MEMCPY); -+ if (Subtarget.allowInlineMemcpyAsLdSt()) ++ if (Subtarget.useInlineMemcpyAsLdSt()) + return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, + isVolatile, DstPtrInfo, SrcPtrInfo); + @@ -212,19 +204,6 @@ index 275b1c0f8dc0..6ff422c15b12 100644 SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, -diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h -index 2f7af05a259f..0acf919b1360 100644 ---- a/llvm/lib/Target/ARM/ARMSubtarget.h -+++ b/llvm/lib/Target/ARM/ARMSubtarget.h -@@ -523,6 +523,8 @@ public: - bool ignoreCSRForAllocationOrder(const MachineFunction &MF, - unsigned PhysReg) const override; - unsigned getGPRAllocationOrder(const MachineFunction &MF) const; -+ -+ bool allowInlineMemcpyAsLdSt() const { return UseInlineMemcpyAsLdSt; } - }; - - } // end namespace llvm -- 2.34.1 From 9e00146b2f0eaff168cc66329b109826d443950b Mon Sep 17 00:00:00 2001 From: Vladi Krapp Date: Wed, 6 Nov 2024 13:02:05 +0000 Subject: [PATCH 077/138] [BuildFix] Fix patch file formatting --- ...ble-MEMCPY-LDM-STM-inlining-for-v7-m.patch | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch index 4cc98e1a..b25c6f9b 100644 --- a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch +++ b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch @@ -1,4 +1,4 @@ -From 61af6af10d10a08b81d3924fa5b35bfb548b2a05 Mon Sep 17 00:00:00 2001 +From 40f07cbde57022b25412cf1c9239755613500d86 Mon Sep 17 00:00:00 2001 From: nasmnc01 Author: Scott Douglass Date: Tue, 13 Aug 2024 10:55:51 +0100 @@ -11,6 +11,11 @@ for performance gains of 1% to 2% on selected benchmarks. Co-authored-by: Nashe Mncube --- + llvm/lib/Target/ARM/ARMFeatures.td | 5 + + llvm/lib/Target/ARM/ARMProcessors.td | 2 +- + llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 121 ++++++++++++++++++++ + llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + + 4 files changed, 133 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/ARM/ARMFeatures.td b/llvm/lib/Target/ARM/ARMFeatures.td index bb437698296c..f7fa00aba424 100644 @@ -19,14 +24,14 @@ index bb437698296c..f7fa00aba424 100644 @@ -510,6 +510,11 @@ def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler", "DisablePostRAScheduler", "true", "Don't schedule again after register allocation">; - + +def FeatureUseInlineMemcpyAsLdSt : + SubtargetFeature<"use-inline-memcpy-ldst", "UseInlineMemcpyAsLdSt", + "true", "Use memcpy inlining as LD/ST instructions">; + + // Armv8.5-A extensions - + // Has speculation barrier. diff --git a/llvm/lib/Target/ARM/ARMProcessors.td b/llvm/lib/Target/ARM/ARMProcessors.td index b94a5fc16146..ffb0c86bc687 100644 @@ -38,15 +43,15 @@ index b94a5fc16146..ffb0c86bc687 100644 def ProcM7 : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7", - "Cortex-M7 ARM processors", []>; + "Cortex-M7 ARM processors", [FeatureUseInlineMemcpyAsLdSt]>; - + //===----------------------------------------------------------------------===// // ARM processors diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp -index c57825949c1c..12db2ab1fca2 100644 +index c57825949c1c..63ae7a042886 100644 --- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp @@ -12,6 +12,7 @@ - + #include "ARMTargetMachine.h" #include "ARMTargetTransformInfo.h" +#include "llvm/ADT/SmallVector.h" @@ -56,7 +61,7 @@ index c57825949c1c..12db2ab1fca2 100644 @@ -138,6 +139,122 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( return CallResult.second; } - + +SDValue ARMSelectionDAGInfo::EmitMemcpyAsLdSt( + SelectionDAG &DAG, SDLoc dl, const ARMSubtarget &Subtarget, SDValue Chain, + SDValue Dst, SDValue Src, uint64_t SizeVal, bool isVolatile, @@ -179,7 +184,7 @@ index c57825949c1c..12db2ab1fca2 100644 @@ -192,6 +309,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, Alignment.value(), RTLIB::MEMCPY); - + + if (Subtarget.useInlineMemcpyAsLdSt()) + return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, + isVolatile, DstPtrInfo, SrcPtrInfo); @@ -194,7 +199,7 @@ index 275b1c0f8dc0..6ff422c15b12 100644 @@ -44,6 +44,12 @@ public: MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override; - + + SDValue EmitMemcpyAsLdSt(SelectionDAG &DAG, SDLoc dl, + const ARMSubtarget &Subtarget, SDValue Chain, + SDValue Dst, SDValue Src, uint64_t SizeVal, @@ -204,6 +209,6 @@ index 275b1c0f8dc0..6ff422c15b12 100644 SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, --- +-- 2.34.1 From 77002e716e6659149a3a539f9cb14d6e87a5d6a7 Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Wed, 6 Nov 2024 15:12:27 +0000 Subject: [PATCH 078/138] Add combinations of commands for which multi-lib is found successfully (#550) Add combinations of commands for which multi-lib is found successfully --------- Co-authored-by: Vrukesh V Panse --- .../aarch64_a_supported_variants.test | 35 + .../aarch64_r_supported_variants.test | 5 + test/multilib/arm_a_supported_variants.test | 1190 +++++++++++++++++ test/multilib/arm_m_supported_variants.test | 695 ++++++++++ test/multilib/arm_r_supported_variants.test | 169 +++ 5 files changed, 2094 insertions(+) create mode 100644 test/multilib/aarch64_a_supported_variants.test create mode 100644 test/multilib/aarch64_r_supported_variants.test create mode 100644 test/multilib/arm_a_supported_variants.test create mode 100644 test/multilib/arm_m_supported_variants.test create mode 100644 test/multilib/arm_r_supported_variants.test diff --git a/test/multilib/aarch64_a_supported_variants.test b/test/multilib/aarch64_a_supported_variants.test new file mode 100644 index 00000000..5e4563b1 --- /dev/null +++ b/test/multilib/aarch64_a_supported_variants.test @@ -0,0 +1,35 @@ +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.1-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.1-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.2-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.2-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.3-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.3-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.4-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.4-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.5-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.5-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.6-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.6-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.7-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.7-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.8-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.8-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.9-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8.9-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.1-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.1-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.2-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.2-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.3-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.3-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.4-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.4-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.5-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv9.5-a -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines + +# CHECK-NOT: error +# CHECK-NOT: warning diff --git a/test/multilib/aarch64_r_supported_variants.test b/test/multilib/aarch64_r_supported_variants.test new file mode 100644 index 00000000..61536747 --- /dev/null +++ b/test/multilib/aarch64_r_supported_variants.test @@ -0,0 +1,5 @@ +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8-r 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=aarch64-none-elf -march=armv8-r -mabi=aapcs-soft 2>&1 | FileCheck %s --match-full-lines + +# CHECK-NOT: error +# CHECK-NOT: warning diff --git a/test/multilib/arm_a_supported_variants.test b/test/multilib/arm_a_supported_variants.test new file mode 100644 index 00000000..bf7c4588 --- /dev/null +++ b/test/multilib/arm_a_supported_variants.test @@ -0,0 +1,1190 @@ +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.2-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.3-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.4-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.5-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.6-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.7-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.8-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.9-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.1-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.2-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.3-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.4-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv9.5-a -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines + +# CHECK-NOT: error +# CHECK-NOT: warning diff --git a/test/multilib/arm_m_supported_variants.test b/test/multilib/arm_m_supported_variants.test new file mode 100644 index 00000000..f086bd66 --- /dev/null +++ b/test/multilib/arm_m_supported_variants.test @@ -0,0 +1,695 @@ +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv6-m -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7e-m -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-m -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.base -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-m.main -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+fp16 -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+mve.fp -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8.1-m.main+lob -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines + +# CHECK-NOT: error +# CHECK-NOT: warning diff --git a/test/multilib/arm_r_supported_variants.test b/test/multilib/arm_r_supported_variants.test new file mode 100644 index 00000000..0d66a5b4 --- /dev/null +++ b/test/multilib/arm_r_supported_variants.test @@ -0,0 +1,169 @@ +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv7-r -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=hard -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv2 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=soft -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=none 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fpv4-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fpv5-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fpv5-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-sp-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fp-armv8-fullfp16-d16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=crypto-neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=neon 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=neon-fp-armv8 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=neon-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=neon-vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3-d16-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3xd 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv3xd-fp16 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv4 2>&1 | FileCheck %s --match-full-lines +# RUN: %clang -print-multi-flags-experimental -S -x c -v - '-###' --target=arm-none-eabi -march=armv8-r -mfloat-abi=softfp -mfpu=vfpv4-d16 2>&1 | FileCheck %s --match-full-lines + +# CHECK-NOT: error +# CHECK-NOT: warning From 6bc2011681c7c7514da398bdcf768ac18e9831ba Mon Sep 17 00:00:00 2001 From: simpal01 Date: Thu, 14 Nov 2024 13:44:13 +0000 Subject: [PATCH 079/138] Downstream patch to add bootcode for AArch64 FVPs #852 (#564) This patch: 1. Create new picolibc changes in downstream to add bootcode for AArch64 FVPs which is authored by: **Oliver Stannard**. The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a few ways which affect the crt0 code: * The memory map is different, so needs different page tables. * They boot up at EL3, instead of EL1, so we need to set the EL3 versions of the system registers. * Add option to build crt0 bootcode for different machines * Build new FVP variants of crt0, instead of replacing QEMU ones * Split assembly parts of AArch64 crt0 into a separate file * Make error checking target-specific And also this patch: 1. Split and group the related picolibc changes into single patch. 2. Do the necessary changes in the documentation to reflect these changes. --- CMakeLists.txt | 9 +- docs/building-from-source.md | 2 +- .../0001-Enable-libcxx-builds.patch} | 16 +- .../0002-Add-bootcode-for-AArch64-FVPs.patch | 870 ++++++++++++++++++ 4 files changed, 892 insertions(+), 5 deletions(-) rename patches/{picolibc.patch => picolibc/0001-Enable-libcxx-builds.patch} (74%) create mode 100644 patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index cefbcb35..6d1bebc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ # git -C repos clone https://github.com/llvm/llvm-project.git # git -C repos/llvm-project am -k $PWD/patches/llvm-project/*.patch # git -C repos clone https://github.com/picolibc/picolibc.git -# git -C repos/picolibc apply $PWD/patches/picolibc.patch +# git -C repos/picolibc apply $PWD/patches/picolibc/*.patch # mkdir build # cd build # cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc @@ -289,6 +289,11 @@ set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/p if(APPLY_LLVM_PERFORMANCE_PATCHES) set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project-perf) endif() +set( + picolibc_patches + ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0001-Enable-libcxx-builds.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch +) FetchContent_Declare(llvmproject GIT_REPOSITORY https://github.com/llvm/llvm-project.git @@ -308,7 +313,7 @@ FetchContent_Declare(picolibc GIT_TAG "${picolibc_TAG}" GIT_SHALLOW "${picolibc_SHALLOW}" GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc.patch + PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${picolibc_patches} # We only want to download the content, not configure it at this # stage. picolibc will be built in many configurations using # ExternalProject_Add using the sources that are checked out here. diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 823d2ab7..80c3366c 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -89,7 +89,7 @@ mkdir repos git -C repos clone https://github.com/llvm/llvm-project.git git -C repos/llvm-project am -k "$PWD"/patches/llvm-project/*.patch git -C repos clone https://github.com/picolibc/picolibc.git -git -C repos/picolibc apply "$PWD"/patches/picolibc.patch +git -C repos/picolibc apply "$PWD"/patches/picolibc/*.patch mkdir build cd build cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc diff --git a/patches/picolibc.patch b/patches/picolibc/0001-Enable-libcxx-builds.patch similarity index 74% rename from patches/picolibc.patch rename to patches/picolibc/0001-Enable-libcxx-builds.patch index a77d8795..4ff07a16 100644 --- a/patches/picolibc.patch +++ b/patches/picolibc/0001-Enable-libcxx-builds.patch @@ -1,8 +1,20 @@ +From 42f07bef7775a1387f9707e959f8b6782f9d6808 Mon Sep 17 00:00:00 2001 +From: Simi Pallipurath +Date: Thu, 14 Nov 2024 10:07:08 +0000 +Subject: [PATCH 1/2] [PATCH 1/2] Enable libcxx builds + +Modifications to build config and linker script required to enable +libc++ builds. +--- + meson.build | 12 ++++++++++++ + picolibc.ld.in | 3 +++ + 2 files changed, 15 insertions(+) + diff --git a/meson.build b/meson.build -index f90f5b818..2f8d63733 100644 +index 012d664bd..4161d6574 100644 --- a/meson.build +++ b/meson.build -@@ -1310,6 +1310,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') +@@ -1318,6 +1318,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') error('newlib-retargetable-locking and newlib-multithread must be set to the same value') endif diff --git a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch new file mode 100644 index 00000000..cde586a3 --- /dev/null +++ b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch @@ -0,0 +1,870 @@ +From f2ca20cebc85850a50b80424bb0f81c927edd04b Mon Sep 17 00:00:00 2001 +From: Simi Pallipurath +Date: Thu, 14 Nov 2024 10:12:33 +0000 +Subject: [PATCH 2/2] [PATCH 2/2] Add bootcode for AArch64 FVPs + +The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a +few ways which affect the crt0 code: + +* The memory map is different, so needs different page tables. +* They boot up at EL3, instead of EL1, so we need to set the EL3 versions of the system registers. +* Add option to build crt0 bootcode for different machines +* Build new FVP variants of crt0, instead of replacing QEMU ones +* Split assembly parts of AArch64 crt0 into a separate file +* Make error checking target-specific +--- + meson.build | 1 + + meson_options.txt | 3 + + picocrt/machine/aarch64/crt0.S | 200 +++++++++++++++++++ + picocrt/machine/aarch64/crt0.c | 198 +++---------------- + picocrt/machine/aarch64/meson.build | 9 +- + picocrt/meson.build | 296 ++++++++++++++++------------ + 6 files changed, 404 insertions(+), 303 deletions(-) + create mode 100644 picocrt/machine/aarch64/crt0.S + +diff --git a/meson.build b/meson.build +index 4161d6574..9d3f5c672 100644 +--- a/meson.build ++++ b/meson.build +@@ -151,6 +151,7 @@ multilib_exclude = get_option('multilib-exclude') + enable_picolib = get_option('picolib') + enable_picocrt = get_option('picocrt') + enable_picocrt_lib = get_option('picocrt-lib') ++test_machine = get_option('test-machine') + enable_semihost = get_option('semihost') + enable_tests = get_option('tests') + if get_option('tests-cdefs') == 'auto' +diff --git a/meson_options.txt b/meson_options.txt +index e0eacb443..766129ebd 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -132,6 +132,9 @@ option('test-stdin', type: 'boolean', value: false, + description: 'Enable tests that use stdin. This only works on a few targets') + option('fortify-source', type: 'combo', choices: ['none', '1', '2', '3'], value: '3', + description: 'Set _FORTIFY_SOURCE= when building tests') ++option('test-machine', type: 'string', value: 'qemu', ++ description: 'Machine-specific startup code to use when running tests') ++ + + option('tinystdio', type: 'boolean', value: true, + description: 'Use tiny stdio from avr libc') +diff --git a/picocrt/machine/aarch64/crt0.S b/picocrt/machine/aarch64/crt0.S +new file mode 100644 +index 000000000..4cb19854a +--- /dev/null ++++ b/picocrt/machine/aarch64/crt0.S +@@ -0,0 +1,200 @@ ++/************ Page table ************/ ++/* ++ * The smallest VA we can construct is 8GB, which needs 8 block page table ++ * entries, each covering 1GiB. ++ */ ++#define MMU_BLOCK_COUNT 8 ++ ++#define MMU_DESCRIPTOR_VALID (1 << 0) ++#define MMU_DESCRIPTOR_BLOCK (0 << 1) ++#define MMU_DESCRIPTOR_TABLE (1 << 1) ++ ++#define MMU_BLOCK_XN (1LL << 54) ++#define MMU_BLOCK_PXN (1LL << 53) ++#define MMU_BLOCK_CONTIG (1LL << 52) ++#define MMU_BLOCK_DBM (1LL << 51) ++#define MMU_BLOCK_GP (1LL << 50) ++ ++#define MMU_BLOCK_NT (1 << 16) ++#define MMU_BLOCK_OA_BIT 12 ++#define MMU_BLOCK_NG (1 << 11) ++#define MMU_BLOCK_AF (1 << 10) ++#define MMU_BLOCK_SH_BIT 8 ++#define MMU_BLOCK_SH_NS (0 << MMU_BLOCK_SH_BIT) ++#define MMU_BLOCK_SH_OS (2 << MMU_BLOCK_SH_BIT) ++#define MMU_BLOCK_SH_IS (3 << MMU_BLOCK_SH_BIT) ++#define MMU_BLOCK_AP_BIT 6 ++#define MMU_BLOCK_NS (1 << 5) ++#define MMU_BLOCK_ATTR_BIT 2 ++ ++#define MMU_NORMAL_FLAGS (MMU_DESCRIPTOR_VALID | \ ++ MMU_DESCRIPTOR_BLOCK | \ ++ MMU_BLOCK_AF | \ ++ MMU_BLOCK_SH_IS | \ ++ (0 << MMU_BLOCK_ATTR_BIT)) ++ ++#define MMU_DEVICE_FLAGS (MMU_DESCRIPTOR_VALID | \ ++ MMU_DESCRIPTOR_BLOCK | \ ++ MMU_BLOCK_AF | \ ++ (1 << MMU_BLOCK_ATTR_BIT)) ++ ++#define MMU_INVALID_FLAGS 0 ++ ++ .macro start_page_table ++ .section .rodata ++ .global __identity_page_table ++ .balign 65536 ++__identity_page_table: ++ .set block_num, 0 ++ .endm ++ ++ .macro page_table_entries count, flags ++ .rept \count ++ .8byte (block_num << 30) | \flags ++ .set block_num, block_num + 1 ++ .endr ++ .endm ++ ++ .macro end_page_table ++ .size __identity_page_table, MMU_BLOCK_COUNT * 8 ++ .if block_num != MMU_BLOCK_COUNT ++ .error "Wrong number of page table entries" ++ .endif ++ .endm ++ ++#if defined(MACHINE_qemu) ++ start_page_table ++ // [0x0000_0000,0x8000_0000): 2GiB normal memory ++ page_table_entries 2, MMU_NORMAL_FLAGS ++ // [0x8000_0000,0x1_0000_0000): 2GiB device memory ++ page_table_entries 2, MMU_DEVICE_FLAGS ++ // [0x1_0000_0000,0x2_0000_0000): 4GiB un-mapped ++ page_table_entries 4, MMU_INVALID_FLAGS ++ end_page_table ++#elif defined(MACHINE_fvp) ++ start_page_table ++ // [0x0000_0000,0x8000_0000): 2GiB unmapped. This actually contains a lot ++ // of different memory regions and devices, but we don't need any of them ++ // for testing. ++ page_table_entries 2, MMU_INVALID_FLAGS ++ // [0x8000_0000,0x1_0000_0000): 2GiB normal memory ++ page_table_entries 2, MMU_NORMAL_FLAGS ++ // [0x1_0000_0000,0x2_0000_0000): 4GiB un-mapped ++ page_table_entries 4, MMU_INVALID_FLAGS ++ end_page_table ++#else ++#error "Unknown machine type" ++#endif ++ ++ ++/************ Entry point ************/ ++ ++ // Defined in crt0.c ++ .global _cstart ++ .type cstart, %function ++ ++ // _start: Main entry point function, sets up the hardware to the point where ++ // we can execute C code. ++ .section .text.init.enter, "ax", %progbits ++ .global _start ++ .type _start, %function ++_start: ++ /* Use EL-banked stack pointer */ ++ msr SPSel, #1 ++ ++ /* Initialize stack */ ++ adrp x1, __stack ++ add x1, x1, :lo12:__stack ++ mov sp, x1 ++ ++ /* Enable FPU */ ++#if __ARM_FP ++#if defined(MACHINE_qemu) ++ mov x1, #(0x3 << 20) ++ msr CPACR_EL1, x1 ++#elif defined(MACHINE_fvp) ++ mrs x0, CPTR_EL3 ++ /* Clear CPTR_ELx.TFP, to enable FP/SIMD instructions at EL0 and EL1. */ ++ and x0, x0, #~(1<<10) ++ /* Set CPTR_ELx.EZ and .ESM, to enable SVE and SME instructions at EL3. These ++ * bits are ignored for cores which don't have the relevant feature. */ ++ ORR x0, x0, #1<<8 ++ ORR x0, x0, #1<<12 ++ msr CPTR_EL3, x0 ++#else ++#error "Unknown machine type" ++#endif ++#endif // __ARM_FP ++ ++ /* Jump into C code */ ++ bl _cstart ++ .size _start, .-_start ++ ++ ++ ++/************ Exception handlers ************/ ++#ifdef CRT0_SEMIHOST ++ ++ .macro vector_common ++ sub sp, sp, #256 ++ str x0, [sp, #0] ++ str x1, [sp, #8] ++ str x2, [sp, #16] ++ str x3, [sp, #24] ++ str x4, [sp, #32] ++ str x5, [sp, #40] ++ str x6, [sp, #48] ++ str x7, [sp, #56] ++ str x8, [sp, #64] ++ str x9, [sp, #72] ++ str x10, [sp, #80] ++ str x11, [sp, #88] ++ str x12, [sp, #96] ++ str x13, [sp, #104] ++ str x14, [sp, #112] ++ str x15, [sp, #120] ++ str x16, [sp, #128] ++ str x17, [sp, #136] ++ str x18, [sp, #144] ++ str x19, [sp, #152] ++ str x20, [sp, #160] ++ str x21, [sp, #168] ++ str x22, [sp, #176] ++ str x23, [sp, #184] ++ str x24, [sp, #192] ++ str x25, [sp, #200] ++ str x26, [sp, #208] ++ str x27, [sp, #216] ++ str x28, [sp, #224] ++ str x29, [sp, #232] ++ str x30, [sp, #240] ++#if defined(MACHINE_qemu) ++ mrs x0, ELR_EL1 ++#elif defined(MACHINE_fvp) ++ mrs x0, ELR_EL3 ++#else ++#error "Unknown machine type" ++#endif ++ str x0, [sp, #248] ++ mov x0, sp ++ .endm ++ ++ .global aarch64_fault ++ .type aarch64_fault, %function ++ ++ .macro exception_handler name, number ++ .section .init, "ax", %progbits ++ .global aarch64_\name\()_vector ++ .type aarch64_\name\()_vector, %function ++aarch64_\name\()_vector: ++ vector_common ++ mov x1, #\number ++ b aarch64_fault ++ .endm ++ ++ exception_handler sync, 0 ++ exception_handler irq, 1 ++ exception_handler fiq, 2 ++ exception_handler serror, 3 ++ ++#endif // CRT0_SEMIHOST +diff --git a/picocrt/machine/aarch64/crt0.c b/picocrt/machine/aarch64/crt0.c +index affb41fa9..dfe838111 100644 +--- a/picocrt/machine/aarch64/crt0.c ++++ b/picocrt/machine/aarch64/crt0.c +@@ -60,75 +60,11 @@ _set_tls(void *tls) + + #include "../../crt0.h" + +-/* +- * We need 4 1GB mappings to cover the usual Normal memory space, +- * which runs from 0x00000000 to 0x7fffffff along with the usual +- * Device space which runs from 0x80000000 to 0xffffffff. However, +- * it looks like the smallest VA we can construct is 8GB, so we'll +- * pad the space with invalid PTEs +- */ +-#define MMU_NORMAL_COUNT 2 +-#define MMU_DEVICE_COUNT 2 +-#define MMU_INVALID_COUNT 4 +-extern uint64_t __identity_page_table[MMU_NORMAL_COUNT + MMU_DEVICE_COUNT + MMU_INVALID_COUNT]; +- +-#define MMU_DESCRIPTOR_VALID (1 << 0) +-#define MMU_DESCRIPTOR_BLOCK (0 << 1) +-#define MMU_DESCRIPTOR_TABLE (1 << 1) +- +-#define MMU_BLOCK_XN (1LL << 54) +-#define MMU_BLOCK_PXN (1LL << 53) +-#define MMU_BLOCK_CONTIG (1LL << 52) +-#define MMU_BLOCK_DBM (1LL << 51) +-#define MMU_BLOCK_GP (1LL << 50) +- +-#define MMU_BLOCK_NT (1 << 16) +-#define MMU_BLOCK_OA_BIT 12 +-#define MMU_BLOCK_NG (1 << 11) +-#define MMU_BLOCK_AF (1 << 10) +-#define MMU_BLOCK_SH_BIT 8 +-#define MMU_BLOCK_SH_NS (0 << MMU_BLOCK_SH_BIT) +-#define MMU_BLOCK_SH_OS (2 << MMU_BLOCK_SH_BIT) +-#define MMU_BLOCK_SH_IS (3 << MMU_BLOCK_SH_BIT) +-#define MMU_BLOCK_AP_BIT 6 +-#define MMU_BLOCK_NS (1 << 5) +-#define MMU_BLOCK_ATTR_BIT 2 +- +-#define MMU_NORMAL_FLAGS (MMU_DESCRIPTOR_VALID | \ +- MMU_DESCRIPTOR_BLOCK | \ +- MMU_BLOCK_AF | \ +- MMU_BLOCK_SH_IS | \ +- (0 << MMU_BLOCK_ATTR_BIT)) +- +-#define MMU_DEVICE_FLAGS (MMU_DESCRIPTOR_VALID | \ +- MMU_DESCRIPTOR_BLOCK | \ +- MMU_BLOCK_AF | \ +- (1 << MMU_BLOCK_ATTR_BIT)) +- +-#define MMU_INVALID_FLAGS 0 +- +-__asm__( +- ".section .rodata\n" +- ".global __identity_page_table\n" +- ".balign 65536\n" +- "__identity_page_table:\n" +- ".set _i, 0\n" +- ".rept " __XSTRING(MMU_NORMAL_COUNT) "\n" +- " .8byte (_i << 30) |" __XSTRING(MMU_NORMAL_FLAGS) "\n" +- " .set _i, _i + 1\n" +- ".endr\n" +- ".set _i, 0\n" +- ".rept " __XSTRING(MMU_DEVICE_COUNT) "\n" +- " .8byte (1 << 31) | (_i << 30) |" __XSTRING(MMU_DEVICE_FLAGS) "\n" +- " .set _i, _i + 1\n" +- ".endr\n" +- ".set _i, 0\n" +- ".rept " __XSTRING(MMU_INVALID_COUNT) "\n" +- " .8byte " __XSTRING(MMU_INVALID_FLAGS) "\n" +- " .set _i, _i + 1\n" +- ".endr\n" +- ".size __identity_page_table, " __XSTRING((MMU_NORMAL_COUNT + MMU_DEVICE_COUNT + MMU_INVALID_COUNT) * 8) "\n" +-); ++/* Defined in crt0.S */ ++#define MMU_BLOCK_COUNT 8 ++extern uint64_t __identity_page_table[MMU_BLOCK_COUNT]; ++extern void _start(void); ++extern const void *__vector_table[]; + + #define SCTLR_MMU (1 << 0) + #define SCTLR_A (1 << 1) +@@ -159,12 +95,19 @@ __asm__( + #define TCR_IPS_BIT 32 + #define TCR_IPS_4GB (0LL << TCR_IPS_BIT) + +-extern const void *__vector_table[]; ++/* QEMU boots into EL1, and FVPs boot into EL3, so we need to use the correct ++ * system registers. */ ++#if defined(MACHINE_qemu) ++#define BOOT_EL "EL1" ++#elif defined(MACHINE_fvp) ++#define BOOT_EL "EL3" ++#else ++#error "Unknown machine type" ++#endif + +-static void __attribute((used)) +-_cstart(void) ++void _cstart(void) + { +- uint64_t sctlr_el1; ++ uint64_t sctlr; + + /* Invalidate the cache */ + __asm__("ic iallu"); +@@ -174,7 +117,7 @@ _cstart(void) + * Set up the TCR register to provide a 33bit VA space using + * 4kB pages over 4GB of PA + */ +- __asm__("msr tcr_el1, %x0" :: ++ __asm__("msr tcr_"BOOT_EL", %x0" :: + "r" ((0x1f << TCR_T0SZ_BIT) | + TCR_IRGN0_WB_WA | + TCR_ORGN0_WB_WA | +@@ -184,7 +127,7 @@ _cstart(void) + TCR_IPS_4GB)); + + /* Load the page table base */ +- __asm__("msr ttbr0_el1, %x0" :: "r" (__identity_page_table)); ++ __asm__("msr ttbr0_"BOOT_EL", %x0" :: "r" (__identity_page_table)); + + /* + * Set the memory attributions in the MAIR register: +@@ -192,42 +135,24 @@ _cstart(void) + * Region 0 is Normal memory + * Region 1 is Device memory + */ +- __asm__("msr mair_el1, %x0" :: ++ __asm__("msr mair_"BOOT_EL", %x0" :: + "r" ((0xffLL << 0) | (0x00LL << 8))); + + /* + * Enable caches, and the MMU, disable alignment requirements + * and write-implies-XN + */ +- __asm__("mrs %x0, sctlr_el1" : "=r" (sctlr_el1)); +- sctlr_el1 |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; +- sctlr_el1 &= ~(SCTLR_A | SCTLR_WXN); +- __asm__("msr sctlr_el1, %x0" :: "r" (sctlr_el1)); ++ __asm__("mrs %x0, sctlr_"BOOT_EL"" : "=r" (sctlr)); ++ sctlr |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; ++ sctlr &= ~(SCTLR_A | SCTLR_WXN); ++ __asm__("msr sctlr_"BOOT_EL", %x0" :: "r" (sctlr)); + __asm__("isb\n"); + + /* Set the vector base address register */ +- __asm__("msr vbar_el1, %x0" :: "r" (__vector_table)); ++ __asm__("msr vbar_"BOOT_EL", %x0" :: "r" (__vector_table)); + __start(); + } + +-void __section(".text.init.enter") +-_start(void) +-{ +- /* Switch to EL1 */ +- __asm__("msr SPSel, #1"); +- +- /* Initialize stack */ +- __asm__("adrp x1, __stack"); +- __asm__("add x1, x1, :lo12:__stack"); +- __asm__("mov sp, x1"); +-#if __ARM_FP +- /* Enable FPU */ +- __asm__("mov x1, #(0x3 << 20)"); +- __asm__("msr cpacr_el1,x1"); +-#endif +- /* Jump into C code */ +- __asm__("bl _cstart"); +-} + + #ifdef CRT0_SEMIHOST + +@@ -269,13 +194,9 @@ static const char *const reasons[] = { + "serror\n" + }; + +-#define REASON_SYNC 0 +-#define REASON_IRQ 1 +-#define REASON_FIQ 2 +-#define REASON_SERROR 3 +- +-static void __attribute__((used)) +-aarch64_fault(struct fault *f, int reason) ++/* Called from assembly wrappers in crt0.S, which fills *f with the register ++ * values at the point the fault happened. */ ++void aarch64_fault(struct fault *f, int reason) + { + int r; + fputs("AARCH64 fault: ", stdout); +@@ -292,69 +213,4 @@ aarch64_fault(struct fault *f, int reason) + _exit(1); + } + +-#define VECTOR_COMMON \ +- __asm__("sub sp, sp, #256"); \ +- __asm__("str x0, [sp, #0]"); \ +- __asm__("str x1, [sp, #8]"); \ +- __asm__("str x2, [sp, #16]"); \ +- __asm__("str x3, [sp, #24]"); \ +- __asm__("str x4, [sp, #32]"); \ +- __asm__("str x5, [sp, #40]"); \ +- __asm__("str x6, [sp, #48]"); \ +- __asm__("str x7, [sp, #56]"); \ +- __asm__("str x8, [sp, #64]"); \ +- __asm__("str x9, [sp, #72]"); \ +- __asm__("str x10, [sp, #80]"); \ +- __asm__("str x11, [sp, #88]"); \ +- __asm__("str x12, [sp, #96]"); \ +- __asm__("str x13, [sp, #104]"); \ +- __asm__("str x14, [sp, #112]"); \ +- __asm__("str x15, [sp, #120]"); \ +- __asm__("str x16, [sp, #128]"); \ +- __asm__("str x17, [sp, #136]"); \ +- __asm__("str x18, [sp, #144]"); \ +- __asm__("str x19, [sp, #152]"); \ +- __asm__("str x20, [sp, #160]"); \ +- __asm__("str x21, [sp, #168]"); \ +- __asm__("str x22, [sp, #176]"); \ +- __asm__("str x23, [sp, #184]"); \ +- __asm__("str x24, [sp, #192]"); \ +- __asm__("str x25, [sp, #200]"); \ +- __asm__("str x26, [sp, #208]"); \ +- __asm__("str x27, [sp, #216]"); \ +- __asm__("str x28, [sp, #224]"); \ +- __asm__("str x29, [sp, #232]"); \ +- __asm__("str x30, [sp, #240]"); \ +- __asm__("mrs x0, ELR_EL1\n"); \ +- __asm__("str x0, [sp, #248]"); \ +- __asm__("mrs x0, ESR_EL1\n"); \ +- __asm__("str x0, [sp, #256]"); \ +- __asm__("mrs x0, FAR_EL1\n"); \ +- __asm__("str x0, [sp, #264]"); \ +- __asm__("mov x0, sp") +- +-void __section(".init") +-aarch64_sync_vector(void) +-{ +- VECTOR_COMMON; +- __asm__("mov x1, #" REASON(REASON_SYNC)); +- __asm__("b aarch64_fault"); +-} +- +-void __section(".init") +-aarch64_irq_vector(void) +-{ +- VECTOR_COMMON; +- __asm__("mov x1, #" REASON(REASON_IRQ)); +- __asm__("b aarch64_fault"); +-} +- +-void __section(".init") +-aarch64_fiq_vector(void) +-{ +- VECTOR_COMMON; +- __asm__("mov x1, #" REASON(REASON_FIQ)); +- __asm__("b aarch64_fault"); +-} +- + #endif /* CRT0_SEMIHOST */ +diff --git a/picocrt/machine/aarch64/meson.build b/picocrt/machine/aarch64/meson.build +index 808d691a5..923d32c3b 100644 +--- a/picocrt/machine/aarch64/meson.build ++++ b/picocrt/machine/aarch64/meson.build +@@ -32,4 +32,11 @@ + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # +-src_picocrt += files('crt0.c') ++src_picocrt += files('crt0.c', 'crt0.S') ++ ++picocrt_machines += [ ++ { ++ 'name': 'fvp', ++ 'suffix': '-fvp', ++ }, ++] +diff --git a/picocrt/meson.build b/picocrt/meson.build +index 76965990f..be8f875be 100644 +--- a/picocrt/meson.build ++++ b/picocrt/meson.build +@@ -36,6 +36,17 @@ + src_picocrt = [] + src_picocrt_none = files('crt0-none.c') + ++# Machine-specific crt0 variants to build. ++picocrt_machines = [ ++ { ++ # Must match a valid value of the 'test-machine' option, and will cause the ++ # MACHINE_ preprocessor macro to be defined when compiling crt0. ++ 'name': 'qemu', ++ # Suffix used on file names, QEMU's is empty because it is the default. ++ 'suffix': '', ++ }, ++] ++ + machine_dir = 'machine' / host_cpu_family + picocrt_march_add='' + if fs.is_dir(machine_dir) +@@ -44,6 +55,16 @@ else + src_picocrt = files('shared/crt0.c') + endif + ++machine_found = false ++foreach machine : picocrt_machines ++ if machine['name'] == test_machine ++ machine_found = true ++ endif ++endforeach ++if not machine_found ++ error(test_machine + ': requested test machine not found') ++endif ++ + foreach target : targets + value = get_variable('target_' + target) + +@@ -60,150 +81,163 @@ foreach target : targets + value = [value[0], new_cflags] + endif + +- if target == '' +- crt_name = 'crt0.o' +- crt_hosted_name = 'crt0-hosted.o' +- crt_minimal_name = 'crt0-minimal.o' +- crt_semihost_name = 'crt0-semihost.o' +- crt_none_name = 'crt0-none.o' +- libcrt_name = 'crt0' +- libcrt_hosted_name = 'crt0-hosted' +- libcrt_minimal_name = 'crt0-minimal' +- libcrt_semihost_name = 'crt0-semihost' +- libcrt_none_name = 'crt0-none' +- else +- crt_name = join_paths(target, 'crt0.o') +- crt_hosted_name = join_paths(target, 'crt0-hosted.o') +- crt_minimal_name = join_paths(target, 'crt0-minimal.o') +- crt_semihost_name = join_paths(target, 'crt0-semihost.o') +- crt_none_name = join_paths(target, 'crt0-none.o') +- libcrt_name = join_paths(target, 'libcrt0') +- libcrt_hosted_name = join_paths(target, 'libcrt0-hosted') +- libcrt_minimal_name = join_paths(target, 'libcrt0-minimal') +- libcrt_semihost_name = join_paths(target, 'libcrt0-semihost') +- libcrt_none_name = join_paths(target, 'libcrt0-none') +- endif ++ foreach machine : picocrt_machines ++ suffix = machine['suffix'] ++ if target == '' ++ crt_name = 'crt0' + suffix + '.o' ++ crt_hosted_name = 'crt0-hosted' + suffix + '.o' ++ crt_minimal_name = 'crt0-minimal' + suffix + '.o' ++ crt_semihost_name = 'crt0-semihost' + suffix + '.o' ++ crt_none_name = 'crt0-none' + suffix + '.o' ++ libcrt_name = 'crt0' + suffix ++ libcrt_hosted_name = 'crt0-hosted' + suffix ++ libcrt_minimal_name = 'crt0-minimal' + suffix ++ libcrt_semihost_name = 'crt0-semihost' + suffix ++ libcrt_none_name = 'crt0-none' + suffix ++ else ++ crt_name = join_paths(target, 'crt0' + suffix + '.o') ++ crt_hosted_name = join_paths(target, 'crt0-hosted' + suffix + '.o') ++ crt_minimal_name = join_paths(target, 'crt0-minimal' + suffix + '.o') ++ crt_semihost_name = join_paths(target, 'crt0-semihost' + suffix + '.o') ++ crt_none_name = join_paths(target, 'crt0-none' + suffix + '.o') ++ libcrt_name = join_paths(target, 'libcrt0' + suffix) ++ libcrt_hosted_name = join_paths(target, 'libcrt0-hosted' + suffix) ++ libcrt_minimal_name = join_paths(target, 'libcrt0-minimal' + suffix) ++ libcrt_semihost_name = join_paths(target, 'libcrt0-semihost' + suffix) ++ libcrt_none_name = join_paths(target, 'libcrt0-none' + suffix) ++ endif + +- crt0_name = 'crt0' + target +- crt0_hosted_name = 'crt0_hosted' + target +- crt0_minimal_name = 'crt0_minimal' + target +- crt0_semihost_name = 'crt0_semihost' + target +- crt0_none_name = 'crt0_none' + target +- +- _c_args = value[1] + arg_fnobuiltin + ['-ffreestanding'] +- _link_args = value[1] + ['-r', '-ffreestanding'] +- +- # The normal variant does not call 'exit' after return from main (c lingo: freestanding execution environment) +- _crt = executable(crt_name, +- src_picocrt, +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args, +- link_args : _link_args) +- +- set_variable(crt0_name, +- _crt.extract_objects(src_picocrt) +- ) +- +- if enable_picocrt_lib +- static_library(libcrt_name, +- [], +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args, +- objects: get_variable(crt0_name), +- pic: false) +- endif ++ crt0_name = 'crt0' + target ++ crt0_hosted_name = 'crt0_hosted' + target ++ crt0_minimal_name = 'crt0_minimal' + target ++ crt0_semihost_name = 'crt0_semihost' + target ++ crt0_none_name = 'crt0_none' + target ++ ++ _c_args = value[1] + arg_fnobuiltin + ['-ffreestanding', '-DMACHINE_' + machine['name']] ++ _link_args = value[1] + ['-r', '-ffreestanding'] ++ ++ # The normal variant does not call 'exit' after return from main (c lingo: freestanding execution environment) ++ _crt = executable(crt_name, ++ src_picocrt, ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args, ++ link_args : _link_args) ++ ++ if machine['name'] == test_machine ++ set_variable(crt0_name, ++ _crt.extract_objects(src_picocrt) ++ ) ++ endif + +- # The 'hosted' variant calls 'exit' after return from main (c lingo: hosted execution environment) +- _crt = executable(crt_hosted_name, +- src_picocrt, +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args + ['-DCRT0_EXIT'], +- link_args : _link_args) +- +- set_variable(crt0_hosted_name, +- _crt.extract_objects(src_picocrt) +- ) +- +- if enable_picocrt_lib +- static_library(libcrt_hosted_name, +- [], +- include_directories : inc, +- install : true, +- install_dir : instdir, +- pic: false, +- objects: get_variable(crt0_hosted_name), +- c_args : value[1] + ['-DCRT0_EXIT']) +- endif ++ if enable_picocrt_lib ++ static_library(libcrt_name, ++ [], ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args, ++ objects: _crt.extract_objects(src_picocrt), ++ pic: false) ++ endif + +- # The 'minimal' variant doesn't call exit, nor does it invoke any constructors +- _crt = executable(crt_minimal_name, +- src_picocrt, +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args + ['-DCONSTRUCTORS=0'], +- link_args : _link_args) +- +- set_variable(crt0_minimal_name, +- _crt.extract_objects(src_picocrt) +- ) +- +- if enable_picocrt_lib +- static_library(libcrt_minimal_name, +- [], +- include_directories : inc, +- install : true, +- install_dir : instdir, +- pic: false, +- objects: get_variable(crt0_minimal_name), +- c_args : _c_args + ['-DCONSTRUCTORS=0']) +- endif ++ # The 'hosted' variant calls 'exit' after return from main (c lingo: hosted execution environment) ++ _crt = executable(crt_hosted_name, ++ src_picocrt, ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args + ['-DCRT0_EXIT'], ++ link_args : _link_args) ++ ++ if machine['name'] == test_machine ++ set_variable(crt0_hosted_name, ++ _crt.extract_objects(src_picocrt) ++ ) ++ endif + +- if has_arm_semihost +- # The 'semihost' variant calls sys_semihost_get_cmdline to build argv +- # and calls exit when main returns +- _crt = executable(crt_semihost_name, +- src_picocrt, +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST'], +- link_args : _link_args) +- +- set_variable(crt0_semihost_name, +- _crt.extract_objects(src_picocrt) +- ) ++ if enable_picocrt_lib ++ static_library(libcrt_hosted_name, ++ [], ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ pic: false, ++ objects: _crt.extract_objects(src_picocrt), ++ c_args : value[1] + ['-DCRT0_EXIT']) ++ endif ++ ++ # The 'minimal' variant doesn't call exit, nor does it invoke any constructors ++ _crt = executable(crt_minimal_name, ++ src_picocrt, ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args + ['-DCONSTRUCTORS=0'], ++ link_args : _link_args) ++ ++ if machine['name'] == test_machine ++ set_variable(crt0_minimal_name, ++ _crt.extract_objects(src_picocrt) ++ ) ++ endif + + if enable_picocrt_lib +- static_library(libcrt_semihost_name, ++ static_library(libcrt_minimal_name, + [], +- include_directories : inc, ++ include_directories : inc, + install : true, + install_dir : instdir, + pic: false, +- objects: get_variable(crt0_semihost_name), +- c_args : value[1] + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST']) ++ objects: _crt.extract_objects(src_picocrt), ++ c_args : _c_args + ['-DCONSTRUCTORS=0']) + endif +- endif + +- # The 'none' variant is completely empty +- _crt = executable(crt_none_name, +- src_picocrt_none, +- include_directories : inc, +- install : true, +- install_dir : instdir, +- c_args : _c_args, +- link_args : _link_args) ++ if has_arm_semihost ++ # The 'semihost' variant calls sys_semihost_get_cmdline to build argv ++ # and calls exit when main returns ++ _crt = executable(crt_semihost_name, ++ src_picocrt, ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST'], ++ link_args : _link_args) ++ ++ if machine['name'] == test_machine ++ set_variable(crt0_semihost_name, ++ _crt.extract_objects(src_picocrt) ++ ) ++ endif + +- set_variable(crt0_none_name, +- _crt.extract_objects(src_picocrt_none) +- ) ++ if enable_picocrt_lib ++ static_library(libcrt_semihost_name, ++ [], ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ pic: false, ++ objects: _crt.extract_objects(src_picocrt), ++ c_args : value[1] + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST']) ++ endif ++ endif ++ ++ # The 'none' variant is completely empty ++ _crt = executable(crt_none_name, ++ src_picocrt_none, ++ include_directories : inc, ++ install : true, ++ install_dir : instdir, ++ c_args : _c_args, ++ link_args : _link_args) ++ ++ if machine['name'] == test_machine ++ set_variable(crt0_none_name, ++ _crt.extract_objects(src_picocrt_none) ++ ) ++ endif + ++ endforeach + + endforeach From 17e7fcf4db40d3fe9ae2a29637ed9ffb4ca22f7d Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Thu, 14 Nov 2024 15:17:24 +0000 Subject: [PATCH 080/138] [Perf] Update inlining memcpy patch (#563) The patch file for setting inilining memcpy preference was slightly incorrect. Use of the SmallVector data structure caused issues with correctly inlining on some tests. The optimisation was also not enabled for v8.1m mainline targets as it should be. I've updated the patch file to reflect this. --- Omax.cfg | 1 + ...ble-MEMCPY-LDM-STM-inlining-for-v7-m.patch | 214 ----------- ...-LDM-STM-inlining-preference-for-v7m.patch | 350 ++++++++++++++++++ 3 files changed, 351 insertions(+), 214 deletions(-) delete mode 100644 patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch create mode 100644 patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch diff --git a/Omax.cfg b/Omax.cfg index 6918418c..78bec9fb 100644 --- a/Omax.cfg +++ b/Omax.cfg @@ -8,3 +8,4 @@ -mllvm -enable-dfa-jump-thread \ -mllvm -enable-loop-flatten \ -mllvm -enable-unroll-and-jam \ +-mllvm -enable-inline-memcpy-ld-st diff --git a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch b/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch deleted file mode 100644 index b25c6f9b..00000000 --- a/patches/llvm-project-perf/0002-ARM-CodeGen-Disable-MEMCPY-LDM-STM-inlining-for-v7-m.patch +++ /dev/null @@ -1,214 +0,0 @@ -From 40f07cbde57022b25412cf1c9239755613500d86 Mon Sep 17 00:00:00 2001 -From: nasmnc01 -Author: Scott Douglass -Date: Tue, 13 Aug 2024 10:55:51 +0100 -Subject: [PATCH] [ARM][CodeGen] Prefer MEMCPY LDM/STM inlining for v7-m - -This patch changes the behaviour of memcpy inlining on v7m targets. -The old behaviour was to inline memcpys with LDM/STM instructions. -Alternatively, using LD/ST instructions for memcpy inlining allowed -for performance gains of 1% to 2% on selected benchmarks. - -Co-authored-by: Nashe Mncube ---- - llvm/lib/Target/ARM/ARMFeatures.td | 5 + - llvm/lib/Target/ARM/ARMProcessors.td | 2 +- - llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 121 ++++++++++++++++++++ - llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + - 4 files changed, 133 insertions(+), 1 deletion(-) - -diff --git a/llvm/lib/Target/ARM/ARMFeatures.td b/llvm/lib/Target/ARM/ARMFeatures.td -index bb437698296c..f7fa00aba424 100644 ---- a/llvm/lib/Target/ARM/ARMFeatures.td -+++ b/llvm/lib/Target/ARM/ARMFeatures.td -@@ -510,6 +510,11 @@ def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler", - "DisablePostRAScheduler", "true", - "Don't schedule again after register allocation">; - -+def FeatureUseInlineMemcpyAsLdSt : -+ SubtargetFeature<"use-inline-memcpy-ldst", "UseInlineMemcpyAsLdSt", -+ "true", "Use memcpy inlining as LD/ST instructions">; -+ -+ - // Armv8.5-A extensions - - // Has speculation barrier. -diff --git a/llvm/lib/Target/ARM/ARMProcessors.td b/llvm/lib/Target/ARM/ARMProcessors.td -index b94a5fc16146..ffb0c86bc687 100644 ---- a/llvm/lib/Target/ARM/ARMProcessors.td -+++ b/llvm/lib/Target/ARM/ARMProcessors.td -@@ -96,7 +96,7 @@ def ProcR52plus : SubtargetFeature<"r52plus", "ARMProcFamily", "CortexR52plus", - def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3", - "Cortex-M3 ARM processors", []>; - def ProcM7 : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7", -- "Cortex-M7 ARM processors", []>; -+ "Cortex-M7 ARM processors", [FeatureUseInlineMemcpyAsLdSt]>; - - //===----------------------------------------------------------------------===// - // ARM processors -diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp -index c57825949c1c..63ae7a042886 100644 ---- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp -+++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp -@@ -12,6 +12,7 @@ - - #include "ARMTargetMachine.h" - #include "ARMTargetTransformInfo.h" -+#include "llvm/ADT/SmallVector.h" - #include "llvm/CodeGen/SelectionDAG.h" - #include "llvm/IR/DerivedTypes.h" - #include "llvm/Support/CommandLine.h" -@@ -138,6 +139,122 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( - return CallResult.second; - } - -+SDValue ARMSelectionDAGInfo::EmitMemcpyAsLdSt( -+ SelectionDAG &DAG, SDLoc dl, const ARMSubtarget &Subtarget, SDValue Chain, -+ SDValue Dst, SDValue Src, uint64_t SizeVal, bool isVolatile, -+ MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const { -+ // Do repeated batches of 4-byte loads and stores. -+ unsigned BytesLeft = SizeVal & 3; -+ unsigned NumMemOps = SizeVal >> 2; -+ unsigned EmittedNumMemOps = 0; -+ EVT VT = MVT::i32; -+ unsigned VTSize = 4; -+ unsigned I = 0; -+ // Emit a maximum of 4 loads in Thumb1 since we have fewer registers -+ const unsigned MaxLoads = Subtarget.isThumb1Only() ? 4 : 6; -+ SmallVector TFOps(6); -+ SmallVector Loads(6); -+ uint64_t SrcOff = 0, DstOff = 0; -+ -+ MachineMemOperand::Flags MOFlags = MachineMemOperand::Flags::MONone; -+ if (isVolatile) -+ MOFlags = MachineMemOperand::Flags::MOVolatile; -+ MachineMemOperand::Flags LoadMOFlags = MOFlags; -+ if (SrcPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), -+ DAG.getDataLayout())) -+ LoadMOFlags |= MachineMemOperand::Flags::MODereferenceable; -+ if (auto *V = SrcPtrInfo.V.dyn_cast()) -+ if (isa(V) && cast(V)->isConstant()) -+ LoadMOFlags |= MachineMemOperand::Flags::MOInvariant; -+ MachineMemOperand::Flags StoreMOFlags = MOFlags; -+ if (DstPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), -+ DAG.getDataLayout())) -+ StoreMOFlags |= MachineMemOperand::Flags::MODereferenceable; -+ -+ // Emit up to MaxLoads loads, then a TokenFactor barrier, then the -+ // same number of stores. The loads and stores may get combined into -+ // ldm/stm later on. -+ while (EmittedNumMemOps < NumMemOps) { -+ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { -+ Loads[I] = DAG.getLoad(VT, dl, Chain, -+ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, -+ DAG.getConstant(SrcOff, dl, MVT::i32)), -+ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), -+ LoadMOFlags); -+ TFOps[I] = Loads[I].getValue(1); -+ SrcOff += VTSize; -+ } -+ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, -+ ArrayRef(TFOps.data(), I)); -+ -+ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { -+ TFOps[I] = DAG.getStore( -+ Chain, dl, Loads[I], -+ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, -+ DAG.getConstant(DstOff, dl, MVT::i32)), -+ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), StoreMOFlags); -+ DstOff += VTSize; -+ } -+ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, -+ ArrayRef(TFOps.data(), I)); -+ -+ EmittedNumMemOps += I; -+ } -+ -+ if (BytesLeft == 0) -+ return Chain; -+ -+ // Issue loads / stores for the trailing (1 - 3) bytes. -+ unsigned BytesLeftSave = BytesLeft; -+ I = 0; -+ while (BytesLeft) { -+ if (BytesLeft >= 2) { -+ VT = MVT::i16; -+ VTSize = 2; -+ } else { -+ VT = MVT::i8; -+ VTSize = 1; -+ } -+ -+ Loads[I] = DAG.getLoad(VT, dl, Chain, -+ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, -+ DAG.getConstant(SrcOff, dl, MVT::i32)), -+ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), -+ LoadMOFlags); -+ -+ TFOps[I] = Loads[I].getValue(1); -+ ++I; -+ SrcOff += VTSize; -+ BytesLeft -= VTSize; -+ } -+ Chain = -+ DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps.data(), I)); -+ -+ I = 0; -+ BytesLeft = BytesLeftSave; -+ while (BytesLeft) { -+ if (BytesLeft >= 2) { -+ VT = MVT::i16; -+ VTSize = 2; -+ } else { -+ VT = MVT::i8; -+ VTSize = 1; -+ } -+ -+ TFOps[I] = DAG.getStore(Chain, dl, Loads[I], -+ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, -+ DAG.getConstant(DstOff, dl, MVT::i32)), -+ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), -+ StoreMOFlags); -+ ++I; -+ DstOff += VTSize; -+ BytesLeft -= VTSize; -+ } -+ -+ return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, -+ ArrayRef(TFOps.data(), I)); -+} -+ - static bool shouldGenerateInlineTPLoop(const ARMSubtarget &Subtarget, - const SelectionDAG &DAG, - ConstantSDNode *ConstantSize, -@@ -192,6 +309,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( - return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, - Alignment.value(), RTLIB::MEMCPY); - -+ if (Subtarget.useInlineMemcpyAsLdSt()) -+ return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, -+ isVolatile, DstPtrInfo, SrcPtrInfo); -+ - unsigned BytesLeft = SizeVal & 3; - unsigned NumMemOps = SizeVal >> 2; - unsigned EmittedNumMemOps = 0; -diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h -index 275b1c0f8dc0..6ff422c15b12 100644 ---- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h -+++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h -@@ -44,6 +44,12 @@ public: - MachinePointerInfo DstPtrInfo, - MachinePointerInfo SrcPtrInfo) const override; - -+ SDValue EmitMemcpyAsLdSt(SelectionDAG &DAG, SDLoc dl, -+ const ARMSubtarget &Subtarget, SDValue Chain, -+ SDValue Dst, SDValue Src, uint64_t SizeVal, -+ bool isVolatile, MachinePointerInfo DstPtrInfo, -+ MachinePointerInfo SrcPtrInfo) const; -+ - SDValue - EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, - SDValue Dst, SDValue Src, SDValue Size, --- -2.34.1 - diff --git a/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch new file mode 100644 index 00000000..20dffa45 --- /dev/null +++ b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch @@ -0,0 +1,350 @@ +From 8aa999e52ef03be7d8c05f4bd151d7df60d17e8f Mon Sep 17 00:00:00 2001 +From: Scott Douglass +Date: Tue, 13 Aug 2024 10:55:51 +0100 +Subject: [PATCH] [ARM][CodeGen]Prefer MEMCPY LDM/STM inlining for v7-m + +This patch changes the behaviour of memcpy inlining on v7m targets. +The old behaviour was to inline memcpys with LDM/STM instructions. +Alternatively, using LD/ST instructions for memcpy inlining allowed +for performance gains of 1% to 2% on selected benchmarks. + +Co-authored-by: Nashe Mncube +--- + llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 120 +++++++++++++++ + llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + + llvm/test/CodeGen/ARM/memcpy-v7m.ll | 161 ++++++++++++++++++++ + 3 files changed, 287 insertions(+) + create mode 100644 llvm/test/CodeGen/ARM/memcpy-v7m.ll + +diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +index e7ea10ff971a..09ed4ab219a1 100644 +--- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp ++++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +@@ -30,6 +30,10 @@ cl::opt EnableMemtransferTPLoop( + "Allow (may be subject to certain conditions) " + "conversion of memcpy to TP loop."))); + ++static cl::opt EnableInlineMemcpyAsLdSt( ++ "enable-inline-memcpy-ld-st", cl::init(false), cl::Hidden, ++ cl::desc("Inline memcpy with LD/ST instructions.")); ++ + // Emit, if possible, a specialized version of the given Libcall. Typically this + // means selecting the appropriately aligned version, but we also convert memset + // of 0 into memclr. +@@ -136,6 +140,118 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( + return CallResult.second; + } + ++SDValue ARMSelectionDAGInfo::EmitMemcpyAsLdSt( ++ SelectionDAG &DAG, SDLoc dl, const ARMSubtarget &Subtarget, SDValue Chain, ++ SDValue Dst, SDValue Src, uint64_t SizeVal, bool isVolatile, ++ MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const { ++ // Do repeated batches of 4-byte loads and stores. ++ unsigned BytesLeft = SizeVal & 3; ++ unsigned NumMemOps = SizeVal >> 2; ++ unsigned EmittedNumMemOps = 0; ++ EVT VT = MVT::i32; ++ unsigned VTSize = 4; ++ unsigned I = 0; ++ // Emit a maximum of 4 loads in Thumb1 since we have fewer registers ++ const unsigned MaxLoads = Subtarget.isThumb1Only() ? 4 : 6; ++ SDValue TFOps[6]; ++ SDValue Loads[6]; ++ uint64_t SrcOff = 0, DstOff = 0; ++ ++ MachineMemOperand::Flags MOFlags = MachineMemOperand::Flags::MONone; ++ if (isVolatile) ++ MOFlags = MachineMemOperand::Flags::MOVolatile; ++ MachineMemOperand::Flags LoadMOFlags = MOFlags; ++ if (SrcPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), ++ DAG.getDataLayout())) ++ LoadMOFlags |= MachineMemOperand::Flags::MODereferenceable; ++ if (auto *V = SrcPtrInfo.V.dyn_cast()) ++ if (isa(V) && cast(V)->isConstant()) ++ LoadMOFlags |= MachineMemOperand::Flags::MOInvariant; ++ MachineMemOperand::Flags StoreMOFlags = MOFlags; ++ if (DstPtrInfo.isDereferenceable(SizeVal, *DAG.getContext(), ++ DAG.getDataLayout())) ++ StoreMOFlags |= MachineMemOperand::Flags::MODereferenceable; ++ ++ // Emit up to MaxLoads loads, then a TokenFactor barrier, then the ++ // same number of stores. The loads and stores may get combined into ++ // ldm/stm later on. ++ while (EmittedNumMemOps < NumMemOps) { ++ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { ++ Loads[I] = DAG.getLoad(VT, dl, Chain, ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, ++ DAG.getConstant(SrcOff, dl, MVT::i32)), ++ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), ++ LoadMOFlags); ++ TFOps[I] = Loads[I].getValue(1); ++ SrcOff += VTSize; ++ } ++ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, I)); ++ ++ for (I = 0; I < MaxLoads && EmittedNumMemOps + I < NumMemOps; ++I) { ++ TFOps[I] = DAG.getStore( ++ Chain, dl, Loads[I], ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, ++ DAG.getConstant(DstOff, dl, MVT::i32)), ++ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), StoreMOFlags); ++ DstOff += VTSize; ++ } ++ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, I)); ++ ++ EmittedNumMemOps += I; ++ } ++ ++ if (BytesLeft == 0) ++ return Chain; ++ ++ // Issue loads / stores for the trailing (1 - 3) bytes. ++ unsigned BytesLeftSave = BytesLeft; ++ I = 0; ++ while (BytesLeft) { ++ if (BytesLeft >= 2) { ++ VT = MVT::i16; ++ VTSize = 2; ++ } else { ++ VT = MVT::i8; ++ VTSize = 1; ++ } ++ ++ Loads[I] = DAG.getLoad(VT, dl, Chain, ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Src, ++ DAG.getConstant(SrcOff, dl, MVT::i32)), ++ SrcPtrInfo.getWithOffset(SrcOff), MaybeAlign(0), ++ LoadMOFlags); ++ ++ TFOps[I] = Loads[I].getValue(1); ++ ++I; ++ SrcOff += VTSize; ++ BytesLeft -= VTSize; ++ } ++ Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, I)); ++ ++ I = 0; ++ BytesLeft = BytesLeftSave; ++ while (BytesLeft) { ++ if (BytesLeft >= 2) { ++ VT = MVT::i16; ++ VTSize = 2; ++ } else { ++ VT = MVT::i8; ++ VTSize = 1; ++ } ++ ++ TFOps[I] = DAG.getStore(Chain, dl, Loads[I], ++ DAG.getNode(ISD::ADD, dl, MVT::i32, Dst, ++ DAG.getConstant(DstOff, dl, MVT::i32)), ++ DstPtrInfo.getWithOffset(DstOff), MaybeAlign(0), ++ StoreMOFlags); ++ ++I; ++ DstOff += VTSize; ++ BytesLeft -= VTSize; ++ } ++ ++ return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, ArrayRef(TFOps, I)); ++} ++ + static bool shouldGenerateInlineTPLoop(const ARMSubtarget &Subtarget, + const SelectionDAG &DAG, + ConstantSDNode *ConstantSize, +@@ -190,6 +306,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( + return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, + Alignment.value(), RTLIB::MEMCPY); + ++ if (EnableInlineMemcpyAsLdSt && Subtarget.isMClass() && Subtarget.hasV7Ops()) ++ return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, ++ isVolatile, DstPtrInfo, SrcPtrInfo); ++ + unsigned BytesLeft = SizeVal & 3; + unsigned NumMemOps = SizeVal >> 2; + unsigned EmittedNumMemOps = 0; +diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +index 275b1c0f8dc0..6ff422c15b12 100644 +--- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h ++++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +@@ -44,6 +44,12 @@ public: + MachinePointerInfo DstPtrInfo, + MachinePointerInfo SrcPtrInfo) const override; + ++ SDValue EmitMemcpyAsLdSt(SelectionDAG &DAG, SDLoc dl, ++ const ARMSubtarget &Subtarget, SDValue Chain, ++ SDValue Dst, SDValue Src, uint64_t SizeVal, ++ bool isVolatile, MachinePointerInfo DstPtrInfo, ++ MachinePointerInfo SrcPtrInfo) const; ++ + SDValue + EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, + SDValue Dst, SDValue Src, SDValue Size, +diff --git a/llvm/test/CodeGen/ARM/memcpy-v7m.ll b/llvm/test/CodeGen/ARM/memcpy-v7m.ll +new file mode 100644 +index 000000000000..12f74c04087e +--- /dev/null ++++ b/llvm/test/CodeGen/ARM/memcpy-v7m.ll +@@ -0,0 +1,161 @@ ++; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 ++; RUN: llc -mtriple=arm-none-eabi -mcpu=cortex-m7 -verify-machineinstrs -enable-inline-memcpy-ld-st %s -o - | FileCheck %s ++ ++@d = external global [64 x i32] ++@s = external global [64 x i32] ++@d_32 = external global[32 x i32] ++@s_32 = external global[32 x i32] ++ ++ ++define void @t1() #0 { ++; CHECK-LABEL: t1: ++; CHECK: @ %bb.0: @ %entry ++; CHECK-NEXT: movw r0, :lower16:d ++; CHECK-NEXT: movw r2, :lower16:s ++; CHECK-NEXT: movt r0, :upper16:d ++; CHECK-NEXT: movt r2, :upper16:s ++; CHECK-NEXT: ldr r1, [r0] ++; CHECK-NEXT: str r1, [r2] ++; CHECK-NEXT: ldr r3, [r0, #4] ++; CHECK-NEXT: str r3, [r2, #4] ++; CHECK-NEXT: ldr r1, [r0, #8] ++; CHECK-NEXT: ldr r3, [r0, #12] ++; CHECK-NEXT: ldrb r0, [r0, #16] ++; CHECK-NEXT: strd r1, r3, [r2, #8] ++; CHECK-NEXT: strb r0, [r2, #16] ++; CHECK-NEXT: bx lr ++entry: ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([64 x i32]* @s to i8*), i8* bitcast ([64 x i32]* @d to i8*), i32 17, i32 4, i1 false) ++ ret void ++} ++ ++define void @t2() #0 { ++; CHECK-LABEL: t2: ++; CHECK: @ %bb.0: @ %entry ++; CHECK-NEXT: movw r0, :lower16:d ++; CHECK-NEXT: movw r1, :lower16:s ++; CHECK-NEXT: movt r0, :upper16:d ++; CHECK-NEXT: movt r1, :upper16:s ++; CHECK-NEXT: ldr.w r2, [r0, #11] ++; CHECK-NEXT: str.w r2, [r1, #11] ++; CHECK-NEXT: ldr r2, [r0] ++; CHECK-NEXT: str r2, [r1] ++; CHECK-NEXT: ldr r2, [r0, #4] ++; CHECK-NEXT: str r2, [r1, #4] ++; CHECK-NEXT: ldr r0, [r0, #8] ++; CHECK-NEXT: str r0, [r1, #8] ++; CHECK-NEXT: bx lr ++entry: ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([64 x i32]* @s to i8*), i8* bitcast ([64 x i32]* @d to i8*), i32 15, i32 4, i1 false) ++ ret void ++} ++ ++declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1 ++ ++ ++define void @t3() #0 { ++; CHECK-LABEL: t3: ++; CHECK: @ %bb.0: ++; CHECK-NEXT: movw r0, :lower16:d_32 ++; CHECK-NEXT: movw r2, :lower16:s_32 ++; CHECK-NEXT: movt r0, :upper16:d_32 ++; CHECK-NEXT: movt r2, :upper16:s_32 ++; CHECK-NEXT: ldr r1, [r0] ++; CHECK-NEXT: str r1, [r2] ++; CHECK-NEXT: ldr r3, [r0, #4] ++; CHECK-NEXT: str r3, [r2, #4] ++; CHECK-NEXT: ldr r1, [r0, #8] ++; CHECK-NEXT: ldr r3, [r0, #12] ++; CHECK-NEXT: ldrb r0, [r0, #16] ++; CHECK-NEXT: strd r1, r3, [r2, #8] ++; CHECK-NEXT: strb r0, [r2, #16] ++; CHECK-NEXT: bx lr ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([32 x i32]* @s_32 to i8*), i8* bitcast ([32 x i32]* @d_32 to i8*), i32 17, i32 4, i1 false) ++ ret void ++} ++ ++define void @t4() #0 { ++; CHECK-LABEL: t4: ++; CHECK: @ %bb.0: ++; CHECK-NEXT: movw r0, :lower16:d_32 ++; CHECK-NEXT: movw r1, :lower16:s_32 ++; CHECK-NEXT: movt r0, :upper16:d_32 ++; CHECK-NEXT: movt r1, :upper16:s_32 ++; CHECK-NEXT: ldr.w r2, [r0, #11] ++; CHECK-NEXT: str.w r2, [r1, #11] ++; CHECK-NEXT: ldr r2, [r0] ++; CHECK-NEXT: str r2, [r1] ++; CHECK-NEXT: ldr r2, [r0, #4] ++; CHECK-NEXT: str r2, [r1, #4] ++; CHECK-NEXT: ldr r0, [r0, #8] ++; CHECK-NEXT: str r0, [r1, #8] ++; CHECK-NEXT: bx lr ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([32 x i32]* @s_32 to i8*), i8* bitcast ([32 x i32]* @d_32 to i8*), i32 15, i32 4, i1 false) ++ ret void ++} ++ ++define void @t5() #0 { ++; CHECK-LABEL: t5: ++; CHECK: @ %bb.0: @ %entry ++; CHECK-NEXT: .save {r4, r5, r7, lr} ++; CHECK-NEXT: push {r4, r5, r7, lr} ++; CHECK-NEXT: movw r0, :lower16:d ++; CHECK-NEXT: movw r1, :lower16:s ++; CHECK-NEXT: movt r0, :upper16:d ++; CHECK-NEXT: movt r1, :upper16:s ++; CHECK-NEXT: ldr r0, [r0] ++; CHECK-NEXT: ldr r1, [r1] ++; CHECK-NEXT: add.w r12, r0, #12 ++; CHECK-NEXT: ldr r3, [r0, #24] ++; CHECK-NEXT: ldrd r2, lr, [r0, #4] ++; CHECK-NEXT: ldm.w r12, {r4, r5, r12} ++; CHECK-NEXT: str r3, [r1, #24] ++; CHECK-NEXT: add.w r3, r1, #12 ++; CHECK-NEXT: strd r2, lr, [r1, #4] ++; CHECK-NEXT: stm.w r3, {r4, r5, r12} ++; CHECK-NEXT: ldr r0, [r0, #28] ++; CHECK-NEXT: str r0, [r1, #28] ++; CHECK-NEXT: pop {r4, r5, r7, pc} ++entry: ++ %0 = load i32*, i32** @s, align 4 ++ %arrayidx = getelementptr inbounds i32, i32* %0, i32 1 ++ %1 = bitcast i32* %arrayidx to i8* ++ %2 = load i32*, i32** @d, align 4 ++ %arrayidx1 = getelementptr inbounds i32, i32* %2, i32 1 ++ %3 = bitcast i32* %arrayidx1 to i8* ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %3, i32 28, i32 4, i1 false) ++ ret void ++} ++ ++define void @t6() #0 { ++; CHECK-LABEL: t6: ++; CHECK: @ %bb.0: @ %entry ++; CHECK-NEXT: .save {r4, r5, r7, lr} ++; CHECK-NEXT: push {r4, r5, r7, lr} ++; CHECK-NEXT: movw r0, :lower16:d ++; CHECK-NEXT: movw r1, :lower16:s ++; CHECK-NEXT: movt r0, :upper16:d ++; CHECK-NEXT: movt r1, :upper16:s ++; CHECK-NEXT: ldr r0, [r0] ++; CHECK-NEXT: ldr r1, [r1] ++; CHECK-NEXT: add.w r12, r0, #12 ++; CHECK-NEXT: ldr r3, [r0, #24] ++; CHECK-NEXT: ldrd r2, lr, [r0, #4] ++; CHECK-NEXT: ldm.w r12, {r4, r5, r12} ++; CHECK-NEXT: str r3, [r1, #24] ++; CHECK-NEXT: add.w r3, r1, #12 ++; CHECK-NEXT: strd r2, lr, [r1, #4] ++; CHECK-NEXT: stm.w r3, {r4, r5, r12} ++; CHECK-NEXT: ldr r0, [r0, #28] ++; CHECK-NEXT: str r0, [r1, #28] ++; CHECK-NEXT: pop {r4, r5, r7, pc} ++entry: ++ %0 = load i32*, i32** @s, align 8 ++ %arrayidx = getelementptr inbounds i32, i32* %0, i32 1 ++ %1 = bitcast i32* %arrayidx to i8* ++ %2 = load i32*, i32** @d, align 8 ++ %arrayidx1 = getelementptr inbounds i32, i32* %2, i32 1 ++ %3 = bitcast i32* %arrayidx1 to i8* ++ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %3, i32 28, i32 4, i1 false) ++ ret void ++} +-- +2.34.1 + From 8ac25ff6d053c443027c8a3be43b6eb89e8262f4 Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Fri, 15 Nov 2024 09:20:56 +0000 Subject: [PATCH 081/138] Document enable-inline-memcpy-ld-st flag (#565) Adds documentation of the optional inline-memcpy-ld-st flag. --- docs/optimization-flags.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/optimization-flags.md b/docs/optimization-flags.md index 6739601d..159d07ac 100644 --- a/docs/optimization-flags.md +++ b/docs/optimization-flags.md @@ -2,8 +2,14 @@ Additional optimization flags ============================= ## Additional loop unroll in the LTO pipeline -In some cases it is benefitial to perform an additional loop unroll pass so that extra information becomes available to later passes, e.g. SROA. +In some cases it is benefitial to perform an additional loop unroll pass so that extra information becomes available to later passes, e.g. SROA. Use cases where this could be beneficial - multiple (N>=4) nested loops. -### Usage: +### Usage: -Wl,-plugin-opt=-extra-LTO-loop-unroll=true/false + +## Inline memcpy with LD/ST instructions +In some cases inlining of memcpy instructions performs best when using LD/ST instructions. + +### Usage: + -mllvm -enable-inline-memcpy-ld-st From 0123938f9751da1324aac857d74913c72e2863cb Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Fri, 15 Nov 2024 16:55:51 +0000 Subject: [PATCH 082/138] Update version of FVPs used for testing (#568) A new version of Arm's Ecosystem FVPs have been release and, with that, the links for the older versions are no longer valid. This updates the get_fvps.sh script to use the links for the new version. --- fvp/get_fvps.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fvp/get_fvps.sh b/fvp/get_fvps.sh index 27d3ae43..aa1ccd4b 100755 --- a/fvp/get_fvps.sh +++ b/fvp/get_fvps.sh @@ -35,9 +35,9 @@ while true; do done URL_CORSONE_310='https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-310/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz?rev=c370b571bdff42d3a0152471eca3d798&hash=1E388EE3B6E8F675D02D2832DBE61946DEC0386A' -URL_BASE_AEM_A='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz' -URL_BASE_AEM_R='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_AEMv8R_11.26_11_Linux64.tgz' -URL_CRYPTO='https://developer.arm.com/-/cdn-downloads/permalink/Fast-Models-Crypto-Plug-in/FM-11.26/FastModels_crypto_11.26.011_Linux64.tgz' +URL_BASE_AEM_A='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.27/FVP_Base_RevC-2xAEMvA_11.27_19_Linux64.tgz' +URL_BASE_AEM_R='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.27/FVP_Base_AEMv8R_11.27_19_Linux64.tgz' +URL_CRYPTO='https://developer.arm.com/-/cdn-downloads/permalink/Fast-Models-Crypto-Plug-in/FM-11.27/FastModels_crypto_11.27.019_Linux64.tgz' cd "$(dirname "$0")" @@ -59,19 +59,19 @@ tar -xf ${DOWNLOAD_DIR}/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz fi if [ ! -d "Base_RevC_AEMvA_pkg" ]; then -tar -xf ${DOWNLOAD_DIR}/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz +tar -xf ${DOWNLOAD_DIR}/FVP_Base_RevC-2xAEMvA_11.27_19_Linux64.tgz # (Extracted directly into ./Base_RevC_AEMvA_pkg/, no installer) fi if [ ! -d "AEMv8R_base_pkg" ]; then -tar -xf ${DOWNLOAD_DIR}/FVP_Base_AEMv8R_11.26_11_Linux64.tgz +tar -xf ${DOWNLOAD_DIR}/FVP_Base_AEMv8R_11.27_19_Linux64.tgz # (Extracted directly into ./AEMv8R_base_pkg/, no installer) fi -if [ ! -d "FastModelsPortfolio_11.26" ]; then -tar -xf ${DOWNLOAD_DIR}/FastModels_crypto_11.26.011_Linux64.tgz +if [ ! -d "FastModelsPortfolio_11.27" ]; then +tar -xf ${DOWNLOAD_DIR}/FastModels_crypto_11.27.019_Linux64.tgz # SDDKW-93582: Non-interactive installation fails if cwd is different. -pushd FastModels_crypto_11.26.011_Linux64 +pushd FastModels_crypto_11.27.019_Linux64 # This installer doesn't allow providing a default path for interactive # installation. ./setup.bin $INSTALLER_FLAGS_CRYPTO From 325434a265558b2efb81ed0e0f9bbea7f42410ad Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Mon, 18 Nov 2024 10:32:46 +0000 Subject: [PATCH 083/138] [NFC]Format patch file for Windows (#570) Windows expects newline to have a space at the end of them. Because of this my updated patch file failed to build on Windows. This commit adds the appropriate spaces. --- ...degen-Set-LDM-STM-inlining-preference-for-v7m.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch index 20dffa45..b0b72487 100644 --- a/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch +++ b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch @@ -23,7 +23,7 @@ index e7ea10ff971a..09ed4ab219a1 100644 @@ -30,6 +30,10 @@ cl::opt EnableMemtransferTPLoop( "Allow (may be subject to certain conditions) " "conversion of memcpy to TP loop."))); - + +static cl::opt EnableInlineMemcpyAsLdSt( + "enable-inline-memcpy-ld-st", cl::init(false), cl::Hidden, + cl::desc("Inline memcpy with LD/ST instructions.")); @@ -34,7 +34,7 @@ index e7ea10ff971a..09ed4ab219a1 100644 @@ -136,6 +140,118 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( return CallResult.second; } - + +SDValue ARMSelectionDAGInfo::EmitMemcpyAsLdSt( + SelectionDAG &DAG, SDLoc dl, const ARMSubtarget &Subtarget, SDValue Chain, + SDValue Dst, SDValue Src, uint64_t SizeVal, bool isVolatile, @@ -153,7 +153,7 @@ index e7ea10ff971a..09ed4ab219a1 100644 @@ -190,6 +306,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, Alignment.value(), RTLIB::MEMCPY); - + + if (EnableInlineMemcpyAsLdSt && Subtarget.isMClass() && Subtarget.hasV7Ops()) + return EmitMemcpyAsLdSt(DAG, dl, Subtarget, Chain, Dst, Src, SizeVal, + isVolatile, DstPtrInfo, SrcPtrInfo); @@ -168,7 +168,7 @@ index 275b1c0f8dc0..6ff422c15b12 100644 @@ -44,6 +44,12 @@ public: MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override; - + + SDValue EmitMemcpyAsLdSt(SelectionDAG &DAG, SDLoc dl, + const ARMSubtarget &Subtarget, SDValue Chain, + SDValue Dst, SDValue Src, uint64_t SizeVal, @@ -345,6 +345,6 @@ index 000000000000..12f74c04087e + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %3, i32 28, i32 4, i1 false) + ret void +} --- +-- 2.34.1 From 4f3243f287fd9c3bd24683d826d8b9532eb65946 Mon Sep 17 00:00:00 2001 From: dcandler Date: Mon, 18 Nov 2024 13:08:33 +0000 Subject: [PATCH 084/138] Move CMake code for building multilib and variants to subprojects (#562) This patch restructures the top-level CMake script in order to split building the library variants into a separate CMake project. This better encapsulates the code to build the variants, and untethers it from the toolchain builds so that libraries can be developed and tested without having the rebuild the entire toolchain. Similarly, a new subproject has been created to build a multilib set of library variants, using a selected C library. A simple JSON format has been used to define the flags and variants, which are then built and collected into the appropriate layout. --- CMakeLists.txt | 1646 +---------------- arm-multilib/CMakeLists.txt | 282 +++ arm-multilib/json/multilib.json | 259 +++ arm-multilib/json/variants/aarch64a.json | 40 + .../json/variants/aarch64a_exn_rtti.json | 40 + arm-multilib/json/variants/armv4t.json | 41 + .../json/variants/armv4t_exn_rtti.json | 41 + arm-multilib/json/variants/armv5te.json | 41 + .../json/variants/armv5te_exn_rtti.json | 41 + .../json/variants/armv6m_soft_nofp.json | 40 + .../variants/armv6m_soft_nofp_exn_rtti.json | 40 + .../json/variants/armv7a_hard_vfpv3_d16.json | 41 + .../armv7a_hard_vfpv3_d16_exn_rtti.json | 41 + .../json/variants/armv7a_soft_nofp.json | 41 + .../variants/armv7a_soft_nofp_exn_rtti.json | 41 + .../json/variants/armv7a_soft_vfpv3_d16.json | 41 + .../armv7a_soft_vfpv3_d16_exn_rtti.json | 41 + .../variants/armv7m_hard_fpv4_sp_d16.json | 40 + .../armv7m_hard_fpv4_sp_d16_exn_rtti.json | 40 + .../json/variants/armv7m_hard_fpv5_d16.json | 40 + .../armv7m_hard_fpv5_d16_exn_rtti.json | 40 + .../variants/armv7m_soft_fpv4_sp_d16.json | 40 + .../armv7m_soft_fpv4_sp_d16_exn_rtti.json | 40 + .../json/variants/armv7m_soft_nofp.json | 40 + .../variants/armv7m_soft_nofp_exn_rtti.json | 40 + .../json/variants/armv7r_hard_vfpv3_d16.json | 41 + .../armv7r_hard_vfpv3_d16_exn_rtti.json | 41 + .../json/variants/armv7r_hard_vfpv3xd.json | 41 + .../armv7r_hard_vfpv3xd_exn_rtti.json | 41 + .../json/variants/armv7r_soft_nofp.json | 41 + .../variants/armv7r_soft_nofp_exn_rtti.json | 41 + .../json/variants/armv7r_soft_vfpv3xd.json | 41 + .../armv7r_soft_vfpv3xd_exn_rtti.json | 41 + .../variants/armv8.1m.main_hard_fp_nomve.json | 40 + .../armv8.1m.main_hard_fp_nomve_exn_rtti.json | 40 + ...rmv8.1m.main_hard_fp_nomve_pacret_bti.json | 40 + ...ain_hard_fp_nomve_pacret_bti_exn_rtti.json | 40 + .../armv8.1m.main_hard_fpdp_nomve.json | 40 + ...rmv8.1m.main_hard_fpdp_nomve_exn_rtti.json | 40 + ...v8.1m.main_hard_fpdp_nomve_pacret_bti.json | 40 + ...n_hard_fpdp_nomve_pacret_bti_exn_rtti.json | 40 + .../variants/armv8.1m.main_hard_nofp_mve.json | 40 + .../armv8.1m.main_hard_nofp_mve_exn_rtti.json | 40 + ...rmv8.1m.main_hard_nofp_mve_pacret_bti.json | 40 + ...ain_hard_nofp_mve_pacret_bti_exn_rtti.json | 40 + .../armv8.1m.main_soft_nofp_nomve.json | 40 + ...rmv8.1m.main_soft_nofp_nomve_exn_rtti.json | 40 + ...v8.1m.main_soft_nofp_nomve_pacret_bti.json | 40 + ...n_soft_nofp_nomve_pacret_bti_exn_rtti.json | 40 + .../json/variants/armv8m.main_hard_fp.json | 40 + .../armv8m.main_hard_fp_exn_rtti.json | 40 + .../json/variants/armv8m.main_soft_nofp.json | 40 + .../armv8m.main_soft_nofp_exn_rtti.json | 40 + .../multilib-generate.py | 6 +- {cmake => arm-multilib}/multilib.yaml.in | 0 arm-runtimes/CMakeLists.txt | 800 ++++++++ arm-runtimes/meson-cross-build.txt.in | 31 + .../test-support}/lit-exec-fvp.py | 0 .../test-support}/lit-exec-qemu.py | 0 .../test-support}/llvm-libc++-picolibc.cfg.in | 6 +- .../llvm-libc++abi-picolibc.cfg.in | 6 +- .../llvm-libunwind-picolibc.cfg.in | 6 +- .../test-support/modify-compiler-rt-xml.py | 54 + .../test-support/modify-picolibc-xml.py | 45 + .../test-support}/picolibc-test-wrapper.py | 0 .../test-support}/run_fvp.py | 0 .../test-support}/run_qemu.py | 0 arm-runtimes/to_meson_list.cmake | 9 + cmake/fetch_llvm.cmake | 33 + cmake/fetch_newlib.cmake | 25 + cmake/fetch_picolibc.cmake | 31 + cmake/read_versions.cmake | 22 + docs/building-from-source.md | 80 + test-support/run-picolibc-tests.py | 116 -- 74 files changed, 3802 insertions(+), 1673 deletions(-) create mode 100644 arm-multilib/CMakeLists.txt create mode 100644 arm-multilib/json/multilib.json create mode 100644 arm-multilib/json/variants/aarch64a.json create mode 100644 arm-multilib/json/variants/aarch64a_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv4t.json create mode 100644 arm-multilib/json/variants/armv4t_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv5te.json create mode 100644 arm-multilib/json/variants/armv5te_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv6m_soft_nofp.json create mode 100644 arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json create mode 100644 arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7a_soft_nofp.json create mode 100644 arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json create mode 100644 arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv5_d16.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv5_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json create mode 100644 arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7m_soft_nofp.json create mode 100644 arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3xd.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7r_soft_nofp.json create mode 100644 arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv7r_soft_vfpv3xd.json create mode 100644 arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json create mode 100644 arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8m.main_hard_fp.json create mode 100644 arm-multilib/json/variants/armv8m.main_hard_fp_exn_rtti.json create mode 100644 arm-multilib/json/variants/armv8m.main_soft_nofp.json create mode 100644 arm-multilib/json/variants/armv8m.main_soft_nofp_exn_rtti.json rename multilib-generate.py => arm-multilib/multilib-generate.py (97%) rename {cmake => arm-multilib}/multilib.yaml.in (100%) create mode 100644 arm-runtimes/CMakeLists.txt create mode 100644 arm-runtimes/meson-cross-build.txt.in rename {test-support => arm-runtimes/test-support}/lit-exec-fvp.py (100%) rename {test-support => arm-runtimes/test-support}/lit-exec-qemu.py (100%) rename {test-support => arm-runtimes/test-support}/llvm-libc++-picolibc.cfg.in (89%) rename {test-support => arm-runtimes/test-support}/llvm-libc++abi-picolibc.cfg.in (86%) rename {test-support => arm-runtimes/test-support}/llvm-libunwind-picolibc.cfg.in (88%) create mode 100644 arm-runtimes/test-support/modify-compiler-rt-xml.py create mode 100644 arm-runtimes/test-support/modify-picolibc-xml.py rename {test-support => arm-runtimes/test-support}/picolibc-test-wrapper.py (100%) rename {test-support => arm-runtimes/test-support}/run_fvp.py (100%) rename {test-support => arm-runtimes/test-support}/run_qemu.py (100%) create mode 100644 arm-runtimes/to_meson_list.cmake create mode 100644 cmake/fetch_llvm.cmake create mode 100644 cmake/fetch_newlib.cmake create mode 100644 cmake/fetch_picolibc.cmake create mode 100644 cmake/read_versions.cmake delete mode 100755 test-support/run-picolibc-tests.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d1bebc0..1f32aa74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,9 +123,13 @@ set(TARGET_LIBRARIES_DIR "lib/clang-runtimes" CACHE STRING "Directory containing the target libraries." ) +set(LLVM_TOOLCHAIN_MULTILIB_JSON + "${CMAKE_CURRENT_SOURCE_DIR}/arm-multilib/json/multilib.json" CACHE STRING + "JSON file defining the multilib." +) set(LLVM_TOOLCHAIN_LIBRARY_VARIANTS - "" CACHE STRING - "Build only the specified library variants. If not specified then build all variants." + "all" CACHE STRING + "Build only the specified library variants, or \"all\"." ) option( LIBS_DEPEND_ON_TOOLS @@ -134,6 +138,13 @@ option( the tools every time you update llvm-project." ON ) +option( + LIBS_USE_COMPILER_LAUNCHER + "Pass CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER + down to the library builds, so that programs such as ccache can + be used to speed up repeated builds. This is not done by default, + as it can also make the inital build slower due to the cold cache." +) option( APPLY_LLVM_PERFORMANCE_PATCHES "During checkout, apply optional downstream patches to @@ -257,82 +268,12 @@ include(ProcessorCount) # # If you want to stop cmake updating the repos then run # cmake . -DFETCHCONTENT_FULLY_DISCONNECTED=ON - -# Read which revisions of the repos to use. -file(READ versions.json VERSIONS_JSON) -function(read_repo_version output_variable_prefix repo) - string(JSON tag GET ${VERSIONS_JSON} "repos" "${repo}" "tag") - string(JSON tagType GET ${VERSIONS_JSON} "repos" "${repo}" "tagType") - if(tagType STREQUAL "commithash") - # GIT_SHALLOW doesn't work with commit hashes. - set(shallow OFF) - elseif(tagType STREQUAL "branch") - set(shallow ON) - # CMake docs recommend that "branch names and tags should - # generally be specified as remote names" - set(tag "origin/${tag}") - elseif(tagType STREQUAL "tag") - set(shallow ON) - else() - message(FATAL_ERROR "Unrecognised tagType ${tagType}") - endif() - - set(${output_variable_prefix}_TAG "${tag}" PARENT_SCOPE) - set(${output_variable_prefix}_SHALLOW "${shallow}" PARENT_SCOPE) -endfunction() -read_repo_version(llvmproject llvm-project) -if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? - read_repo_version(${LLVM_TOOLCHAIN_C_LIBRARY} ${LLVM_TOOLCHAIN_C_LIBRARY}) -endif() - -set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project) -if(APPLY_LLVM_PERFORMANCE_PATCHES) - set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_llvm.py ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project-perf) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fetch_llvm.cmake) +if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fetch_picolibc.cmake) endif() -set( - picolibc_patches - ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0001-Enable-libcxx-builds.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch -) - -FetchContent_Declare(llvmproject - GIT_REPOSITORY https://github.com/llvm/llvm-project.git - GIT_TAG "${llvmproject_TAG}" - GIT_SHALLOW "${llvmproject_SHALLOW}" - GIT_PROGRESS TRUE - PATCH_COMMAND ${LLVM_PATCH_COMMAND} - # Add the llvm subdirectory later to ensure that - # LLVMEmbeddedToolchainForArm is the first project declared. - # Otherwise CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT - # can't be used. - SOURCE_SUBDIR do_not_add_llvm_subdir_yet -) - -FetchContent_Declare(picolibc - GIT_REPOSITORY https://github.com/picolibc/picolibc.git - GIT_TAG "${picolibc_TAG}" - GIT_SHALLOW "${picolibc_SHALLOW}" - GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${picolibc_patches} - # We only want to download the content, not configure it at this - # stage. picolibc will be built in many configurations using - # ExternalProject_Add using the sources that are checked out here. - SOURCE_SUBDIR do_not_add_picolibc_subdir -) - -FetchContent_Declare(newlib - GIT_REPOSITORY https://sourceware.org/git/newlib-cygwin.git - GIT_TAG "${newlib_TAG}" - GIT_SHALLOW "${newlib_SHALLOW}" - GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/newlib.patch - # Similarly to picolibc, we don't do the configuration here. - SOURCE_SUBDIR do_not_add_newlib_subdir -) - -FetchContent_MakeAvailable(llvmproject) -if(NOT (LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc)) # libc in a separate repo? - FetchContent_MakeAvailable(${LLVM_TOOLCHAIN_C_LIBRARY}) +if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fetch_newlib.cmake) endif() ################################################################################################## @@ -354,10 +295,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) endif() ################################################################################################## -# Whether to try to build C++ libraries. (We can't currently do this -# for all choices of C library.) -set(CXX_LIBS ON) - if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) install( FILES @@ -389,8 +326,6 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) DESTINATION samples COMPONENT llvm-toolchain-llvmlibc-configs ) - # We aren't yet able to build C++ libraries to go with llvm-libc - set(CXX_LIBS OFF) # We need to build libc-hdrgen ExternalProject_Add( @@ -411,11 +346,6 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) ExternalProject_Get_property(libc_hdrgen BINARY_DIR) set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - # Add an empty check target, to simplify the logic below that expects to - # find one for every libc type. We have no current setup to run the LLVM - # libc test suite. - add_custom_target(check-llvmlibc) - # LLVM libc lacks a configuration for AArch64, but the AArch32 one works # fine. However, setting the configuration for both architectures to the # arm config directory means the baremetal config.json is never loaded, @@ -539,15 +469,6 @@ llvm_install_symlink(LLVM llvm-ranlib llvm-ar ALWAYS_GENERATE) llvm_install_symlink(LLVM llvm-readelf llvm-readobj ALWAYS_GENERATE) llvm_install_symlink(LLVM llvm-strip llvm-objcopy ALWAYS_GENERATE) -if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc) - # For building picolibc use Meson. - # Although picolibc has support for building with CMake, the Meson code - # is more mature and works better with LLVM. - find_program(MESON_EXECUTABLE meson REQUIRED) -endif() - -include(cmake/to_meson_list.cmake) - # Generate VERSION.txt # Use add_custom_target instead of add_custom_command so that the target # is always considered out-of-date, ensuring that VERSION.txt will be @@ -582,20 +503,6 @@ add_custom_target(llvm-toolchain ALL) # Groups all the runtime targets add_custom_target(llvm-toolchain-runtimes) -# Groups all C++ runtime libraries tests -add_custom_target(check-llvm-toolchain-runtimes) -add_custom_target(check-compiler-rt) -add_custom_target(check-cxxabi) -add_custom_target(check-unwind) -add_custom_target(check-cxx) - -add_dependencies( - check-llvm-toolchain-runtimes - check-cxxabi - check-unwind - check-cxx -) - if(NOT LLVM_TOOLCHAIN_CROSS_BUILD_MINGW) add_dependencies( llvm-toolchain @@ -609,10 +516,6 @@ add_dependencies( version_txt ) -foreach(variant ${LLVM_TOOLCHAIN_LIBRARY_VARIANTS}) - set(enable_${variant} TRUE) -endforeach() - if(LIBS_DEPEND_ON_TOOLS) set(lib_tool_dependencies clang @@ -625,26 +528,20 @@ if(LIBS_DEPEND_ON_TOOLS) ) endif() -set(picolibc_specific_runtimes_options - -DLIBCXXABI_ENABLE_THREADS=OFF - -DLIBCXX_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libc++-picolibc.cfg.in - -DLIBCXXABI_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libc++abi-picolibc.cfg.in - -DLIBCXX_ENABLE_MONOTONIC_CLOCK=OFF - -DLIBCXX_ENABLE_RANDOM_DEVICE=OFF - -DLIBCXX_ENABLE_THREADS=OFF - -DLIBCXX_ENABLE_WIDE_CHARACTERS=OFF - -DLIBUNWIND_ENABLE_THREADS=OFF - -DLIBUNWIND_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libunwind-picolibc.cfg.in -) +add_custom_target(check-llvm-toolchain-runtimes) +add_custom_target(check-${LLVM_TOOLCHAIN_C_LIBRARY}) +add_custom_target(check-compiler-rt) +add_custom_target(check-cxx) +add_custom_target(check-cxxabi) +add_custom_target(check-unwind) -set(newlib_specific_runtimes_options - -DLIBCXXABI_ENABLE_THREADS=OFF - -DLIBCXX_ENABLE_THREADS=OFF - -DLIBCXX_ENABLE_MONOTONIC_CLOCK=OFF - -DLIBCXX_ENABLE_RANDOM_DEVICE=OFF - -DLIBCXX_ENABLE_WIDE_CHARACTERS=ON - -DLIBCXX_ENABLE_LOCALIZATION=OFF - -DLIBUNWIND_ENABLE_THREADS=OFF +add_dependencies( + check-llvm-toolchain-runtimes + check-${LLVM_TOOLCHAIN_C_LIBRARY} + check-compiler-rt + check-cxx + check-cxxabi + check-unwind ) if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) @@ -659,1444 +556,99 @@ else() set(library_subdir "") endif() -add_custom_target(check-picolibc) -# Set LLVM_DEFAULT_EXTERNAL_LIT to the directory of clang -# which was build in previous step. This path is not exported -# by add_subdirectory of llvm project -set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_BINARY_DIR}/bin/llvm-lit") - -add_custom_target(check-newlib) # FIXME: put things in this - -function(get_qemu_params target_triple qemu_machine qemu_cpu qemu_params) - if(target_triple MATCHES "^aarch64") - set(qemu_command "qemu-system-aarch64") - else() - set(qemu_command "qemu-system-arm") - endif() - - # Use colon as a separator because comma and semicolon are used for - # other purposes in CMake. - string(REPLACE " " ":" qemu_params_list "${qemu_params}") - - set( - test_executor_params - --qemu-command ${qemu_command} - --qemu-machine ${qemu_machine}) - if(qemu_cpu) - list(APPEND test_executor_params --qemu-cpu ${qemu_cpu}) - endif() - if(qemu_params_list) - list(APPEND test_executor_params "--qemu-params=${qemu_params_list}") - endif() - set(test_executor_params "${test_executor_params}" PARENT_SCOPE) -endfunction() - -function(get_fvp_params fvp_model fvp_config) - set( - test_executor_params - --fvp-install-dir ${FVP_INSTALL_DIR} - --fvp-config-dir ${FVP_CONFIG_DIR} - --fvp-model ${fvp_model} - ) - string(REPLACE " " ";" fvp_config_list ${fvp_config}) - foreach(cfg ${fvp_config_list}) - set( - test_executor_params - ${test_executor_params} - --fvp-config ${cfg} - ) - endforeach() - set(test_executor_params "${test_executor_params}" PARENT_SCOPE) -endfunction() - -function( - add_picolibc - directory - variant - target_triple - flags - build_type - test_executor_params - default_boot_flash_addr - default_boot_flash_size - default_flash_addr - default_flash_size - default_ram_addr - default_ram_size - default_stack_size - run_tests -) - if(CMAKE_INSTALL_MESSAGE STREQUAL NEVER) - set(MESON_INSTALL_QUIET "--quiet") - endif() - - if(target_triple MATCHES "^aarch64") - set(cpu_family aarch64) - set(enable_long_double_test false) - else() - set(cpu_family arm) - set(enable_long_double_test true) +if(LIBS_USE_COMPILER_LAUNCHER) + if(CMAKE_C_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}") endif() - - if(build_type MATCHES "minsize") - set(newlib_nano_malloc "true") - else() - set(newlib_nano_malloc "false") + if(CMAKE_CXX_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") endif() +endif() - ExternalProject_Add( - picolibc_${variant} - SOURCE_DIR ${picolibc_SOURCE_DIR} - INSTALL_DIR "${LLVM_BINARY_DIR}/${directory}" - PREFIX picolibc/${variant} - DEPENDS ${lib_tool_dependencies} - CONFIGURE_COMMAND - ${MESON_EXECUTABLE} - setup - -Dincludedir=include - -Dlibdir=lib - -Dspecsdir=none - -Dmultilib=false - -Dtests-enable-stack-protector=false - -Dtest-long-double=${enable_long_double_test} - -Dnewlib-nano-malloc=${newlib_nano_malloc} - --prefix - --cross-file /meson-cross-build.txt - --buildtype=${build_type} - - BUILD_COMMAND ${MESON_EXECUTABLE} configure -Dtests=false - COMMAND ${MESON_EXECUTABLE} compile - INSTALL_COMMAND ${MESON_EXECUTABLE} install ${MESON_INSTALL_QUIET} - TEST_COMMAND - ${Python3_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/test-support/run-picolibc-tests.py - --meson-command ${MESON_EXECUTABLE} - --picolibc-build-dir - --picolibc-source-dir - --variant ${variant} - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - TEST_EXCLUDE_FROM_MAIN TRUE - STEP_TARGETS install test - ) - - # Set meson_c_args to a comma-separated list of the clang path - # and flags e.g. 'path/to/clang', '--target=armv6m-none-eabi', - # '-march=armv6m' - separate_arguments(flags) - list(PREPEND flags "${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}") - list(APPEND flags --sysroot "${LLVM_BINARY_DIR}/${directory}") - to_meson_list("${flags}" meson_c_args) - - set(test_executor_bin ${CMAKE_CURRENT_SOURCE_DIR}/test-support/picolibc-test-wrapper.py) - to_meson_list("${test_executor_params}" test_executor_params) - - ExternalProject_Get_Property(picolibc_${variant} BINARY_DIR) - configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/cmake/meson-cross-build.txt.in ${BINARY_DIR}/meson-cross-build.txt @ONLY) - - # Building picolibc tests requires compiler_rt to be installed. - # Building compiler_rt tests requires picolibc to be installed. - # To solve this compiler_rt relies on picolibc to be just installed, not on - # the full target, which would include tests. Picolibc tests, are enabled - # only in tests step, otherwise, they would be built before install. - ExternalProject_Add_StepDependencies(picolibc_${variant} test compiler_rt_${variant}-install) - - if(run_tests) - add_custom_target(check-picolibc-${variant}) - add_dependencies(check-picolibc-${variant} picolibc_${variant}-test) - # Do not add armv4 or armv5 tests to the check-all - # targets as they currently hang. - if(NOT variant MATCHES "armv4|5") - add_dependencies(check-picolibc check-picolibc-${variant}) - add_dependencies(llvm-toolchain-runtimes picolibc_${variant}) - endif() - endif() -endfunction() - -function( - add_newlib - directory - variant - target_triple - flags - test_executor_params - default_boot_flash_addr - default_boot_flash_size - default_flash_addr - default_flash_size - default_ram_addr - default_ram_size - default_stack_size -) - if(target_triple MATCHES "^aarch64") - set(cpu_family aarch64) - else() - set(cpu_family arm) - endif() - - set(sysroot "${LLVM_BINARY_DIR}/${directory}") - - set(build_env - "CC_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang -target ${target_triple} -ffreestanding" - "CXX_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang++ -target ${target_triple} -ffreestanding" - "AR_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ar" - "AS_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-as" - "NM_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-nm" - "OBJDUMP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-objdump" - "RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib" - "READELF_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-readelf" - "STRIP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-strip" - "CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${sysroot}" - "CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${sysroot}" - ) - - set(make_flags) - ProcessorCount(nproc) - if(NOT nproc EQUAL 0) - set(make_flags -j${nproc}) - endif() - - ExternalProject_Add( - newlib_${variant} - SOURCE_DIR ${newlib_SOURCE_DIR} - INSTALL_DIR "${LLVM_BINARY_DIR}/${directory}" - PREFIX newlib/${variant} - DEPENDS ${lib_tool_dependencies} - CONFIGURE_COMMAND - ${CMAKE_COMMAND} -E env ${build_env} - /configure - --target=${target_triple} - --prefix "${sysroot}" - --exec_prefix /tmpinstall - --enable-newlib-io-long-long - --enable-newlib-register-fini - --disable-newlib-supplied-syscalls - --enable-newlib-io-c99-formats - --disable-nls - --enable-lite-exit - --disable-multilib - --enable-newlib-retargetable-locking - BUILD_COMMAND - ${CMAKE_COMMAND} -E env ${build_env} - make ${make_flags} - && - "${LLVM_BINARY_DIR}/bin/llvm-ar" rcs - /${target_triple}/libgloss/${cpu_family}/libcrt0-rdimon.a - /${target_triple}/libgloss/${cpu_family}/rdimon-crt0.o - && - "${LLVM_BINARY_DIR}/bin/llvm-ar" rcs - /${target_triple}/libgloss/${cpu_family}/libcrt0-nosys.a - /${target_triple}/libgloss/${cpu_family}/crt0.o - INSTALL_COMMAND - make install - && - ${CMAKE_COMMAND} -E copy_directory - /tmpinstall/${target_triple} - ${sysroot} - && - ${CMAKE_COMMAND} -E copy - /${target_triple}/libgloss/${cpu_family}/libcrt0-rdimon.a - ${sysroot}/lib - && - ${CMAKE_COMMAND} -E copy - /${target_triple}/libgloss/${cpu_family}/libcrt0-nosys.a - ${sysroot}/lib - # FIXME: TEST_COMMAND? - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - TEST_EXCLUDE_FROM_MAIN TRUE - STEP_TARGETS install # FIXME: test? - ) - - add_dependencies( - llvm-toolchain-runtimes - newlib_${variant} - ) -endfunction() - -function( - add_llvmlibc - directory - variant - target_triple - flags - test_executor_params - default_boot_flash_addr - default_boot_flash_size - default_flash_addr - default_flash_size - default_ram_addr - default_ram_size - default_stack_size -) - get_runtimes_flags("${directory}" "${flags}") - - set(runtimes_flags "${runtimes_flags} -Wno-error=atomic-alignment") - - set(common_cmake_args - -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_ASM_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_ASM_COMPILER_TARGET=${target_triple} - -DCMAKE_ASM_FLAGS=${runtimes_flags} - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_CXX_COMPILER_TARGET=${target_triple} - -DCMAKE_CXX_FLAGS=${runtimes_flags} - -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_C_COMPILER_TARGET=${target_triple} - -DCMAKE_C_FLAGS=${runtimes_flags} - -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} - -DCMAKE_INSTALL_PREFIX= - -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} - # Let CMake know we're cross-compiling - -DCMAKE_SYSTEM_NAME=Generic - -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY - ) - - ExternalProject_Add( - llvmlibc_${variant} - SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes - PREFIX llvmlibc/${variant} - INSTALL_DIR llvmlibc/${variant}/install - DEPENDS ${lib_tool_dependencies} ${libc_target} libc_hdrgen - CMAKE_ARGS - ${common_cmake_args} - -DLIBC_TARGET_TRIPLE=${target_triple} - -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} - -DLIBC_CONFIG_PATH=${LIBC_CFG_DIR} - -DLIBC_CONF_TIME_64BIT=ON - -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON - -DLLVM_ENABLE_RUNTIMES=libc - -DLLVM_INCLUDE_TESTS=OFF # llvmlibc's tests require C++, so can't be built until llvmlibc can support libc++ - -DLLVM_LIBC_FULL_BUILD=ON - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - INSTALL_COMMAND ${CMAKE_COMMAND} --install . - # Copy llvm-libc lib directory, moving libraries out of their - # target-specific subdirectory. - COMMAND - ${CMAKE_COMMAND} - -E copy_directory - /lib/${target_triple} - "${LLVM_BINARY_DIR}/${directory}/lib" - # And copy the include directory, which is already arranged right. - COMMAND - ${CMAKE_COMMAND} - -E copy_directory - /include - "${LLVM_BINARY_DIR}/${directory}/include" - ) - - ExternalProject_Add( - llvmlibc-support_${variant} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvmlibc-support - PREFIX llvmlibc-support/${variant} - INSTALL_DIR "${LLVM_BINARY_DIR}/${directory}" - DEPENDS ${lib_tool_dependencies} llvmlibc_${variant}-install - CMAKE_ARGS ${common_cmake_args} - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - ) - - add_dependencies( - llvm-toolchain-runtimes - llvmlibc_${variant} - llvmlibc-support_${variant} - ) -endfunction() - -macro( - add_libc - directory - variant - target_triple - flags - picolibc_build_type - test_executor_params - default_boot_flash_addr - default_boot_flash_size - default_flash_addr - default_flash_size - default_ram_addr - default_ram_size - default_stack_size - run_tests -) - # It would be nice to just pass ${ARGN} to both the underlying functions, - # but that has the side effect of expanding any list arguments (e.g. - # test_executor_params) into lots of separate words - the same bug that - # $* has in POSIX sh. We want the analogue of "$@" here, but I don't know - # of one for cmake. - if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc) - add_picolibc( - "${directory}" - "${variant}" - "${target_triple}" - "${flags}" - "${picolibc_build_type}" - "${test_executor_params}" - "${default_boot_flash_addr}" - "${default_boot_flash_size}" - "${default_flash_addr}" - "${default_flash_size}" - "${default_ram_addr}" - "${default_ram_size}" - "${default_stack_size}" - "${run_tests}" - ) - elseif(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib) - add_newlib( - "${directory}" - "${variant}" - "${target_triple}" - "${flags}" - "${test_executor_params}" - "${default_boot_flash_addr}" - "${default_boot_flash_size}" - "${default_flash_addr}" - "${default_flash_size}" - "${default_ram_addr}" - "${default_ram_size}" - "${default_stack_size}" - ) - elseif(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) - add_llvmlibc( - "${directory}" - "${variant}" - "${target_triple}" - "${flags}" - "${test_executor_params}" - "${default_boot_flash_addr}" - "${default_boot_flash_size}" - "${default_flash_addr}" - "${default_flash_size}" - "${default_ram_addr}" - "${default_ram_size}" - "${default_stack_size}" - ) - endif() -endmacro() - -function(get_runtimes_flags directory flags) - set(runtimes_flags "${flags} -ffunction-sections -fdata-sections -fno-ident --sysroot ${LLVM_BINARY_DIR}/${directory}" PARENT_SCOPE) -endfunction() - -function( - add_compiler_rt - directory - variant - target_triple - flags - test_executor - libc_target +ExternalProject_Add( + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + PREFIX ${CMAKE_BINARY_DIR}/multilib-builds + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/arm-multilib + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir} + DEPENDS ${lib_tool_dependencies} + CMAKE_ARGS + ${compiler_launcher_cmake_args} + -DC_LIBRARY=${LLVM_TOOLCHAIN_C_LIBRARY} + -DLLVM_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/llvm + -DMULTILIB_JSON=${LLVM_TOOLCHAIN_MULTILIB_JSON} + -DENABLE_VARIANTS=${LLVM_TOOLCHAIN_LIBRARY_VARIANTS} + -DLIBC_HDRGEN=${LIBC_HDRGEN} + -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} + -DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT} + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC} + -DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB} + -DCMAKE_INSTALL_PREFIX= + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + TEST_EXCLUDE_FROM_MAIN TRUE + STEP_TARGETS build install ) - # We can't always put the exact target - # architecture in the triple, because compiler-rt's cmake - # system doesn't recognize every possible Arm architecture - # version. So mostly we just say 'arm' and control the arch - # version via -march=armv7m (or whatever). - # Exceptions are architectures pre-armv7, which compiler-rt expects to - # see in the triple because that's where it looks to decide whether to - # use specific assembly sources. - if(NOT target_triple MATCHES "^(aarch64-none-elf|arm-none-eabi|armv[4-6])") - message(FATAL_ERROR "\ -Target triple name \"${target_triple}\" not compatible with compiler-rt. -Use -march to specify the architecture.") - endif() - # Also, compiler-rt looks in the ABI component of the - # triple to decide whether to use the hard float ABI. - if(flags MATCHES "-mfloat-abi=hard" AND NOT target_triple MATCHES "-eabihf$") - message(FATAL_ERROR "\ -Hard-float library with target triple \"${target_triple}\" must end \"-eabihf\"") - endif() - string(REPLACE "-none-" "-unknown-none-" normalized_target_triple ${target_triple}) - - get_runtimes_flags("${directory}" "${flags}") - - set(compiler_rt_test_flags "${runtimes_flags} -fno-exceptions -fno-rtti -nostartfiles -lcrt0-semihost -lsemihost -T picolibcpp.ld") - if(variant STREQUAL "armv6m_soft_nofp") - set(compiler_rt_test_flags "${compiler_rt_test_flags} -fomit-frame-pointer") - endif() - ExternalProject_Add( - compiler_rt_${variant} - SOURCE_DIR ${llvmproject_SOURCE_DIR}/compiler-rt - PREFIX compiler-rt/${variant} - INSTALL_DIR compiler-rt/${variant}/install - DEPENDS ${lib_tool_dependencies} ${libc_target} - CMAKE_ARGS - -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_ASM_COMPILER_TARGET=${target_triple} - -DCMAKE_ASM_FLAGS=${runtimes_flags} - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_CXX_COMPILER_TARGET=${target_triple} - -DCMAKE_CXX_FLAGS=${runtimes_flags} - -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_C_COMPILER_TARGET=${target_triple} - -DCMAKE_C_FLAGS=${runtimes_flags} - -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} - -DCMAKE_INSTALL_PREFIX= - -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} - # Let CMake know we're cross-compiling - -DCMAKE_SYSTEM_NAME=Generic - -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY - -DCOMPILER_RT_BAREMETAL_BUILD=ON - -DCOMPILER_RT_BUILD_LIBFUZZER=OFF - -DCOMPILER_RT_BUILD_PROFILE=OFF - -DCOMPILER_RT_BUILD_SANITIZERS=OFF - -DCOMPILER_RT_BUILD_XRAY=OFF - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON - -DCOMPILER_RT_INCLUDE_TESTS=ON - -DCOMPILER_RT_EMULATOR=${test_executor} - -DCOMPILER_RT_TEST_COMPILER=${LLVM_BINARY_DIR}/bin/clang - -DCOMPILER_RT_TEST_COMPILER_CFLAGS=${compiler_rt_test_flags} - -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} - -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - INSTALL_COMMAND ${CMAKE_COMMAND} --install . - # Copy compiler-rt lib directory, moving libraries out of their - # target-specific subdirectory. - COMMAND - ${CMAKE_COMMAND} - -E copy_directory - /lib/${normalized_target_triple} - "${LLVM_BINARY_DIR}/${directory}/lib" - ) - - add_dependencies( - llvm-toolchain-runtimes - compiler_rt_${variant} - ) -endfunction() - -function( - add_libcxx_libcxxabi_libunwind - directory - variant - target_triple - flags - test_executor - libc_target - extra_cmake_options - enable_exceptions - enable_rtti +add_dependencies( + llvm-toolchain-runtimes + multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install ) - get_runtimes_flags("${directory}" "${flags}") - set(target_name "libcxx_libcxxabi_libunwind_${variant}") - set(prefix "libcxx_libcxxabi_libunwind/${variant}") - set(instal_dir "${LLVM_BINARY_DIR}/${directory}") - if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL picolibc) - list( - APPEND extra_cmake_options - -DLIBCXXABI_ENABLE_EXCEPTIONS=${enable_exceptions} - -DLIBCXXABI_ENABLE_STATIC_UNWINDER=${enable_exceptions} - -DLIBCXX_ENABLE_EXCEPTIONS=${enable_exceptions} - -DLIBCXX_ENABLE_RTTI=${enable_rtti} - ) - endif() - - ExternalProject_Add( - ${target_name} - SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes - INSTALL_DIR ${instal_dir} - PREFIX ${prefix} - DEPENDS ${lib_tool_dependencies} compiler_rt_${variant} ${libc_target} - CMAKE_ARGS - -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_ASM_FLAGS=${runtimes_flags} - -DCMAKE_BUILD_TYPE=MinSizeRel - -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_CXX_COMPILER_TARGET=${target_triple} - -DCMAKE_CXX_FLAGS=${runtimes_flags} - -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_C_COMPILER_TARGET=${target_triple} - -DCMAKE_C_FLAGS=${runtimes_flags} - -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} - -DCMAKE_INSTALL_PREFIX=${instal_dir} - -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} - -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} - # Let CMake know we're cross-compiling - -DCMAKE_SYSTEM_NAME=Generic - -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY - -DLIBC_LINKER_SCRIPT=picolibcpp.ld - -DLIBCXXABI_BAREMETAL=ON - -DLIBCXXABI_ENABLE_ASSERTIONS=OFF - -DLIBCXXABI_ENABLE_SHARED=OFF - -DLIBCXXABI_ENABLE_STATIC=ON - -DLIBCXXABI_LIBCXX_INCLUDES="${LLVM_BINARY_DIR}/${directory}/include/c++/v1" - -DLIBCXXABI_USE_COMPILER_RT=ON - -DLIBCXXABI_USE_LLVM_UNWINDER=ON - -DLIBCXXABI_TEST_PARAMS=executor=${test_executor} - -DLIBCXXABI_SHARED_OUTPUT_NAME="c++abi-shared" - -DLIBCXX_ABI_UNSTABLE=ON - -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON - -DLIBCXX_ENABLE_FILESYSTEM=OFF - -DLIBCXX_ENABLE_SHARED=OFF - -DLIBCXX_ENABLE_STATIC=ON - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_TEST_PARAMS=executor=${test_executor} - -DLIBCXX_SHARED_OUTPUT_NAME="c++-shared" - -DLIBUNWIND_ENABLE_ASSERTIONS=OFF - -DLIBUNWIND_ENABLE_SHARED=OFF - -DLIBUNWIND_ENABLE_STATIC=ON - -DLIBUNWIND_IS_BAREMETAL=ON - -DLIBUNWIND_REMEMBER_HEAP_ALLOC=ON - -DLIBUNWIND_USE_COMPILER_RT=ON - -DLIBUNWIND_TEST_PARAMS=executor=${test_executor} - -DLIBUNWIND_SHARED_OUTPUT_NAME="unwind-shared" - -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} - -DLLVM_ENABLE_RUNTIMES=libcxxabi,libcxx,libunwind - -DRUNTIME_TEST_ARCH_FLAGS=${flags} - -DRUNTIME_VARIANT_NAME=${variant} - ${extra_cmake_options} - STEP_TARGETS build - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - ) - add_dependencies( - llvm-toolchain-runtimes - ${target_name} - ) -endfunction() - -function(add_compiler_rt_tests variant) +foreach(check_target check-${LLVM_TOOLCHAIN_C_LIBRARY} check-compiler-rt check-cxx check-cxxabi check-unwind) ExternalProject_Add_Step( - compiler_rt_${variant} - check-compiler-rt - COMMAND "${CMAKE_COMMAND}" --build --target check-compiler-rt + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} USES_TERMINAL TRUE EXCLUDE_FROM_MAIN TRUE ALWAYS TRUE ) - ExternalProject_Add_StepTargets(compiler_rt_${variant} check-compiler-rt) + ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}) ExternalProject_Add_StepDependencies( - compiler_rt_${variant} - check-compiler-rt - compiler_rt_${variant}-build + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target} + multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install ) - add_custom_target(check-compiler-rt-${variant}) - add_dependencies(check-compiler-rt-${variant} compiler_rt_${variant}-check-compiler-rt) - # Do not add armv4 or armv5 tests to the check-all - # targets as they currently hang. - if(NOT variant MATCHES "armv4|5") - add_dependencies(check-compiler-rt check-compiler-rt-${variant}) - endif() - add_dependencies(check-llvm-toolchain-runtimes-${variant} check-compiler-rt-${variant}) -endfunction() + add_dependencies(${check_target} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}) +endforeach() + +# Read the json to generate variant specific target names for convenience. +file(READ ${LLVM_TOOLCHAIN_MULTILIB_JSON} multilib_json_str) +string(JSON multilib_defs GET ${multilib_json_str} "libs") -function(add_libcxx_libcxxabi_libunwind_tests variant) - set(target_name "libcxx_libcxxabi_libunwind_${variant}") - set(variant_with_extensions "${variant}") - foreach(check_target check-cxxabi check-unwind check-cxx) +string(JSON lib_count LENGTH ${multilib_defs}) +math(EXPR lib_count_dec "${lib_count} - 1") + +foreach(lib_idx RANGE ${lib_count_dec}) + string(JSON lib_def GET ${multilib_defs} ${lib_idx}) + string(JSON variant GET ${lib_def} "variant") + foreach(check_target check-${LLVM_TOOLCHAIN_C_LIBRARY} check-compiler-rt check-cxx check-cxxabi check-unwind) ExternalProject_Add_Step( - ${target_name} - ${check_target} - COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target}-${variant} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target}-${variant} USES_TERMINAL TRUE EXCLUDE_FROM_MAIN TRUE ALWAYS TRUE ) - ExternalProject_Add_StepTargets(${target_name} ${check_target}) + ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}-${variant}) ExternalProject_Add_StepDependencies( - ${target_name} - ${check_target} - ${target_name}-build - ) - add_custom_target(${check_target}-${variant_with_extensions}) - add_dependencies(${check_target}-${variant_with_extensions} ${target_name}-${check_target}) - # Do not add armv4 or armv5 tests to the check-all - # targets as they currently hang. - if(NOT variant MATCHES "armv4|5") - add_dependencies(${check_target} ${target_name}-${check_target}) - endif() - add_dependencies(check-llvm-toolchain-runtimes-${variant} ${check_target}-${variant_with_extensions}) - endforeach() -endfunction() - -function(get_compiler_rt_target_triple target_arch flags) - if(target_arch MATCHES "^aarch64") - set(target_triple "aarch64-none-elf") - else() - # Choose the target triple so that compiler-rt will do the - # right thing. We can't always put the exact target - # architecture in the triple, because compiler-rt's cmake - # system doesn't recognize every possible Arm architecture - # version. So mostly we just say 'arm' and control the arch - # version via -march=armv7m (or whatever). - # Exceptions are architectures pre-armv7, which compiler-rt expects to - # see in the triple because that's where it looks to decide whether to - # use specific assembly sources. - if(target_arch MATCHES "^armv[4-6]") - set(target_triple "${target_arch}-none-eabi") - else() - set(target_triple "arm-none-eabi") - endif() - if(flags MATCHES "-mfloat-abi=hard") - # Also, compiler-rt looks in the ABI component of the - # triple to decide whether to use the hard float ABI. - set(target_triple "${target_triple}hf") - endif() - endif() - set(target_triple "${target_triple}" PARENT_SCOPE) -endfunction() - -function(add_library_variant target_arch) - set( - one_value_args - SUFFIX - COMPILE_FLAGS - MULTILIB_FLAGS - PICOLIBC_BUILD_TYPE - EXECUTOR - QEMU_MACHINE - QEMU_CPU - QEMU_PARAMS - FVP_MODEL - FVP_CONFIG - BOOT_FLASH_ADDRESS - BOOT_FLASH_SIZE - FLASH_ADDRESS - FLASH_SIZE - RAM_ADDRESS - RAM_SIZE - STACK_SIZE - ENABLE_EXCEPTIONS - ENABLE_RTTI - ) - cmake_parse_arguments(VARIANT "" "${one_value_args}" "" ${ARGN}) - - if(VARIANT_SUFFIX) - set(variant "${target_arch}_${VARIANT_SUFFIX}") - else() - set(variant "${target_arch}") - endif() - - if(NOT VARIANT_ENABLE_EXCEPTIONS) - set(VARIANT_MULTILIB_FLAGS "${VARIANT_MULTILIB_FLAGS} -fno-exceptions") - endif() - - if(NOT VARIANT_ENABLE_RTTI) - set(VARIANT_MULTILIB_FLAGS "${VARIANT_MULTILIB_FLAGS} -fno-rtti") - endif() - - if(LLVM_TOOLCHAIN_LIBRARY_VARIANTS) - if(NOT enable_${variant}) - message("Disabling library variant ${variant}") - return() - else() - message("Enabling library variant ${variant}") - endif() - endif() - - if(target_arch MATCHES "^aarch64") - set(parent_dir_name aarch64-none-elf) - else() - set(parent_dir_name arm-none-eabi) - endif() - - get_compiler_rt_target_triple("${target_arch}" "${VARIANT_COMPILE_FLAGS}") - - set(directory "${TARGET_LIBRARIES_DIR}${library_subdir}/${parent_dir_name}/${variant}") - set(VARIANT_COMPILE_FLAGS "--target=${target_triple} ${VARIANT_COMPILE_FLAGS}") - - if(VARIANT_EXECUTOR STREQUAL "fvp") - if(EXISTS "${FVP_INSTALL_DIR}") - get_fvp_params( - "${VARIANT_FVP_MODEL}" - "${VARIANT_FVP_CONFIG}" - ) - set( - lit_test_executor - ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-fvp.py - ${test_executor_params} - ) - set(have_executor TRUE) - else() - set(have_executor FALSE) - endif() - else() - get_qemu_params( - "${target_triple}" - "${VARIANT_QEMU_MACHINE}" - "${VARIANT_QEMU_CPU}" - "${VARIANT_QEMU_PARAMS}" + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target}-${variant} + multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install ) - set( - lit_test_executor - ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-qemu.py - ${test_executor_params} - ) - set(have_executor TRUE) - endif() - list(JOIN lit_test_executor " " lit_test_executor) - if(NOT PREBUILT_TARGET_LIBRARIES) - add_libc( - "${directory}" - "${variant}" - "${target_triple}" - "${VARIANT_COMPILE_FLAGS}" - "${VARIANT_PICOLIBC_BUILD_TYPE}" - "${test_executor_params}" - "${VARIANT_BOOT_FLASH_ADDRESS}" - "${VARIANT_BOOT_FLASH_SIZE}" - "${VARIANT_FLASH_ADDRESS}" - "${VARIANT_FLASH_SIZE}" - "${VARIANT_RAM_ADDRESS}" - "${VARIANT_RAM_SIZE}" - "${VARIANT_STACK_SIZE}" - "${have_executor}" - ) - add_compiler_rt( - "${directory}" - "${variant}" - "${target_triple}" - "${VARIANT_COMPILE_FLAGS}" - "${lit_test_executor}" - "${LLVM_TOOLCHAIN_C_LIBRARY}_${variant}-install" - ) - if(CXX_LIBS) - add_libcxx_libcxxabi_libunwind( - "${directory}" - "${variant}" - "${target_triple}" - "${VARIANT_COMPILE_FLAGS}" - "${lit_test_executor}" - "${LLVM_TOOLCHAIN_C_LIBRARY}_${variant}-install" - "${${LLVM_TOOLCHAIN_C_LIBRARY}_specific_runtimes_options}" - ${VARIANT_ENABLE_EXCEPTIONS} - ${VARIANT_ENABLE_RTTI} - ) - endif() - if(NOT have_executor) - message("All library tests disabled for ${variant}, due to missing executor") - elseif(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8") - message("C++ runtime libraries tests disabled for ${variant}") - else() - add_custom_target(check-llvm-toolchain-runtimes-${variant}) - # Do not add armv4 or armv5 tests to the check-all - # targets as they currently hang. - if(NOT variant MATCHES "armv4|5") - add_dependencies(check-llvm-toolchain-runtimes check-llvm-toolchain-runtimes-${variant}) - endif() - add_compiler_rt_tests("${variant}") - if(CXX_LIBS) - add_libcxx_libcxxabi_libunwind_tests("${variant}") - endif() - endif() - endif() - - string(APPEND multilib_yaml_content "- Dir: ${parent_dir_name}/${variant}\n") - - string(APPEND multilib_yaml_content " Flags:\n") - string(REPLACE " " ";" multilib_flags_list ${VARIANT_MULTILIB_FLAGS}) - foreach(flag ${multilib_flags_list}) - string(APPEND multilib_yaml_content " - ${flag}\n") + add_custom_target(${check_target}-${variant}) + add_dependencies(${check_target}-${variant} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}-${variant}) endforeach() - string(APPEND multilib_yaml_content " Group: stdlibs\n") - - install( - DIRECTORY "${LLVM_BINARY_DIR}/${directory}/" - DESTINATION "${directory}" - COMPONENT llvm-toolchain-libs - ) - set(multilib_yaml_content "${multilib_yaml_content}" PARENT_SCOPE) -endfunction() - -function(add_nonexistent_library_variant) - set( - one_value_args - MULTILIB_FLAGS - ERROR_MESSAGE - ) - cmake_parse_arguments(ERR "" "${one_value_args}" "" ${ARGN}) - - string(APPEND multilib_yaml_content "- Error: \"${ERR_ERROR_MESSAGE}\"\n") - - string(APPEND multilib_yaml_content " Flags:\n") - string(REPLACE " " ";" multilib_flags_list ${ERR_MULTILIB_FLAGS}) - foreach(flag ${multilib_flags_list}) - string(APPEND multilib_yaml_content " - ${flag}\n") - endforeach() - string(APPEND multilib_yaml_content " Group: stdlibs\n") - - set(multilib_yaml_content "${multilib_yaml_content}" PARENT_SCOPE) -endfunction() - -function(add_library_variants_for_cpu target_arch) - set( - one_value_args - SUFFIX - COMPILE_FLAGS - MULTILIB_FLAGS - PICOLIBC_BUILD_TYPE - EXECUTOR - QEMU_MACHINE - QEMU_CPU - QEMU_PARAMS - FVP_MODEL - FVP_CONFIG - BOOT_FLASH_ADDRESS - BOOT_FLASH_SIZE - FLASH_ADDRESS - FLASH_SIZE - RAM_ADDRESS - RAM_SIZE - STACK_SIZE - ) - cmake_parse_arguments(VARIANT "" "${one_value_args}" "" ${ARGN}) - - # Variant with no exceptions needs to come later in multilib.yaml to - # take priority. - foreach(enable_exceptions_and_rtti IN ITEMS ON OFF) - set(SUFFIXES) - if(VARIANT_SUFFIX) - list(APPEND SUFFIXES ${VARIANT_SUFFIX}) - endif() - if(enable_exceptions_and_rtti) - list(APPEND SUFFIXES "exn") - list(APPEND SUFFIXES "rtti") - endif() - list(JOIN SUFFIXES "_" COMBINED_SUFFIX) - - add_library_variant( - "${target_arch}" - SUFFIX "${COMBINED_SUFFIX}" - COMPILE_FLAGS "${VARIANT_COMPILE_FLAGS}" - MULTILIB_FLAGS "${VARIANT_MULTILIB_FLAGS}" - PICOLIBC_BUILD_TYPE "${VARIANT_PICOLIBC_BUILD_TYPE}" - EXECUTOR "${VARIANT_EXECUTOR}" - QEMU_MACHINE "${VARIANT_QEMU_MACHINE}" - QEMU_CPU "${VARIANT_QEMU_CPU}" - QEMU_PARAMS "${VARIANT_QEMU_PARAMS}" - FVP_MODEL "${VARIANT_FVP_MODEL}" - FVP_CONFIG "${VARIANT_FVP_CONFIG}" - BOOT_FLASH_ADDRESS "${VARIANT_BOOT_FLASH_ADDRESS}" - BOOT_FLASH_SIZE "${VARIANT_BOOT_FLASH_SIZE}" - FLASH_ADDRESS "${VARIANT_FLASH_ADDRESS}" - FLASH_SIZE "${VARIANT_FLASH_SIZE}" - RAM_ADDRESS "${VARIANT_RAM_ADDRESS}" - RAM_SIZE "${VARIANT_RAM_SIZE}" - STACK_SIZE "${VARIANT_STACK_SIZE}" - ENABLE_EXCEPTIONS "${enable_exceptions_and_rtti}" - ENABLE_RTTI "${enable_exceptions_and_rtti}" - ) - endforeach() - - set(multilib_yaml_content "${multilib_yaml_content}" PARENT_SCOPE) -endfunction() - -set(multilib_yaml_content "") - -# Define which library variants to build and which flags to use. -# For most variants, the "flash" memory is placed in address range, where -# simulated boards have RAM. This is because code for some tests does not fit -# the real flash. -add_library_variants_for_cpu( - aarch64a - COMPILE_FLAGS "-march=armv8-a" - MULTILIB_FLAGS "--target=aarch64-unknown-none-elf" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "virt" - QEMU_CPU "cortex-a57" - BOOT_FLASH_ADDRESS 0x40000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x40001000 - FLASH_SIZE 0xfff000 - RAM_ADDRESS 0x41000000 - RAM_SIZE 0x1000000 - STACK_SIZE 8K -) -# For AArch32, clang uses different defaults for FPU selection than GCC, both -# when "+fp" or "+fp.dp" are used and when no FPU specifier is provided in -# "-march=". Using "-mfpu=" explicitly. -add_library_variants_for_cpu( - armv4t - COMPILE_FLAGS "-march=armv4t -mfpu=none" - MULTILIB_FLAGS "--target=armv4t-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "none" - QEMU_CPU "ti925t" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv5te - COMPILE_FLAGS "-march=armv5te -mfpu=none" - MULTILIB_FLAGS "--target=armv5e-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "none" - QEMU_CPU "arm926" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv6m - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv6m -mfpu=none" - MULTILIB_FLAGS "--target=thumbv6m-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an385" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x21000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x21600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7a - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv7a -mfpu=none" - MULTILIB_FLAGS "--target=armv7-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-a7" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7a - SUFFIX hard_vfpv3_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16" - MULTILIB_FLAGS "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-a8" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7a - SUFFIX soft_vfpv3_d16 - COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16" - MULTILIB_FLAGS "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-a8" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7r - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv7r -mfpu=none" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-r5f" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7r - SUFFIX hard_vfpv3xd - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-r5f" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7r - SUFFIX hard_vfpv3_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-r5f" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7r - SUFFIX soft_vfpv3xd - COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd" - MULTILIB_FLAGS "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "none" - QEMU_CPU "cortex-r5f" - QEMU_PARAMS "-m 1G" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x20000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x21000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7m - SUFFIX soft_fpv4_sp_d16 - COMPILE_FLAGS "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16" - MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an386" - QEMU_CPU "cortex-m4" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x21000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x21600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7m - SUFFIX hard_fpv4_sp_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16" - MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an386" - QEMU_CPU "cortex-m4" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x21000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x21600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv7m - SUFFIX hard_fpv5_d16 - COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv5-d16" - MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an500" - QEMU_CPU "cortex-m7" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x60600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -# When no -mfpu=none is specified, the compiler internally adds all other -# possible fpu settings before searching for matching variants. So for the -# no-fpu variant to win, it has to be in multilab.yaml after all other -# fpu variants. The order of variants in multilab.yaml depends on the order -# of the add_library_variant calls. So the add_library_variant that adds -# the soft_nofp for armv7m is placed after all other armv7m variants. -add_library_variants_for_cpu( - armv7m - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv7m -mfpu=none" - MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "minsize" - QEMU_MACHINE "mps2-an386" - QEMU_CPU "cortex-m4" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x21000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x21600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8m.main - SUFFIX soft_nofp - COMPILE_FLAGS "-mfloat-abi=soft -march=armv8m.main -mfpu=none" - MULTILIB_FLAGS "--target=thumbv8m.main-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps2-an505" - QEMU_CPU "cortex-m33" - BOOT_FLASH_ADDRESS 0x10000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x80000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x80600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8m.main - SUFFIX hard_fp - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8m.main -mfpu=fpv5-sp-d16" - MULTILIB_FLAGS "--target=thumbv8m.main-unknown-none-eabihf -mfpu=fpv5-sp-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps2-an505" - QEMU_CPU "cortex-m33" - BOOT_FLASH_ADDRESS 0x10000000 - BOOT_FLASH_SIZE 0x1000 - FLASH_ADDRESS 0x80000000 - FLASH_SIZE 0x600000 - RAM_ADDRESS 0x80600000 - RAM_SIZE 0xa00000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX soft_nofp_nomve - COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve -mfpu=none" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_fp_nomve - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-sp-d16" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_fpdp_nomve - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-d16" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_nofp_mve - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none" - PICOLIBC_BUILD_TYPE "release" - QEMU_MACHINE "mps3-an547" - QEMU_CPU "cortex-m55" - BOOT_FLASH_ADDRESS 0x00000000 - BOOT_FLASH_SIZE 512K - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_nonexistent_library_variant( - # We don't build any MVE-capable libraries with the soft-float ABI. - # We do have Armv7-M soft-float libraries, but you can't fall back to - # using those, because MVE requires the FPSCR to be set up specially - # at startup time, and our v7-M soft-float libraries don't do that. - # - # So, rather than select one of those libraries and silently generate - # wrong MVE code, we force an error report instead. - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -march=thumbv8.1m.main+mve" - ERROR_MESSAGE "No library available for MVE with soft-float ABI. Try -mfloat-abi=hard." -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX soft_nofp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=pac-ret+bti" - PICOLIBC_BUILD_TYPE "release" - EXECUTOR fvp - FVP_MODEL corstone-310 - FVP_CONFIG "cortex-m85 m-pacbti m-nofp mve-none" - BOOT_FLASH_ADDRESS 0x01000000 - BOOT_FLASH_SIZE 2M - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_fp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" - PICOLIBC_BUILD_TYPE "release" - EXECUTOR fvp - FVP_MODEL corstone-310 - FVP_CONFIG "cortex-m85 m-pacbti m-fp mve-none" - BOOT_FLASH_ADDRESS 0x01000000 - BOOT_FLASH_SIZE 2M - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_fpdp_nomve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" - PICOLIBC_BUILD_TYPE "release" - EXECUTOR fvp - FVP_MODEL corstone-310 - FVP_CONFIG "cortex-m85 m-pacbti m-fp mve-none" - BOOT_FLASH_ADDRESS 0x01000000 - BOOT_FLASH_SIZE 2M - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) -add_library_variants_for_cpu( - armv8.1m.main - SUFFIX hard_nofp_mve_pacret_bti - COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti" - MULTILIB_FLAGS "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti" - PICOLIBC_BUILD_TYPE "release" - EXECUTOR fvp - FVP_MODEL corstone-310 - FVP_CONFIG "cortex-m85 m-pacbti m-nofp mve-int" - BOOT_FLASH_ADDRESS 0x01000000 - BOOT_FLASH_SIZE 2M - FLASH_ADDRESS 0x60000000 - FLASH_SIZE 0x1000000 - RAM_ADDRESS 0x61000000 - RAM_SIZE 0x1000000 - STACK_SIZE 4K -) - - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/multilib.yaml.in - ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml - @ONLY -) - -set(multilib_yaml_depends - "${CMAKE_CURRENT_SOURCE_DIR}/multilib-generate.py" - "${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml" -) -if(LIBS_DEPEND_ON_TOOLS) - list(APPEND multilib_yaml_depends clang) -endif() - -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml - ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml - COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/multilib-generate.py" - "--clang=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}" - "--llvm-source=${llvmproject_SOURCE_DIR}" - >> "${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml" - DEPENDS ${multilib_yaml_depends} -) -add_custom_target(multilib_yaml ALL DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml) -add_dependencies(llvm-toolchain-runtimes multilib_yaml) +endforeach() install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir}/multilib.yaml - DESTINATION ${TARGET_LIBRARIES_DIR}${library_subdir} + DIRECTORY ${LLVM_BINARY_DIR}/${TARGET_LIBRARIES_DIR}/. + DESTINATION ${TARGET_LIBRARIES_DIR} COMPONENT llvm-toolchain-libs ) diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt new file mode 100644 index 00000000..a27bf752 --- /dev/null +++ b/arm-multilib/CMakeLists.txt @@ -0,0 +1,282 @@ +# +# Copyright (c) 2024, Arm Limited and affiliates. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# CMake build for a multilib layout of library variants, with each +# variant in a subdirectory and a multilib.yaml file to map flags to +# a variant. + +cmake_minimum_required(VERSION 3.20) + +project(arm-multilib) + +# Root directory of the repo. +set(TOOLCHAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) + +# Cache variables to be set by user +set(MULTILIB_JSON "" CACHE STRING "JSON file to load library definitions from.") +set(ENABLE_VARIANTS "all" CACHE STRING "Semicolon separated list of variants to build, or \"all\". Must match entries in the json.") +set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") +set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) +set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.") +set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") +set( + FVP_INSTALL_DIR + "" CACHE STRING + "The directory in which the FVP models are installed. These are not + included in this repository, but can be downloaded by the script + fvp/get_fvps.sh" +) +set(FVP_CONFIG_DIR "${TOOLCHAIN_SOURCE_DIR}/fvp/config" CACHE STRING "The directory in which the FVP models are installed.") + +# If a compiler launcher such as ccache has been set, it should be +# passed down to each subproject build. +set(compiler_launcher_cmake_args "") +if(CMAKE_C_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}") +endif() +if(CMAKE_CXX_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") +endif() + +# Arguments to pass down to the library projects. +foreach(arg + LLVM_BINARY_DIR + LIBC_HDRGEN + FVP_INSTALL_DIR + FVP_CONFIG_DIR +) + if(${arg}) + list(APPEND passthrough_dirs "-D${arg}=${${arg}}") + endif() +endforeach() + +include(ExternalProject) +include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_llvm.cmake) +list(APPEND passthrough_dirs "-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT}") +if(C_LIBRARY STREQUAL picolibc) + include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_picolibc.cmake) + list(APPEND passthrough_dirs "-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC}") +elseif(C_LIBRARY STREQUAL newlib) + include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_newlib.cmake) + list(APPEND passthrough_dirs "-DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB}") +endif() + +# Target for any dependencies to build the runtimes project. +add_custom_target(runtimes-depends) + +# If building llvm-libc, ensure libc-hdrgen is available. +if(C_LIBRARY STREQUAL llvmlibc) + if(NOT LIBC_HDRGEN) + if(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + else() + ExternalProject_Add( + libc_hdrgen + SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm + CMAKE_ARGS + -DLLVM_ENABLE_RUNTIMES=libc + -DLLVM_LIBC_FULL_BUILD=ON + -DCMAKE_BUILD_TYPE=Debug + BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen + INSTALL_COMMAND ${CMAKE_COMMAND} -E true + CONFIGURE_HANDLED_BY_BUILD TRUE + ) + ExternalProject_Get_property(libc_hdrgen BINARY_DIR) + set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + add_dependencies(runtimes-depends libc_hdrgen) + endif() + endif() + list(APPEND passthrough_dirs "-DLIBC_HDRGEN=${LIBC_HDRGEN}") +endif() + +# Create one target to run all the tests. +add_custom_target(check-${C_LIBRARY}) +add_custom_target(check-compiler-rt) +add_custom_target(check-cxx) +add_custom_target(check-cxxabi) +add_custom_target(check-unwind) + +add_custom_target(check-all) +add_dependencies( + check-all + check-${C_LIBRARY} + check-compiler-rt + check-cxx + check-cxxabi + check-unwind +) + +# Read the JSON file to load a multilib configuration. +file(READ ${MULTILIB_JSON} multilib_json_str) +string(JSON multilib_defs GET ${multilib_json_str} "libs") + +string(JSON lib_count LENGTH ${multilib_defs}) +math(EXPR lib_count_dec "${lib_count} - 1") + +foreach(lib_idx RANGE ${lib_count_dec}) + string(JSON lib_def GET ${multilib_defs} ${lib_idx}) + string(JSON variant GET ${lib_def} "variant") + + if(variant IN_LIST ENABLE_VARIANTS OR ENABLE_VARIANTS STREQUAL "all") + string(JSON variant_multilib_flags GET ${lib_def} "flags") + # Placeholder libraries won't have a json, so store the error in + # a variable so a fatal error isn't generated. + string(JSON variant_json ERROR_VARIABLE json_error GET ${lib_def} "json") + + if(NOT variant_json STREQUAL "json-NOTFOUND") + # Sort by target triple + if(variant MATCHES "^aarch64") + set(parent_dir_name aarch64-none-elf) + else() + set(parent_dir_name arm-none-eabi) + endif() + set(destination_directory "${CMAKE_CURRENT_BINARY_DIR}/multilib/${parent_dir_name}/${variant}") + install( + DIRECTORY ${destination_directory} + DESTINATION ${parent_dir_name} + ) + set(variant_json_file ${CMAKE_CURRENT_SOURCE_DIR}/json/variants/${variant_json}) + + ExternalProject_Add( + runtimes-${variant} + PREFIX ${CMAKE_BINARY_DIR}/lib-builds + SOURCE_DIR ${TOOLCHAIN_SOURCE_DIR}/arm-runtimes + INSTALL_DIR ${destination_directory} + DEPENDS runtimes-depends + CMAKE_ARGS + ${compiler_launcher_cmake_args} + ${passthrough_dirs} + -DVARIANT_JSON=${variant_json_file} + -DC_LIBRARY=${C_LIBRARY} + -DCMAKE_INSTALL_PREFIX= + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + TEST_EXCLUDE_FROM_MAIN TRUE + ) + + # Read info from the variant specific json. + # From the json, check which tests are enabled. + file(READ ${variant_json_file} variant_json_str) + foreach(test_enable_var + ENABLE_LIBC_TESTS + ENABLE_COMPILER_RT_TESTS + ENABLE_LIBCXX_TESTS + ) + string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" ${C_LIBRARY} ${test_enable_var}) + if(read_${test_enable_var} STREQUAL "json-NOTFOUND") + string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" "common" ${test_enable_var}) + if(read_${test_enable_var} STREQUAL "json-NOTFOUND") + set(read_${test_enable_var} "OFF") + endif() + endif() + endforeach() + set(check_targets "") + if(read_ENABLE_LIBC_TESTS) + list(APPEND check_targets check-${C_LIBRARY}) + endif() + if(read_ENABLE_COMPILER_RT_TESTS) + list(APPEND check_targets check-compiler-rt) + endif() + if(read_ENABLE_LIBCXX_TESTS) + list(APPEND check_targets check-cxx) + list(APPEND check_targets check-cxxabi) + list(APPEND check_targets check-unwind) + endif() + foreach(check_target ${check_targets}) + ExternalProject_Add_Step( + runtimes-${variant} + ${check_target} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + ) + ExternalProject_Add_StepTargets(runtimes-${variant} ${check_target}) + ExternalProject_Add_StepDependencies( + runtimes-${variant} + ${check_target} + runtimes-${variant}-build + ) + add_custom_target(${check_target}-${variant}) + add_dependencies(${check_target} runtimes-${variant}-${check_target}) + add_dependencies(${check_target}-${variant} runtimes-${variant}-${check_target}) + endforeach() + + # Add the variant to the multilib yaml + string(APPEND multilib_yaml_content "- Dir: ${parent_dir_name}/${variant}\n") + string(APPEND multilib_yaml_content " Flags:\n") + string(REPLACE " " ";" multilib_flags_list ${variant_multilib_flags}) + foreach(flag ${multilib_flags_list}) + string(APPEND multilib_yaml_content " - ${flag}\n") + endforeach() + string(APPEND multilib_yaml_content " Group: stdlibs\n") + else() + # In place of a json, an error message is expected. + string(JSON variant_error_msg GET ${lib_def} "error") + + string(APPEND multilib_yaml_content "- Error: \"${variant_error_msg}\"\n") + string(APPEND multilib_yaml_content " Flags:\n") + string(REPLACE " " ";" multilib_flags_list ${variant_multilib_flags}) + foreach(flag ${multilib_flags_list}) + string(APPEND multilib_yaml_content " - ${flag}\n") + endforeach() + string(APPEND multilib_yaml_content " Group: stdlibs\n") + endif() + endif() + +endforeach() + +# Multilib file is generated in two parts. +# 1. Template is filled with multilib flags from json +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/multilib.yaml.in + ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml + @ONLY +) + +# 2. multilib-generate.py maps compiler command line options to flags +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/multilib-fpus.yaml + COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/multilib-generate.py" + "--clang=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}" + "--llvm-source=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT}" + >> ${CMAKE_CURRENT_BINARY_DIR}/multilib-fpus.yaml +) + +# Combine the two parts. +add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml + COMMAND + ${CMAKE_COMMAND} -E cat + ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml + ${CMAKE_CURRENT_BINARY_DIR}/multilib-fpus.yaml + > ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/multilib-without-fpus.yaml + ${CMAKE_CURRENT_BINARY_DIR}/multilib-fpus.yaml +) + +add_custom_target(multilib-yaml ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/multilib/multilib.yaml + DESTINATION . +) diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json new file mode 100644 index 00000000..7f675317 --- /dev/null +++ b/arm-multilib/json/multilib.json @@ -0,0 +1,259 @@ +{ + "libs": [ + { + "variant": "aarch64a_exn_rtti", + "json": "aarch64a_exn_rtti.json", + "flags": "--target=aarch64-unknown-none-elf" + }, + { + "variant": "aarch64a", + "json": "aarch64a.json", + "flags": "--target=aarch64-unknown-none-elf -fno-exceptions -fno-rtti" + }, + { + "variant": "armv4t_exn_rtti", + "json": "armv4t_exn_rtti.json", + "flags": "--target=armv4t-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv4t", + "json": "armv4t.json", + "flags": "--target=armv4t-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv5te_exn_rtti", + "json": "armv5te_exn_rtti.json", + "flags": "--target=armv5e-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv5te", + "json": "armv5te.json", + "flags": "--target=armv5e-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv6m_soft_nofp_exn_rtti", + "json": "armv6m_soft_nofp_exn_rtti.json", + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv6m_soft_nofp", + "json": "armv6m_soft_nofp.json", + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7a_soft_nofp_exn_rtti", + "json": "armv7a_soft_nofp_exn_rtti.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv7a_soft_nofp", + "json": "armv7a_soft_nofp.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7a_hard_vfpv3_d16_exn_rtti", + "json": "armv7a_hard_vfpv3_d16_exn_rtti.json", + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16" + }, + { + "variant": "armv7a_hard_vfpv3_d16", + "json": "armv7a_hard_vfpv3_d16.json", + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7a_soft_vfpv3_d16_exn_rtti", + "json": "armv7a_soft_vfpv3_d16_exn_rtti.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16" + }, + { + "variant": "armv7a_soft_vfpv3_d16", + "json": "armv7a_soft_vfpv3_d16.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7r_soft_nofp_exn_rtti", + "json": "armv7r_soft_nofp_exn_rtti.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv7r_soft_nofp", + "json": "armv7r_soft_nofp.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7r_hard_vfpv3xd_exn_rtti", + "json": "armv7r_hard_vfpv3xd_exn_rtti.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" + }, + { + "variant": "armv7r_hard_vfpv3xd", + "json": "armv7r_hard_vfpv3xd.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7r_hard_vfpv3_d16_exn_rtti", + "json": "armv7r_hard_vfpv3_d16_exn_rtti.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" + }, + { + "variant": "armv7r_hard_vfpv3_d16", + "json": "armv7r_hard_vfpv3_d16.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7r_soft_vfpv3xd_exn_rtti", + "json": "armv7r_soft_vfpv3xd_exn_rtti.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd" + }, + { + "variant": "armv7r_soft_vfpv3xd", + "json": "armv7r_soft_vfpv3xd.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7m_soft_fpv4_sp_d16_exn_rtti", + "json": "armv7m_soft_fpv4_sp_d16_exn_rtti.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16" + }, + { + "variant": "armv7m_soft_fpv4_sp_d16", + "json": "armv7m_soft_fpv4_sp_d16.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7m_hard_fpv4_sp_d16_exn_rtti", + "json": "armv7m_hard_fpv4_sp_d16_exn_rtti.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16" + }, + { + "variant": "armv7m_hard_fpv4_sp_d16", + "json": "armv7m_hard_fpv4_sp_d16.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7m_hard_fpv5_d16_exn_rtti", + "json": "armv7m_hard_fpv5_d16_exn_rtti.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16" + }, + { + "variant": "armv7m_hard_fpv5_d16", + "json": "armv7m_hard_fpv5_d16.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv7m_soft_nofp_exn_rtti", + "json": "armv7m_soft_nofp_exn_rtti.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv7m_soft_nofp", + "json": "armv7m_soft_nofp.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8m.main_soft_nofp_exn_rtti", + "json": "armv8m.main_soft_nofp_exn_rtti.json", + "flags": "--target=thumbv8m.main-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv8m.main_soft_nofp", + "json": "armv8m.main_soft_nofp.json", + "flags": "--target=thumbv8m.main-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8m.main_hard_fp_exn_rtti", + "json": "armv8m.main_hard_fp_exn_rtti.json", + "flags": "--target=thumbv8m.main-unknown-none-eabihf -mfpu=fpv5-sp-d16" + }, + { + "variant": "armv8m.main_hard_fp", + "json": "armv8m.main_hard_fp.json", + "flags": "--target=thumbv8m.main-unknown-none-eabihf -mfpu=fpv5-sp-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_soft_nofp_nomve_exn_rtti", + "json": "armv8.1m.main_soft_nofp_nomve_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armv8.1m.main_soft_nofp_nomve", + "json": "armv8.1m.main_soft_nofp_nomve.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_fp_nomve_exn_rtti", + "json": "armv8.1m.main_hard_fp_nomve_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16" + }, + { + "variant": "armv8.1m.main_hard_fp_nomve", + "json": "armv8.1m.main_hard_fp_nomve.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_fpdp_nomve_exn_rtti", + "json": "armv8.1m.main_hard_fpdp_nomve_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16" + }, + { + "variant": "armv8.1m.main_hard_fpdp_nomve", + "json": "armv8.1m.main_hard_fpdp_nomve.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_nofp_mve_exn_rtti", + "json": "armv8.1m.main_hard_nofp_mve_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none" + }, + { + "variant": "armv8.1m.main_hard_nofp_mve", + "json": "armv8.1m.main_hard_nofp_mve.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_softfp_nomve", + "flags": "--target=thumbv8.1m.main-unknown-none-eabi -march=thumbv8.1m.main+mve", + "error": "No library available for MVE with soft-float ABI. Try -mfloat-abi=hard." + }, + { + "variant": "armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti", + "json": "armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=pac-ret+bti" + }, + { + "variant": "armv8.1m.main_soft_nofp_nomve_pacret_bti", + "json": "armv8.1m.main_soft_nofp_nomve_pacret_bti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -mbranch-protection=pac-ret+bti -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti", + "json": "armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti" + }, + { + "variant": "armv8.1m.main_hard_fp_nomve_pacret_bti", + "json": "armv8.1m.main_hard_fp_nomve_pacret_bti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti", + "json": "armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti" + }, + { + "variant": "armv8.1m.main_hard_fpdp_nomve_pacret_bti", + "json": "armv8.1m.main_hard_fpdp_nomve_pacret_bti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti -fno-exceptions -fno-rtti" + }, + { + "variant": "armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti", + "json": "armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti" + }, + { + "variant": "armv8.1m.main_hard_nofp_mve_pacret_bti", + "json": "armv8.1m.main_hard_nofp_mve_pacret_bti.json", + "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti -fno-exceptions -fno-rtti" + } + ] +} \ No newline at end of file diff --git a/arm-multilib/json/variants/aarch64a.json b/arm-multilib/json/variants/aarch64a.json new file mode 100644 index 00000000..0ab62191 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a", + "COMPILE_FLAGS": "-march=armv8-a", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "virt", + "QEMU_CPU": "cortex-a57", + "BOOT_FLASH_ADDRESS": "0x40000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x40001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x41000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/aarch64a_exn_rtti.json b/arm-multilib/json/variants/aarch64a_exn_rtti.json new file mode 100644 index 00000000..c94e97ce --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_exn_rtti", + "COMPILE_FLAGS": "-march=armv8-a", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "virt", + "QEMU_CPU": "cortex-a57", + "BOOT_FLASH_ADDRESS": "0x40000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x40001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x41000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv4t.json b/arm-multilib/json/variants/armv4t.json new file mode 100644 index 00000000..63a07866 --- /dev/null +++ b/arm-multilib/json/variants/armv4t.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv4t", + "VARIANT": "armv4t", + "COMPILE_FLAGS": "-march=armv4t -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "ti925t", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv4t_exn_rtti.json b/arm-multilib/json/variants/armv4t_exn_rtti.json new file mode 100644 index 00000000..a3378033 --- /dev/null +++ b/arm-multilib/json/variants/armv4t_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv4t", + "VARIANT": "armv4t_exn_rtti", + "COMPILE_FLAGS": "-march=armv4t -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "ti925t", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv5te.json b/arm-multilib/json/variants/armv5te.json new file mode 100644 index 00000000..76f67f35 --- /dev/null +++ b/arm-multilib/json/variants/armv5te.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv5te", + "VARIANT": "armv5te", + "COMPILE_FLAGS": "-march=armv5te -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "arm926", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv5te_exn_rtti.json b/arm-multilib/json/variants/armv5te_exn_rtti.json new file mode 100644 index 00000000..1585384c --- /dev/null +++ b/arm-multilib/json/variants/armv5te_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv5te", + "VARIANT": "armv5te_exn_rtti", + "COMPILE_FLAGS": "-march=armv5te -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "arm926", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv6m_soft_nofp.json b/arm-multilib/json/variants/armv6m_soft_nofp.json new file mode 100644 index 00000000..f1548a50 --- /dev/null +++ b/arm-multilib/json/variants/armv6m_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armv6m_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an385", + "QEMU_CPU": "cortex-m3", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..0821eb18 --- /dev/null +++ b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armv6m_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an385", + "QEMU_CPU": "cortex-m3", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json new file mode 100644 index 00000000..0edc2b06 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_hard_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json new file mode 100644 index 00000000..f056361c --- /dev/null +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_hard_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_soft_nofp.json b/arm-multilib/json/variants/armv7a_soft_nofp.json new file mode 100644 index 00000000..3104e285 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_nofp.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a7", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..8373df82 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a7", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json new file mode 100644 index 00000000..734945b6 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json new file mode 100644 index 00000000..471f934f --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json new file mode 100644 index 00000000..443d3375 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv4_sp_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json new file mode 100644 index 00000000..8c0d32f6 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv4_sp_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv5_d16.json b/arm-multilib/json/variants/armv7m_hard_fpv5_d16.json new file mode 100644 index 00000000..a2b708e6 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv5_d16.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv5_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv5-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an500", + "QEMU_CPU": "cortex-m7", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x60600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv5_d16_exn_rtti.json b/arm-multilib/json/variants/armv7m_hard_fpv5_d16_exn_rtti.json new file mode 100644 index 00000000..81c246e4 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv5_d16_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv5_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv5-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an500", + "QEMU_CPU": "cortex-m7", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x60600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json new file mode 100644 index 00000000..014a5c32 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_fpv4_sp_d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json new file mode 100644 index 00000000..a28dece2 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_fpv4_sp_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_nofp.json b/arm-multilib/json/variants/armv7m_soft_nofp.json new file mode 100644 index 00000000..0d2033a6 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..f024ba55 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json new file mode 100644 index 00000000..a3d4fc7d --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json new file mode 100644 index 00000000..148424be --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json new file mode 100644 index 00000000..3eeb40e9 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json new file mode 100644 index 00000000..6b06f628 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3xd_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_nofp.json b/arm-multilib/json/variants/armv7r_soft_nofp.json new file mode 100644 index 00000000..b641d7ba --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_nofp.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..af4c221d --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json new file mode 100644 index 00000000..6940c0de --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json new file mode 100644 index 00000000..cbdf3924 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_vfpv3xd_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve.json new file mode 100644 index 00000000..ddbe52d2 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fp_nomve", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_exn_rtti.json new file mode 100644 index 00000000..6d02e766 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fp_nomve_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json new file mode 100644 index 00000000..38310c47 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fp_nomve_pacret_bti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-fp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json new file mode 100644 index 00000000..c0f36770 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-sp-d16 -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-fp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve.json new file mode 100644 index 00000000..fb28a2a7 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fpdp_nomve", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_exn_rtti.json new file mode 100644 index 00000000..b81fd001 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fpdp_nomve_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve -mfpu=fp-armv8-fullfp16-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json new file mode 100644 index 00000000..d51f2202 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fpdp_nomve_pacret_bti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-fp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json new file mode 100644 index 00000000..0b221cd8 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+nomve+pacbti -mfpu=fp-armv8-fullfp16-d16 -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-fp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve.json new file mode 100644 index 00000000..03133255 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_nofp_mve", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_exn_rtti.json new file mode 100644 index 00000000..f4c7df92 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_nofp_mve_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json new file mode 100644 index 00000000..58c219bf --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_nofp_mve_pacret_bti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-nofp mve-int", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json new file mode 100644 index 00000000..34ea6ac4 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8.1m.main+mve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-nofp mve-int", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve.json new file mode 100644 index 00000000..b9a7b0a7 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_soft_nofp_nomve", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8.1m.main+nomve -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_exn_rtti.json new file mode 100644 index 00000000..0b898180 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_soft_nofp_nomve_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8.1m.main+nomve -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps3-an547", + "QEMU_CPU": "cortex-m55", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "512K", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json new file mode 100644 index 00000000..599df22f --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_soft_nofp_nomve_pacret_bti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-nofp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json new file mode 100644 index 00000000..e7bddab7 --- /dev/null +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8.1m.main", + "VARIANT": "armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8.1m.main+nomve+pacbti -mfpu=none -mbranch-protection=pac-ret+bti", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-pacbti m-nofp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8m.main_hard_fp.json b/arm-multilib/json/variants/armv8m.main_hard_fp.json new file mode 100644 index 00000000..53f90ba2 --- /dev/null +++ b/arm-multilib/json/variants/armv8m.main_hard_fp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8m.main", + "VARIANT": "armv8m.main_hard_fp", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8m.main -mfpu=fpv5-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an505", + "QEMU_CPU": "cortex-m33", + "BOOT_FLASH_ADDRESS": "0x10000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x80600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8m.main_hard_fp_exn_rtti.json b/arm-multilib/json/variants/armv8m.main_hard_fp_exn_rtti.json new file mode 100644 index 00000000..da48ef18 --- /dev/null +++ b/arm-multilib/json/variants/armv8m.main_hard_fp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8m.main", + "VARIANT": "armv8m.main_hard_fp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv8m.main -mfpu=fpv5-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an505", + "QEMU_CPU": "cortex-m33", + "BOOT_FLASH_ADDRESS": "0x10000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x80600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8m.main_soft_nofp.json b/arm-multilib/json/variants/armv8m.main_soft_nofp.json new file mode 100644 index 00000000..28f25720 --- /dev/null +++ b/arm-multilib/json/variants/armv8m.main_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8m.main", + "VARIANT": "armv8m.main_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8m.main -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an505", + "QEMU_CPU": "cortex-m33", + "BOOT_FLASH_ADDRESS": "0x10000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x80600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv8m.main_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv8m.main_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..66b69701 --- /dev/null +++ b/arm-multilib/json/variants/armv8m.main_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv8m.main", + "VARIANT": "armv8m.main_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv8m.main -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an505", + "QEMU_CPU": "cortex-m33", + "BOOT_FLASH_ADDRESS": "0x10000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x80600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/multilib-generate.py b/arm-multilib/multilib-generate.py similarity index 97% rename from multilib-generate.py rename to arm-multilib/multilib-generate.py index e0e05700..c7ea84c6 100755 --- a/multilib-generate.py +++ b/arm-multilib/multilib-generate.py @@ -238,7 +238,11 @@ def get_extension_list(clang, triple): def generate_extensions(args): aarch64_features = get_extension_list(args.clang, "aarch64-none-eabi") aarch32_features = get_extension_list(args.clang, "arm-none-eabi") - all_features = set(aarch64_features) | set(aarch32_features) + all_features = list(aarch64_features) + # Combine the aarch64 and aarch32 lists without duplication. + # Casting to sets and merging would be simpler, but creates + # non-deterministic output. + all_features.extend(feat for feat in list(aarch32_features) if feat not in all_features) print("# Expand -march=...+[no]feature... into individual options we can match") print("# on. We use 'armvX' to represent a feature applied to any architecture, so") diff --git a/cmake/multilib.yaml.in b/arm-multilib/multilib.yaml.in similarity index 100% rename from cmake/multilib.yaml.in rename to arm-multilib/multilib.yaml.in diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt new file mode 100644 index 00000000..1d7e98ae --- /dev/null +++ b/arm-runtimes/CMakeLists.txt @@ -0,0 +1,800 @@ +# +# Copyright (c) 2024, Arm Limited and affiliates. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# CMake build for a library variant, combining a chosen C library +# with builtins from compiler-rt and libcx/libcxxabi/libunwind + +cmake_minimum_required(VERSION 3.20) + +project(arm-runtimes) + +# Root directory of the repo. +set(TOOLCHAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) + +# CMake arguments are loaded from the JSON file depending on which C +# library is used, so this must be set before the JSON is processed. +set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") +set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) + +set(VARIANT_JSON "" CACHE STRING "JSON file to load args from.") +if(VARIANT_JSON) + file(READ ${VARIANT_JSON} variant_json_read) + # Load arguments common to all libraries. + string(JSON json_args GET ${variant_json_read} "args" "common") + string(JSON json_args_len LENGTH ${json_args}) + math(EXPR json_args_len_dec "${json_args_len} - 1") + foreach(json_idx RANGE ${json_args_len_dec}) + string(JSON json_param MEMBER ${json_args} ${json_idx}) + string(JSON json_val GET ${json_args} ${json_param}) + string(JSON json_val_type TYPE ${json_args} ${json_param}) + set(${json_param}_def ${json_val}) + endforeach() + # Load arguments specific to the chosen library, overwriting any existing values. + string(JSON json_args GET ${variant_json_read} "args" ${C_LIBRARY}) + string(JSON json_args_len LENGTH ${json_args}) + math(EXPR json_args_len_dec "${json_args_len} - 1") + foreach(json_idx RANGE ${json_args_len_dec}) + string(JSON json_param MEMBER ${json_args} ${json_idx}) + string(JSON json_val GET ${json_args} ${json_param}) + string(JSON json_val_type TYPE ${json_args} ${json_param}) + set(${json_param}_def ${json_val}) + endforeach() +endif() + +# Default values will be populated by the json above. +# Any user specified options will override the default. +set(TARGET_ARCH ${TARGET_ARCH_def} CACHE STRING "Architecture being targetted.") +set(VARIANT ${VARIANT_def} CACHE STRING "Name for the variant, usually architecture + suffix.") +set(COMPILE_FLAGS ${COMPILE_FLAGS_def} CACHE STRING "Flags required to build the variant.") +set(TEST_EXECUTOR ${TEST_EXECUTOR_def} CACHE STRING "Program used to run tests.") +set_property(CACHE TEST_EXECUTOR PROPERTY STRINGS fvp qemu) +set(FVP_MODEL ${FVP_MODEL_def} CACHE STRING "FVP model to use, if FVP is the test executor.") +set(FVP_CONFIG ${FVP_CONFIG_def} CACHE STRING "FVP config to use, if FVP is the test executor.") +set( + FVP_INSTALL_DIR + "" CACHE STRING + "The directory in which the FVP models are installed. These are not + included in this repository, but can be downloaded by the script + fvp/get_fvps.sh" +) +set(FVP_CONFIG_DIR "${TOOLCHAIN_SOURCE_DIR}/fvp/config" CACHE STRING "The directory in which the FVP models are installed.") + +set(QEMU_MACHINE ${QEMU_MACHINE_def} CACHE STRING "Machine for QEMU to emulate.") +set(QEMU_CPU ${QEMU_CPU_def} CACHE STRING "CPU for QEMU to emulate.") +set(QEMU_PARAMS ${QEMU_PARAMS_def} CACHE STRING "Any additional parameters to pass to QEMU.") + +set(BOOT_FLASH_ADDRESS ${BOOT_FLASH_ADDRESS_def} CACHE STRING "") +set(BOOT_FLASH_SIZE ${BOOT_FLASH_SIZE_def} CACHE STRING "") +set(FLASH_ADDRESS ${FLASH_ADDRESS_def} CACHE STRING "") +set(FLASH_SIZE ${FLASH_SIZE_def} CACHE STRING "") +set(RAM_ADDRESS ${RAM_ADDRESS_def} CACHE STRING "") +set(RAM_SIZE ${RAM_SIZE_def} CACHE STRING "") +set(STACK_SIZE ${STACK_SIZE_def} CACHE STRING "") + +set(ENABLE_EXCEPTIONS ${ENABLE_EXCEPTIONS_def} CACHE BOOL "Enable C++ exceptions.") +set(ENABLE_RTTI ${ENABLE_RTTI_def} CACHE BOOL "Enable C++ exceptions.") + +set(PICOLIBC_BUILD_TYPE ${PICOLIBC_BUILD_TYPE_def} CACHE STRING "Picolibc configuration to use.") +set_property(CACHE PICOLIBC_BUILD_TYPE PROPERTY STRINGS minsize release) + +set(ENABLE_CXX_LIBS ${ENABLE_CXX_LIBS_def} CACHE BOOL "Build CXX libs") +set(ENABLE_LIBC_TESTS ${ENABLE_LIBC_TESTS_def} CACHE BOOL "Enable libc tests (picolibc, newlib or llvm-libc).") +set(ENABLE_COMPILER_RT_TESTS ${ENABLE_COMPILER_RT_TESTS_def} CACHE BOOL "Enable compiler-rt tests.") +set(ENABLE_LIBCXX_TESTS ${ENABLE_LIBCXX_TESTS_def} CACHE BOOL "Enable libcxx tests.") +set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain root to build libraries with") +set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") + +# Temporary location to collect the libraries as they are built. +set(TEMP_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp_install") + +include(ExternalProject) +include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_llvm.cmake) + +find_package(Python3 REQUIRED COMPONENTS Interpreter) + +# If a compiler launcher such as ccache has been set, it should be +# passed down to each subproject build. +set(compiler_launcher_cmake_args "") +if(CMAKE_C_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}") +endif() +if(CMAKE_CXX_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") +endif() + +if(TARGET_ARCH MATCHES "^aarch64") + set(target_triple "aarch64-none-elf") + set(cpu_family aarch64) +else() + # Choose the target triple so that compiler-rt will do the + # right thing. We can't always put the exact target + # architecture in the triple, because compiler-rt's cmake + # system doesn't recognize every possible Arm architecture + # version. So mostly we just say 'arm' and control the arch + # version via -march=armv7m (or whatever). + # Exceptions are architectures pre-armv7, which compiler-rt expects to + # see in the triple because that's where it looks to decide whether to + # use specific assembly sources. + if(TARGET_ARCH MATCHES "^armv[4-6]") + set(target_triple "${TARGET_ARCH}-none-eabi") + else() + set(target_triple "arm-none-eabi") + endif() + if(COMPILE_FLAGS MATCHES "-mfloat-abi=hard") + # Also, compiler-rt looks in the ABI component of the + # triple to decide whether to use the hard float ABI. + set(target_triple "${target_triple}hf") + endif() + set(cpu_family arm) +endif() + +# Create a single target for all testing. If no testing is enabled, this +# will simply do nothing. +add_custom_target(check-all) + +# If any testing is enabled, prepare test executor settings. +if(ENABLE_LIBC_TESTS OR ENABLE_COMPILER_RT_TESTS OR ENABLE_LIBCXX_TESTS) + # Flags required to link tests. + if(C_LIBRARY STREQUAL picolibc) + set(test_link_flags "-nostartfiles -lcrt0-semihost -lsemihost -T picolibcpp.ld") + else() + message(FATAL_ERROR "Tests can only be enabled using picolibc.") + endif() + + if(TEST_EXECUTOR STREQUAL qemu) + if(TARGET_ARCH MATCHES "^aarch64") + find_program(QEMU_EXECUTABLE qemu-system-aarch64) + else() + find_program(QEMU_EXECUTABLE qemu-system-arm) + endif() + + # Use colon as a separator because comma and semicolon are used for + # other purposes in CMake. + string(REPLACE " " ":" qemu_params_list "${QEMU_PARAMS}") + + set(test_executor_params --qemu-command ${QEMU_EXECUTABLE} --qemu-machine ${QEMU_MACHINE}) + if(QEMU_CPU) + list(APPEND test_executor_params --qemu-cpu ${QEMU_CPU}) + endif() + if(qemu_params_list) + list(APPEND test_executor_params "--qemu-params=${qemu_params_list}") + endif() + set( + lit_test_executor + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-qemu.py + ${test_executor_params} + ) + elseif(TEST_EXECUTOR STREQUAL fvp) + if(NOT EXISTS "${FVP_INSTALL_DIR}") + message(FATAL_ERROR "FVPs must be installed to run tests using FVPs.") + endif() + set( + test_executor_params + --fvp-install-dir ${FVP_INSTALL_DIR} + --fvp-config-dir ${FVP_CONFIG_DIR} + --fvp-model ${FVP_MODEL} + ) + string(REPLACE " " ";" fvp_config_list ${FVP_CONFIG}) + foreach(cfg ${fvp_config_list}) + set( + test_executor_params + ${test_executor_params} + --fvp-config ${cfg} + ) + endforeach() + set( + lit_test_executor + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/lit-exec-fvp.py + ${test_executor_params} + ) + endif() + list(JOIN lit_test_executor " " lit_test_executor) +endif() + +set(compile_arch_flags "--target=${target_triple} ${COMPILE_FLAGS}") +# Compiling the libraries benefits from some extra optimization +# flags, and requires a sysroot. +set(lib_compile_flags "${compile_arch_flags} -ffunction-sections -fdata-sections -fno-ident --sysroot ${TEMP_LIB_DIR}") + +# Declare this target now, since compiler-rt requires the dependency. +add_custom_target(clib-install) + +############################################################################### +# compiler-rt +############################################################################### + +# We can't always put the exact target +# architecture in the triple, because compiler-rt's cmake +# system doesn't recognize every possible Arm architecture +# version. So mostly we just say 'arm' and control the arch +# version via -march=armv7m (or whatever). +# Exceptions are architectures pre-armv7, which compiler-rt expects to +# see in the triple because that's where it looks to decide whether to +# use specific assembly sources. +if(NOT target_triple MATCHES "^(aarch64-none-elf|arm-none-eabi|armv[4-6])") + message(FATAL_ERROR "\ +Target triple name \"${target_triple}\" not compatible with compiler-rt. +Use -march to specify the architecture.") +endif() +# Also, compiler-rt looks in the ABI component of the +# triple to decide whether to use the hard float ABI. +if(flags MATCHES "-mfloat-abi=hard" AND NOT target_triple MATCHES "-eabihf$") + message(FATAL_ERROR "\ +Hard-float library with target triple \"${target_triple}\" must end \"-eabihf\"") +endif() +string(REPLACE "-none-" "-unknown-none-" normalized_target_triple ${target_triple}) + +# This prevents a test failure due to insufficient available registers. +# TODO: Which test, can this be fixed upstream? +if(VARIANT STREQUAL "armv6m_soft_nofp") + set(compiler_rt_test_flags "${compiler_rt_test_flags} -fomit-frame-pointer") +endif() + +if(ENABLE_COMPILER_RT_TESTS) + set(compiler_rt_test_flags "${lib_compile_flags} ${test_link_flags}") + set(compiler_rt_lit_args "${LLVM_LIT_ARGS} --xunit-xml-output=results.junit.xml") + set( + compiler_rt_test_cmake_args + -DCOMPILER_RT_INCLUDE_TESTS=ON + -DCOMPILER_RT_EMULATOR=${lit_test_executor} + -DCOMPILER_RT_TEST_COMPILER=${LLVM_BINARY_DIR}/bin/clang + -DCOMPILER_RT_TEST_COMPILER_CFLAGS=${compiler_rt_test_flags} + -DLLVM_LIT_ARGS=${compiler_rt_lit_args} + ) +endif() + +ExternalProject_Add( + compiler_rt + SOURCE_DIR ${llvmproject_SOURCE_DIR}/compiler-rt + INSTALL_DIR compiler-rt/install + CMAKE_ARGS + ${compiler_launcher_cmake_args} + -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_COMPILER_TARGET=${target_triple} + -DCMAKE_ASM_FLAGS=${lib_compile_flags} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_CXX_COMPILER_TARGET=${target_triple} + -DCMAKE_CXX_FLAGS=${lib_compile_flags} + -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_C_COMPILER_TARGET=${target_triple} + -DCMAKE_C_FLAGS=${lib_compile_flags} + -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_SYSTEM_NAME=Generic + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY + -DCOMPILER_RT_BAREMETAL_BUILD=ON + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF + -DCOMPILER_RT_BUILD_PROFILE=OFF + -DCOMPILER_RT_BUILD_SANITIZERS=OFF + -DCOMPILER_RT_BUILD_XRAY=OFF + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON + -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR} + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON + ${compiler_rt_test_cmake_args} + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + INSTALL_COMMAND ${CMAKE_COMMAND} --install . + # Copy compiler-rt lib directory, moving libraries out of their + # target-specific subdirectory. + COMMAND + ${CMAKE_COMMAND} + -E copy_directory + /lib/${normalized_target_triple} + "${TEMP_LIB_DIR}/lib" +) + +add_custom_target(check-compiler-rt) +add_dependencies(check-all check-compiler-rt) +if(ENABLE_COMPILER_RT_TESTS) + ExternalProject_Add_Step( + compiler_rt + check-compiler-rt + COMMAND "${CMAKE_COMMAND}" --build --target check-compiler-rt + COMMAND ${Python3_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/modify-compiler-rt-xml.py + --compiler-rt-build-dir + --variant ${VARIANT} + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + ) + ExternalProject_Add_StepTargets(compiler_rt check-compiler-rt) + ExternalProject_Add_StepDependencies( + compiler_rt + check-compiler-rt + compiler_rt-build + clib-install + ) + add_dependencies(check-compiler-rt compiler_rt-check-compiler-rt) +endif() + +############################################################################### +# picolibc +############################################################################### + +if(C_LIBRARY STREQUAL picolibc) + include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_picolibc.cmake) + include(${CMAKE_CURRENT_SOURCE_DIR}/to_meson_list.cmake) + + # For building picolibc use Meson. + # Although picolibc has support for building with CMake, the Meson code + # is more mature and works better with LLVM. + find_program(MESON_EXECUTABLE meson REQUIRED) + + if(CMAKE_INSTALL_MESSAGE STREQUAL NEVER) + set(MESON_INSTALL_QUIET "--quiet") + endif() + + if(PICOLIBC_BUILD_TYPE MATCHES "minsize") + set(newlib_nano_malloc "true") + else() + set(newlib_nano_malloc "false") + endif() + + # TODO: xfail these tests instead of disabling. + if(target_triple MATCHES "^aarch64") + set(enable_picolibc_long_double_test false) + else() + set(enable_picolibc_long_double_test true) + endif() + + # Set meson_c_args to a comma-separated list of the clang path + # and flags e.g. 'path/to/clang', '--target=armv6m-none-eabi', + # '-march=armv6m' + set(picolibc_flags "${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} ${lib_compile_flags}") + if(CMAKE_C_COMPILER_LAUNCHER) + set(picolibc_flags "${CMAKE_C_COMPILER_LAUNCHER} ${picolibc_flags}") + endif() + separate_arguments(picolibc_flags) + to_meson_list("${picolibc_flags}" picolibc_meson_flags) + + if(ENABLE_LIBC_TESTS) + set(picolibc_test_executor_bin ${CMAKE_CURRENT_SOURCE_DIR}/test-support/picolibc-test-wrapper.py) + to_meson_list("${test_executor_params}" meson_test_executor_params) + endif() + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meson-cross-build.txt.in ${CMAKE_CURRENT_BINARY_DIR}/meson-cross-build.txt @ONLY) + + ExternalProject_Add( + picolibc + SOURCE_DIR ${picolibc_SOURCE_DIR} + INSTALL_DIR ${TEMP_LIB_DIR} + DEPENDS compiler_rt-install + CONFIGURE_COMMAND + ${MESON_EXECUTABLE} + setup + -Dincludedir=include + -Dlibdir=lib + -Dspecsdir=none + -Dmultilib=false + -Dtests-enable-stack-protector=false + -Dtest-long-double=${enable_picolibc_long_double_test} + -Dnewlib-nano-malloc=${newlib_nano_malloc} + -Dtests=false + --prefix + --cross-file ${CMAKE_CURRENT_BINARY_DIR}/meson-cross-build.txt + --buildtype=${PICOLIBC_BUILD_TYPE} + + BUILD_COMMAND ${MESON_EXECUTABLE} compile + INSTALL_COMMAND ${MESON_EXECUTABLE} install ${MESON_INSTALL_QUIET} + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + TEST_EXCLUDE_FROM_MAIN TRUE + STEP_TARGETS build install + ) + + add_custom_target(check-picolibc) + add_dependencies(check-all check-picolibc) + if(ENABLE_LIBC_TESTS) + # meson builds the tests at the same time as the library. + # So reconfigure to enable tests at a later point. + ExternalProject_Add_Step( + picolibc + enable-tests + COMMAND ${MESON_EXECUTABLE} setup -Dtests=true --reconfigure + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ) + ExternalProject_Add_StepTargets(picolibc enable-tests) + ExternalProject_Add_StepDependencies( + picolibc + enable-tests + picolibc-build + compiler_rt-install + ) + ExternalProject_Add_Step( + picolibc + check + COMMAND ${MESON_EXECUTABLE} test -C + COMMAND ${Python3_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/test-support/modify-picolibc-xml.py + --picolibc-build-dir + --variant ${VARIANT} + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + ) + ExternalProject_Add_StepTargets(picolibc check) + ExternalProject_Add_StepDependencies( + picolibc + check + picolibc-enable-tests + ) + add_dependencies(check-picolibc picolibc-check) + endif() + +endif() + +############################################################################### +# newlib +############################################################################### + +if(C_LIBRARY STREQUAL newlib) + if(ENABLE_LIBC_TESTS) + message(FATAL_ERROR "Tests cannot yet be enabled using newlib libc.") + endif() + + include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_newlib.cmake) + set(build_env + "CC_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang -target ${target_triple} -ffreestanding" + "CXX_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang++ -target ${target_triple} -ffreestanding" + "AR_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ar" + "AS_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-as" + "NM_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-nm" + "OBJDUMP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-objdump" + "RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib" + "READELF_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-readelf" + "STRIP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-strip" + "CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" + "CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" + ) + + include(ProcessorCount) + set(make_flags) + ProcessorCount(nproc) + if(NOT nproc EQUAL 0) + set(make_flags -j${nproc}) + endif() + + ExternalProject_Add( + newlib + SOURCE_DIR ${newlib_SOURCE_DIR} + INSTALL_DIR ${TEMP_LIB_DIR} + CONFIGURE_COMMAND + ${CMAKE_COMMAND} -E env ${build_env} + /configure + --target=${target_triple} + --prefix "${TEMP_LIB_DIR}" + --exec_prefix /tmpinstall + --enable-newlib-io-long-long + --enable-newlib-register-fini + --disable-newlib-supplied-syscalls + --enable-newlib-io-c99-formats + --disable-nls + --enable-lite-exit + --disable-multilib + --enable-newlib-retargetable-locking + BUILD_COMMAND + ${CMAKE_COMMAND} -E env ${build_env} + make ${make_flags} + && + "${LLVM_BINARY_DIR}/bin/llvm-ar" rcs + /${target_triple}/libgloss/${cpu_family}/libcrt0-rdimon.a + /${target_triple}/libgloss/${cpu_family}/rdimon-crt0.o + && + "${LLVM_BINARY_DIR}/bin/llvm-ar" rcs + /${target_triple}/libgloss/${cpu_family}/libcrt0-nosys.a + /${target_triple}/libgloss/${cpu_family}/crt0.o + INSTALL_COMMAND + make install + && + ${CMAKE_COMMAND} -E copy_directory + /tmpinstall/${target_triple} + ${TEMP_LIB_DIR} + && + ${CMAKE_COMMAND} -E copy + /${target_triple}/libgloss/${cpu_family}/libcrt0-rdimon.a + ${TEMP_LIB_DIR}/lib + && + ${CMAKE_COMMAND} -E copy + /${target_triple}/libgloss/${cpu_family}/libcrt0-nosys.a + ${TEMP_LIB_DIR}/lib + # FIXME: TEST_COMMAND? + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + # Always run the build command so that incremental builds are correct. + CONFIGURE_HANDLED_BY_BUILD TRUE + TEST_EXCLUDE_FROM_MAIN TRUE + STEP_TARGETS install # FIXME: test? + ) +endif() + +############################################################################### +# llvmlibc +############################################################################### + +if(C_LIBRARY STREQUAL llvmlibc) + if(ENABLE_LIBC_TESTS) + message(FATAL_ERROR "Tests cannot yet be enabled using llvm libc.") + endif() + if(ENABLE_CXX_LIBS) + message(FATAL_ERROR "We aren't yet able to build C++ libraries to go with llvm-libc.") + endif() + + # LLVM libc lacks a configuration for AArch64, but the AArch32 one works + # fine. However, setting the configuration for both architectures to the + # arm config directory means the baremetal config.json is never loaded, + # as it resides in the directory above. To ensure both are used, copy + # them to the same location and point libc to that. + set(LIBC_CFG_DIR ${CMAKE_BINARY_DIR}/llvmlibc-config) + file(COPY + ${llvmproject_SOURCE_DIR}/libc/config/baremetal/config.json + ${llvmproject_SOURCE_DIR}/libc/config/baremetal/arm/. + DESTINATION + ${LIBC_CFG_DIR} + ) + + set(lib_compile_flags "${lib_compile_flags} -Wno-error=atomic-alignment") + + set(common_llvmlibc_cmake_args + -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_COMPILER_TARGET=${target_triple} + -DCMAKE_ASM_FLAGS=${lib_compile_flags} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_CXX_COMPILER_TARGET=${target_triple} + -DCMAKE_CXX_FLAGS=${lib_compile_flags} + -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_C_COMPILER_TARGET=${target_triple} + -DCMAKE_C_FLAGS=${lib_compile_flags} + -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} + # Let CMake know we're cross-compiling + -DCMAKE_SYSTEM_NAME=Generic + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY + ) + + if(LIBC_HDRGEN) + # If libc-hdrgen is provided, there is no need to build it, + # but a target is still needed to satisfy the dependency. + add_custom_target(libc_hdrgen) + elseif(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + add_custom_target(libc_hdrgen) + else() + ExternalProject_Add( + libc_hdrgen + SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm + CMAKE_ARGS + -DLLVM_ENABLE_RUNTIMES=libc + -DLLVM_LIBC_FULL_BUILD=ON + -DCMAKE_BUILD_TYPE=Debug + BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen + INSTALL_COMMAND ${CMAKE_COMMAND} -E true + CONFIGURE_HANDLED_BY_BUILD TRUE + ) + ExternalProject_Get_property(libc_hdrgen BINARY_DIR) + set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) + endif() + + ExternalProject_Add( + llvmlibc + SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes + INSTALL_DIR llvmlibc/install + DEPENDS libc_hdrgen + CMAKE_ARGS + ${compiler_launcher_cmake_args} + ${common_llvmlibc_cmake_args} + -DLIBC_TARGET_TRIPLE=${target_triple} + -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} + -DLIBC_CONFIG_PATH=${LIBC_CFG_DIR} + -DLIBC_CONF_TIME_64BIT=ON + -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON + -DLLVM_ENABLE_RUNTIMES=libc + -DLLVM_INCLUDE_TESTS=OFF # llvmlibc's tests require C++, so can't be built until llvmlibc can support libc++ + -DLLVM_LIBC_FULL_BUILD=ON + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + INSTALL_COMMAND ${CMAKE_COMMAND} --install . + # Copy llvm-libc lib directory, moving libraries out of their + # target-specific subdirectory. + COMMAND + ${CMAKE_COMMAND} + -E copy_directory + /lib/${target_triple} + "${TEMP_LIB_DIR}/lib" + # And copy the include directory, which is already arranged right. + COMMAND + ${CMAKE_COMMAND} + -E copy_directory + /include + "${TEMP_LIB_DIR}/include" + ) + + ExternalProject_Add( + llvmlibc-support + SOURCE_DIR ${TOOLCHAIN_SOURCE_DIR}/llvmlibc-support + INSTALL_DIR ${TEMP_LIB_DIR} + DEPENDS ${lib_tool_dependencies} llvmlibc-install + CMAKE_ARGS + ${compiler_launcher_cmake_args} + ${common_llvmlibc_cmake_args} + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + ) +endif() + +add_dependencies(clib-install ${C_LIBRARY}-install) + +############################################################################### +# runtimes (libcxx, libcxxabi, libunwind) +############################################################################### + +if(ENABLE_CXX_LIBS) + if(C_LIBRARY STREQUAL picolibc) + set(cxxlibs_extra_cmake_options + -DLIBCXXABI_ENABLE_THREADS=OFF + -DLIBCXX_ENABLE_MONOTONIC_CLOCK=OFF + -DLIBCXX_ENABLE_RANDOM_DEVICE=OFF + -DLIBCXX_ENABLE_THREADS=OFF + -DLIBCXX_ENABLE_WIDE_CHARACTERS=OFF + -DLIBUNWIND_ENABLE_THREADS=OFF + -DLIBCXXABI_ENABLE_EXCEPTIONS=${enable_exceptions} + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=${enable_exceptions} + -DLIBCXX_ENABLE_EXCEPTIONS=${enable_exceptions} + -DLIBCXX_ENABLE_RTTI=${enable_rtti} + ) + if(ENABLE_LIBCXX_TESTS) + set(cxxlibs_lit_args "${LLVM_LIT_ARGS} --xunit-xml-output=results.junit.xml") + set(cxxlibs_test_cmake_options + -DLIBCXX_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libc++-picolibc.cfg.in + -DLIBCXX_TEST_PARAMS=executor=${lit_test_executor} + -DLIBCXXABI_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libc++abi-picolibc.cfg.in + -DLIBCXXABI_TEST_PARAMS=executor=${lit_test_executor} + -DLIBUNWIND_TEST_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/test-support/llvm-libunwind-picolibc.cfg.in + -DLIBUNWIND_TEST_PARAMS=executor=${lit_test_executor} + -DRUNTIME_TEST_ARCH_FLAGS=${compile_arch_flags} + -DRUNTIME_TEST_LINK_FLAGS=${test_link_flags} + -DLLVM_LIT_ARGS=${cxxlibs_lit_args} + ) + endif() + elseif(C_LIBRARY STREQUAL newlib) + set(cxxlibs_extra_cmake_options + -DLIBCXXABI_ENABLE_THREADS=OFF + -DLIBCXX_ENABLE_THREADS=OFF + -DLIBCXX_ENABLE_MONOTONIC_CLOCK=OFF + -DLIBCXX_ENABLE_RANDOM_DEVICE=OFF + -DLIBCXX_ENABLE_WIDE_CHARACTERS=ON + -DLIBCXX_ENABLE_LOCALIZATION=OFF + -DLIBUNWIND_ENABLE_THREADS=OFF + ) + endif() + + ExternalProject_Add( + cxxlibs + SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes + INSTALL_DIR ${TEMP_LIB_DIR} + DEPENDS compiler_rt-install clib-install + CMAKE_ARGS + ${compiler_launcher_cmake_args} + -DCMAKE_AR=${LLVM_BINARY_DIR}/bin/llvm-ar${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_ASM_FLAGS=${lib_compile_flags} + -DCMAKE_BUILD_TYPE=MinSizeRel + -DCMAKE_CXX_COMPILER=${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_CXX_COMPILER_TARGET=${target_triple} + -DCMAKE_CXX_FLAGS=${lib_compile_flags} + -DCMAKE_C_COMPILER=${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_C_COMPILER_TARGET=${target_triple} + -DCMAKE_C_FLAGS=${lib_compile_flags} + -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} + -DCMAKE_INSTALL_PREFIX=${TEMP_LIB_DIR} + -DCMAKE_NM=${LLVM_BINARY_DIR}/bin/llvm-nm${CMAKE_EXECUTABLE_SUFFIX} + -DCMAKE_RANLIB=${LLVM_BINARY_DIR}/bin/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX} + # Let CMake know we're cross-compiling + -DCMAKE_SYSTEM_NAME=Generic + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY + -DLIBCXXABI_BAREMETAL=ON + -DLIBCXXABI_ENABLE_ASSERTIONS=OFF + -DLIBCXXABI_ENABLE_SHARED=OFF + -DLIBCXXABI_ENABLE_STATIC=ON + -DLIBCXXABI_LIBCXX_INCLUDES="${TEMP_LIB_DIR}/include/c++/v1" + -DLIBCXXABI_USE_COMPILER_RT=ON + -DLIBCXXABI_USE_LLVM_UNWINDER=ON + -DLIBCXXABI_SHARED_OUTPUT_NAME="c++abi-shared" + -DLIBCXX_ABI_UNSTABLE=ON + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON + -DLIBCXX_ENABLE_FILESYSTEM=OFF + -DLIBCXX_ENABLE_SHARED=OFF + -DLIBCXX_ENABLE_STATIC=ON + -DLIBCXX_INCLUDE_BENCHMARKS=OFF + -DLIBCXX_SHARED_OUTPUT_NAME="c++-shared" + -DLIBUNWIND_ENABLE_ASSERTIONS=OFF + -DLIBUNWIND_ENABLE_SHARED=OFF + -DLIBUNWIND_ENABLE_STATIC=ON + -DLIBUNWIND_IS_BAREMETAL=ON + -DLIBUNWIND_REMEMBER_HEAP_ALLOC=ON + -DLIBUNWIND_USE_COMPILER_RT=ON + -DLIBUNWIND_SHARED_OUTPUT_NAME="unwind-shared" + -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} + -DLLVM_ENABLE_RUNTIMES=libcxxabi,libcxx,libunwind + -DRUNTIME_VARIANT_NAME=${VARIANT} + ${cxxlibs_extra_cmake_options} + ${cxxlibs_test_cmake_options} + STEP_TARGETS build install + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + ) + add_custom_target(check-cxx) + add_dependencies(check-all check-cxx) + add_custom_target(check-cxxabi) + add_dependencies(check-all check-cxxabi) + add_custom_target(check-unwind) + add_dependencies(check-all check-unwind) + if(ENABLE_LIBCXX_TESTS) + foreach(check_target check-cxx check-cxxabi check-unwind) + ExternalProject_Add_Step( + cxxlibs + ${check_target} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + ) + ExternalProject_Add_StepTargets(cxxlibs ${check_target}) + ExternalProject_Add_StepDependencies( + cxxlibs + ${check_target} + cxxlibs-install + ) + add_dependencies(${check_target} cxxlibs-${check_target}) + endforeach() + endif() + +endif() + +install( + DIRECTORY ${TEMP_LIB_DIR}/ + DESTINATION . +) diff --git a/arm-runtimes/meson-cross-build.txt.in b/arm-runtimes/meson-cross-build.txt.in new file mode 100644 index 00000000..90df44d4 --- /dev/null +++ b/arm-runtimes/meson-cross-build.txt.in @@ -0,0 +1,31 @@ +[binaries] +c = [@picolibc_meson_flags@, '-nostdlib'] +ar = '@LLVM_BINARY_DIR@/bin/llvm-ar@CMAKE_EXECUTABLE_SUFFIX@' +strip = '@LLVM_BINARY_DIR@/bin/llvm-strip@CMAKE_EXECUTABLE_SUFFIX@' +# only needed to run tests +# setting stdin to /dev/null prevents qemu from fiddling with the echo bit of +# the parent terminal +exe_wrapper = [ + 'sh', + '-c', + 'test -z "$PICOLIBC_TEST" || @picolibc_test_executor_bin@ "$@" < /dev/null', + '@picolibc_test_executor_bin@', + @meson_test_executor_params@] + +[host_machine] +system = 'none' +cpu_family = '@cpu_family@' +cpu = '@cpu_family@' +endian = 'little' + +[properties] +skip_sanity_check = true +libgcc ='-lclang_rt.builtins' +separate_boot_flash = true +default_boot_flash_addr = '@BOOT_FLASH_ADDRESS@' +default_boot_flash_size = '@BOOT_FLASH_SIZE@' +default_flash_addr = '@FLASH_ADDRESS@' +default_flash_size = '@FLASH_SIZE@' +default_ram_addr = '@RAM_ADDRESS@' +default_ram_size = '@RAM_SIZE@' +default_stack_size = '@STACK_SIZE@' diff --git a/test-support/lit-exec-fvp.py b/arm-runtimes/test-support/lit-exec-fvp.py similarity index 100% rename from test-support/lit-exec-fvp.py rename to arm-runtimes/test-support/lit-exec-fvp.py diff --git a/test-support/lit-exec-qemu.py b/arm-runtimes/test-support/lit-exec-qemu.py similarity index 100% rename from test-support/lit-exec-qemu.py rename to arm-runtimes/test-support/lit-exec-qemu.py diff --git a/test-support/llvm-libc++-picolibc.cfg.in b/arm-runtimes/test-support/llvm-libc++-picolibc.cfg.in similarity index 89% rename from test-support/llvm-libc++-picolibc.cfg.in rename to arm-runtimes/test-support/llvm-libc++-picolibc.cfg.in index 1041aa5f..674fc84a 100644 --- a/test-support/llvm-libc++-picolibc.cfg.in +++ b/arm-runtimes/test-support/llvm-libc++-picolibc.cfg.in @@ -7,7 +7,7 @@ config.name = 'libc++-@RUNTIME_VARIANT_NAME@' config.substitutions.append(('%{libc-include}', '@CMAKE_INSTALL_PREFIX@/include')) config.substitutions.append(('%{libc-lib}', '@CMAKE_INSTALL_PREFIX@/lib')) -config.substitutions.append(('%{libc-linker-script}', '@LIBC_LINKER_SCRIPT@')) +config.substitutions.append(('%{libc-extra-link-flags}', '@RUNTIME_TEST_LINK_FLAGS@')) config.substitutions.append(('%{flags}', '@RUNTIME_TEST_ARCH_FLAGS@')) config.substitutions.append(('%{compile_flags}', @@ -27,8 +27,8 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib-dir}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' - ' -T %{libc-linker-script}' + ' -lc -lm -lclang_rt.builtins' + ' %{libc-extra-link-flags}' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T -- ' diff --git a/test-support/llvm-libc++abi-picolibc.cfg.in b/arm-runtimes/test-support/llvm-libc++abi-picolibc.cfg.in similarity index 86% rename from test-support/llvm-libc++abi-picolibc.cfg.in rename to arm-runtimes/test-support/llvm-libc++abi-picolibc.cfg.in index 96b32064..5d7f8aea 100644 --- a/test-support/llvm-libc++abi-picolibc.cfg.in +++ b/arm-runtimes/test-support/llvm-libc++abi-picolibc.cfg.in @@ -7,7 +7,7 @@ config.name = 'libc++abi-@RUNTIME_VARIANT_NAME@' config.substitutions.append(('%{libc-include}', '@CMAKE_INSTALL_PREFIX@/include')) config.substitutions.append(('%{libc-lib}', '@CMAKE_INSTALL_PREFIX@/lib')) -config.substitutions.append(('%{libc-linker-script}', '@LIBC_LINKER_SCRIPT@')) +config.substitutions.append(('%{libc-extra-link-flags}', '@RUNTIME_TEST_LINK_FLAGS@')) config.substitutions.append(('%{flags}', '@RUNTIME_TEST_ARCH_FLAGS@')) config.substitutions.append(('%{compile_flags}', @@ -19,8 +19,8 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' - ' -T %{libc-linker-script}' + ' -lc -lm -lclang_rt.builtins' + ' %{libc-extra-link-flags}' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T -- ' diff --git a/test-support/llvm-libunwind-picolibc.cfg.in b/arm-runtimes/test-support/llvm-libunwind-picolibc.cfg.in similarity index 88% rename from test-support/llvm-libunwind-picolibc.cfg.in rename to arm-runtimes/test-support/llvm-libunwind-picolibc.cfg.in index 948b2143..d7942c16 100644 --- a/test-support/llvm-libunwind-picolibc.cfg.in +++ b/arm-runtimes/test-support/llvm-libunwind-picolibc.cfg.in @@ -8,7 +8,7 @@ config.name = 'libunwind-@RUNTIME_VARIANT_NAME@' config.substitutions.append(('%{libc-include}', '@CMAKE_INSTALL_PREFIX@/include')) config.substitutions.append(('%{libc-lib}', '@CMAKE_INSTALL_PREFIX@/lib')) -config.substitutions.append(('%{libc-linker-script}', '@LIBC_LINKER_SCRIPT@')) +config.substitutions.append(('%{libc-extra-link-flags}', '@RUNTIME_TEST_LINK_FLAGS@')) compile_flags = [] @@ -32,8 +32,8 @@ config.substitutions.append(('%{link_flags}', ' -nostdlib++ -L %{lib}' ' -lc++ -lc++abi -lunwind' ' -nostdlib -L %{libc-lib}' - ' -lc -lm -lclang_rt.builtins -lsemihost -nostartfiles -lcrt0-semihost' - ' -T %{libc-linker-script}' + ' -lc -lm -lclang_rt.builtins' + ' %{libc-extra-link-flags}' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T -- ' diff --git a/arm-runtimes/test-support/modify-compiler-rt-xml.py b/arm-runtimes/test-support/modify-compiler-rt-xml.py new file mode 100644 index 00000000..bc7c5383 --- /dev/null +++ b/arm-runtimes/test-support/modify-compiler-rt-xml.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# Helper script to modify the xml results from compiler-rt. + +# compiler-rt always puts all the test results into the "compiler-rt" +# testsuite in the junit xml file. We have multiple variants of +# compiler-rt, so the xml is modified to group the tests by variant. + +import argparse +import os +from xml.etree import ElementTree + + +def main(): + parser = argparse.ArgumentParser(description="Reformat compiler-rt xml results") + parser.add_argument( + "--dir", + required=True, + help="Path to compiler-rt build directory", + ) + parser.add_argument( + "--variant", + required=True, + help="Name of the variant under test", + ) + args = parser.parse_args() + + # A '.' character is used in junit xml to split classes/groups. + # Variants such as armv8m.main need to be renamed. + variant_name = args.variant.replace(".", "_") + + xml_file = os.path.join(args.dir, "test", "results.junit.xml") + + tree = ElementTree.parse(xml_file) + root = tree.getroot() + + # The compiler-rt Builtins tests runs two testsuites: TestCases and Unit + # TestCases are recorded in the "Builtins" suite. + # But the Unit tests are recorded in "Builtins-arm-generic" or similar. + # For readability, combine them all under compiler-rt-{variant}-Builtins + for testsuite in root.iter("testsuite"): + old_suitename = testsuite.get("name") + new_suitename = f"compiler-rt-{variant_name}-Builtins" + testsuite.set("name", new_suitename) + for testcase in testsuite.iter("testcase"): + old_classname = testcase.get("classname") + new_classname = old_classname.replace(old_suitename, new_suitename) + testcase.set("classname", new_classname) + + tree.write(xml_file) + print(f"Results written to {xml_file}") + +if __name__ == "__main__": + main() diff --git a/arm-runtimes/test-support/modify-picolibc-xml.py b/arm-runtimes/test-support/modify-picolibc-xml.py new file mode 100644 index 00000000..f194b6d9 --- /dev/null +++ b/arm-runtimes/test-support/modify-picolibc-xml.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 + +# Helper script to modify the xml results from picolibc. + +# Picolibc always puts all the test results into the "picolibc" +# testsuite in the junit xml file. We have multiple variants of +# picolibc, so the xml is modified to group the tests by variant. + +import argparse +import os +from xml.etree import ElementTree + + +def main(): + parser = argparse.ArgumentParser(description="Reformat picolibc xml results") + parser.add_argument( + "--dir", + required=True, + help="Path to picolibc build directory", + ) + parser.add_argument( + "--variant", + required=True, + help="Name of the variant under test", + ) + args = parser.parse_args() + + # A '.' character is used in junit xml to split classes/groups. + # Variants such as armv8m.main need to be renamed. + variant_name = args.variant.replace(".", "_") + + xml_file = os.path.join(args.dir, "meson-logs", "testlog.junit.xml") + + tree = ElementTree.parse(xml_file) + root = tree.getroot() + for testsuite in root.iter("testsuite"): + testsuite.set("name", f"picolibc-{variant_name}") + for testcase in root.iter("testcase"): + testcase.set("classname", f"picolibc-{variant_name}.picolibc-{variant_name}") + tree.write(xml_file) + print(f"Results written to {xml_file}") + + +if __name__ == "__main__": + main() diff --git a/test-support/picolibc-test-wrapper.py b/arm-runtimes/test-support/picolibc-test-wrapper.py similarity index 100% rename from test-support/picolibc-test-wrapper.py rename to arm-runtimes/test-support/picolibc-test-wrapper.py diff --git a/test-support/run_fvp.py b/arm-runtimes/test-support/run_fvp.py similarity index 100% rename from test-support/run_fvp.py rename to arm-runtimes/test-support/run_fvp.py diff --git a/test-support/run_qemu.py b/arm-runtimes/test-support/run_qemu.py similarity index 100% rename from test-support/run_qemu.py rename to arm-runtimes/test-support/run_qemu.py diff --git a/arm-runtimes/to_meson_list.cmake b/arm-runtimes/to_meson_list.cmake new file mode 100644 index 00000000..8a42db85 --- /dev/null +++ b/arm-runtimes/to_meson_list.cmake @@ -0,0 +1,9 @@ +# Converts a cmake list to a string, which can be interpreted as list content in +# meson configuration file. +# The delimiting brackets are not included. +# Example output: "'foo', 'bar', 'baz'" + +function(to_meson_list input_list out_var) + list(JOIN input_list "', '" input_list) + set(${out_var} "'${input_list}'" PARENT_SCOPE) +endfunction() diff --git a/cmake/fetch_llvm.cmake b/cmake/fetch_llvm.cmake new file mode 100644 index 00000000..22688197 --- /dev/null +++ b/cmake/fetch_llvm.cmake @@ -0,0 +1,33 @@ +# To avoid duplicating the FetchContent code, this file can be +# included by either the top-level toolchain cmake, or the +# arm-runtimes sub-project. +# FETCHCONTENT_SOURCE_DIR_LLVMPROJECT should be passed down from the +# top level to any library builds to prevent repeated checkouts. + +include(FetchContent) + +if(NOT VERSIONS_JSON) + include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) +endif() +read_repo_version(llvmproject llvm-project) + +set(llvm_patch_script ${CMAKE_CURRENT_LIST_DIR}/patch_llvm.py) +set(patch_dir ${CMAKE_CURRENT_LIST_DIR}/../patches) +set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${llvm_patch_script} ${patch_dir}/llvm-project) +if(APPLY_LLVM_PERFORMANCE_PATCHES) + set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${llvm_patch_script} ${patch_dir}/llvm-project-perf) +endif() + +FetchContent_Declare(llvmproject + GIT_REPOSITORY https://github.com/llvm/llvm-project.git + GIT_TAG "${llvmproject_TAG}" + GIT_SHALLOW "${llvmproject_SHALLOW}" + GIT_PROGRESS TRUE + PATCH_COMMAND ${LLVM_PATCH_COMMAND} + # Add the llvm subdirectory later to ensure that + # LLVMEmbeddedToolchainForArm is the first project declared. + # Otherwise CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT + # can't be used. + SOURCE_SUBDIR do_not_add_llvm_subdir_yet +) +FetchContent_MakeAvailable(llvmproject) diff --git a/cmake/fetch_newlib.cmake b/cmake/fetch_newlib.cmake new file mode 100644 index 00000000..1413145f --- /dev/null +++ b/cmake/fetch_newlib.cmake @@ -0,0 +1,25 @@ +# To avoid duplicating the FetchContent code, this file can be +# included by either the top-level toolchain cmake, or the +# arm-runtimes sub-project. +# FETCHCONTENT_SOURCE_DIR_NEWLIB should be passed down from the +# top level to any library builss to prevent repeated checkouts. + +include(FetchContent) + +if(NOT VERSIONS_JSON) + include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) +endif() +read_repo_version(newlib newlib) + +set(newlib_patch ${CMAKE_CURRENT_LIST_DIR}/../patches/newlib.patch) + +FetchContent_Declare(newlib + GIT_REPOSITORY https://sourceware.org/git/newlib-cygwin.git + GIT_TAG "${newlib_TAG}" + GIT_SHALLOW "${newlib_SHALLOW}" + GIT_PROGRESS TRUE + PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${newlib_patch} + # Similarly to picolibc, we don't do the configuration here. + SOURCE_SUBDIR do_not_add_newlib_subdir +) +FetchContent_MakeAvailable(newlib) diff --git a/cmake/fetch_picolibc.cmake b/cmake/fetch_picolibc.cmake new file mode 100644 index 00000000..3f4f8588 --- /dev/null +++ b/cmake/fetch_picolibc.cmake @@ -0,0 +1,31 @@ +# To avoid duplicating the FetchContent code, this file can be +# included by either the top-level toolchain cmake, or the +# arm-runtimes sub-project. +# FETCHCONTENT_SOURCE_DIR_PICOLIBC should be passed down from the +# top level to any library builss to prevent repeated checkouts. + +include(FetchContent) + +if(NOT VERSIONS_JSON) + include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) +endif() +read_repo_version(picolibc picolibc) + +set( + picolibc_patches + ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0001-Enable-libcxx-builds.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch +) + +FetchContent_Declare(picolibc + GIT_REPOSITORY https://github.com/picolibc/picolibc.git + GIT_TAG "${picolibc_TAG}" + GIT_SHALLOW "${picolibc_SHALLOW}" + GIT_PROGRESS TRUE + PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${picolibc_patches} + # We only want to download the content, not configure it at this + # stage. picolibc will be built in many configurations using + # ExternalProject_Add using the sources that are checked out here. + SOURCE_SUBDIR do_not_add_picolibc_subdir +) +FetchContent_MakeAvailable(picolibc) diff --git a/cmake/read_versions.cmake b/cmake/read_versions.cmake new file mode 100644 index 00000000..194e58e2 --- /dev/null +++ b/cmake/read_versions.cmake @@ -0,0 +1,22 @@ +# Read which revisions of the repos to use. +file(READ ${CMAKE_CURRENT_LIST_DIR}/../versions.json VERSIONS_JSON) +function(read_repo_version output_variable_prefix repo) + string(JSON tag GET ${VERSIONS_JSON} "repos" "${repo}" "tag") + string(JSON tagType GET ${VERSIONS_JSON} "repos" "${repo}" "tagType") + if(tagType STREQUAL "commithash") + # GIT_SHALLOW doesn't work with commit hashes. + set(shallow OFF) + elseif(tagType STREQUAL "branch") + set(shallow ON) + # CMake docs recommend that "branch names and tags should + # generally be specified as remote names" + set(tag "origin/${tag}") + elseif(tagType STREQUAL "tag") + set(shallow ON) + else() + message(FATAL_ERROR "Unrecognised tagType ${tagType}") + endif() + + set(${output_variable_prefix}_TAG "${tag}" PARENT_SCOPE) + set(${output_variable_prefix}_SHALLOW "${shallow}" PARENT_SCOPE) +endfunction() diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 80c3366c..8bf5cd57 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -157,3 +157,83 @@ and designed to improve performance in certain circumstances. To reduce divergence from upstream and potential patch conflicts, the performance patches are not applied by default, but can be enabled for an automatic checkout with the APPLY_LLVM_PERFORMANCE_PATCHES option. + +## Building individual library variants + +When working on library code, it may be useful to build a library variant +without having to rebuild the entire toolchain. + +Each variant is built using the `arm-runtimes` sub-project, and can be +configured and built directly if you provide a path to a LLVM build or install. + +The default CMake arguments to build a particular variant are stored in a JSON +format in the arm-multilib/json/variants folder, which can be loaded at +configuration with the `-DVARIANT_JSON` setting. Any additional options +provided on the command line will override values from he JSON. `-DC_LIBRARY` +will be required to set which library to build, and `-DLLVM_BINARY_DIR` should +point to a build or install of LLVM. + +For example, to build the `armv7a_soft_nofp` variant using `picolibc`, using +an existing LLVM build and source checkouts: + +``` +cd LLVM-embedded-toolchain-for-Arm +mkdir build-lib +cmake ../arm-runtimes -G Ninja \ + -DVARIANT_JSON=../arm-multilib/json/variants/armv7a_soft_nofp.json \ + -DC_LIBRARY=picolibc \ + -DLLVM_BINARY_DIR=/path/to/llvm \ + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc +ninja +``` + +If enabled and the required test executor available, tests can be run with +using specific test targets: +`ninja check-picolibc` +`ninja check-compiler-rt` +`ninja check-cxx` +`ninja check-cxxabi` +`ninja check-unwind` + +Alternatively, `ninja check-all` runs all enabled tests. + +## Building sets of libraries + +As well as individual libraries, it is also possible to build a set of +libraries without rebuilding the entire toolchain. The `arm-multilib` +sub-project builds and collects multiple libraries, and generates a +`multilib.yaml` file to map compile flags to variants. + +The `arm-multilib/multilib.json` file defines which variants are built and +their order in the mapping. This can be used to configure the project directly + +For example, building the picolibc variants using an existing LLVM build and +source checkouts: +``` +cd LLVM-embedded-toolchain-for-Arm +mkdir build-multilib +cmake ../arm-multilib -G Ninja \ + -DMULTILIB_JSON=../arm-multilib/json/multilib.json \ + -DC_LIBRARY=picolibc \ + -DLLVM_BINARY_DIR=/path/to/llvm \ + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc +ninja +``` +To only build a subset of the variants defined in the JSON file, +the `-DENABLE_VARIANTS` option controls which variants to build. +E.g, `-DENABLE_VARIANTS="aarch64a;armv7a_soft_nofp"` only builds the two +variants of `aarch64a` and `armv7a_soft_nofp`. + +If enabled and the required test executor available, tests can be run with +using specific test targets: + +`ninja check-picolibc` +`ninja check-compiler-rt` +`ninja check-cxx` +`ninja check-cxxabi` +`ninja check-unwind` + +Alternatively, `ninja check-all` runs all enabled tests. +`ninja check-` runs all the tests for that specific variant. diff --git a/test-support/run-picolibc-tests.py b/test-support/run-picolibc-tests.py deleted file mode 100755 index 8aa3b245..00000000 --- a/test-support/run-picolibc-tests.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2024, Arm Limited and affiliates. - -# This is a helper script to run the picolibc tests. -# -# This is just a glue code for cmake the script, not intended to be run -# manually. If you want to run the tests manually, using meson directly will -# provide you more options and is better documented: -# cd PICOLIBC_BUILD_DIR -# meson setup . PICOLIBC_SOURCE_DIR -Dtests=true --reconfigure -# meson test -# -# The tests for picolibc cannot be enabled at first invocation of meson, -# because compiler_rt is built after picolibc is built. If picolibc would be -# configured with tests enabled at before compiler_rt is built, the -# picolibc build would fail. This is why this script enables the tests just -# before picolibc is tested. -# -# Picolibc always puts all the test results into "picolibc" testsuite in the -# junit xml file. We have multiple variants of picolibc and so we add a -# classname to every test the tests are run. This has to be done even when the -# tests fail, while still returnning non-zero exit value, so that cmake detects -# failure. This would be hard to do from within the cmake script. - -import argparse -import sys -import re -import os.path -import subprocess - -help = "usage: run-picolibc-tests.py PICOLIBC_SOURCE_DIR PICOLIBC_BUILD_DIR" - - -def replace_classname(build_dir, classname): - xml_file_name = os.path.join(build_dir, "meson-logs", "testlog.junit.xml") - - with open(xml_file_name, "r") as f: - xml_file_data = f.read() - - xml_file_data = re.sub( - 'classname="picolibc"', - f'classname="picolibc.{classname}"', - xml_file_data, - ) - - with open(xml_file_name, "w") as f: - f.write(xml_file_data) - - -def run_tests(meson_command, source_dir, build_dir, variant): - - # meson<0.64.0 does not properly apply new configuration after - # "meson configure -Dtests=false" - # use "meson setup --reconfigure" as a workaround - subprocess.run( - [ - meson_command, - "setup", - ".", - source_dir, - "-Dtests=true", - "--reconfigure", - ], - cwd=build_dir, - check=True, - ) - - returncode = subprocess.run( - [meson_command, "test"], - cwd=build_dir, - ).returncode - - subprocess.run( - [meson_command, "configure", "-Dtests=false"], - cwd=build_dir, - check=True, - ) - - replace_classname(build_dir, variant) - - return returncode - - -def main(): - parser = argparse.ArgumentParser(description="Run picolibc tests") - parser.add_argument( - "--meson-command", required=True, default="meson", help="meson path" - ) - parser.add_argument( - "--picolibc-source-dir", - required=True, - help="path to picolibc sources", - ) - parser.add_argument( - "--picolibc-build-dir", - required=True, - help="path to picolibc build", - ) - parser.add_argument( - "--variant", - required=True, - help="name of the variant to be appended to the testsuite name", - ) - args = parser.parse_args() - ret_code = run_tests( - args.meson_command, - args.picolibc_source_dir, - args.picolibc_build_dir, - args.variant, - ) - sys.exit(ret_code) - - -if __name__ == "__main__": - main() From dca45e71b700fc7c337b888c5d1bacfa7fbb1f36 Mon Sep 17 00:00:00 2001 From: dcandler Date: Wed, 20 Nov 2024 14:14:55 +0000 Subject: [PATCH 085/138] Corrections to CMake changes to enable library sub-builds (#571) A number of corrections to the recent CMake changes: * Two scripts arguments were renamed during review, but the cmake steps calling the script weren't updated. * Our downstream test targets such as check-package-llvm-toolchain target require the path to an external llvm-lit in order to run the tests. * The variables to enable exceptions and RTTI are now cached and the names are capitalized, but CMake arguments needed updating to reflect this. * The PREBUILT_TARGET_LIBRARIES option is meant to disable the building of all libraries, on the assumption that pre-built libraries will be copied from another location. The functionality was accidentally removed, but has now been returned. * CMake automatically expands a string containing semi-colons to a list, but the ExternalProject argument must also be a semi-colon separated list. To get around this, convert the LLVM_TOOLCHAIN_LIBRARY_VARIANTS string to a comma separated list, since the LIST_SEPARATOR option will reinterpret this as a semi-colon list. * Previously, FVP testing was skipped if a FVP install was not available. However, this now throws a configuration error if testing relies on FVPs. But if you specifically want to test with FVPs, it is desirable to have the configuration error warn you with an if the install cannot be found. To resolve this, an additional option has been added to explicitly enable FVP testing, defaulting to OFF. This will override any settings from the variant JSON, so that the default case remains skipping FVP testing. --- CMakeLists.txt | 215 ++++++++++-------- arm-multilib/CMakeLists.txt | 50 ++-- ...rmv8.1m.main_hard_fp_nomve_pacret_bti.json | 2 +- ...ain_hard_fp_nomve_pacret_bti_exn_rtti.json | 2 +- ...v8.1m.main_hard_fpdp_nomve_pacret_bti.json | 2 +- ...n_hard_fpdp_nomve_pacret_bti_exn_rtti.json | 2 +- ...rmv8.1m.main_hard_nofp_mve_pacret_bti.json | 2 +- ...ain_hard_nofp_mve_pacret_bti_exn_rtti.json | 2 +- ...v8.1m.main_soft_nofp_nomve_pacret_bti.json | 2 +- ...n_soft_nofp_nomve_pacret_bti_exn_rtti.json | 2 +- arm-runtimes/CMakeLists.txt | 12 +- 11 files changed, 164 insertions(+), 129 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f32aa74..b24a36b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,10 @@ option( "During checkout, apply optional downstream patches to llvm-project to improve performance." ) +option( + ENABLE_FVP_TESTING + "Tests using FVP need to be explictly enabled." +) set( FVP_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fvp/install" CACHE STRING @@ -516,17 +520,10 @@ add_dependencies( version_txt ) -if(LIBS_DEPEND_ON_TOOLS) - set(lib_tool_dependencies - clang - lld - llvm-ar - llvm-config - llvm-nm - llvm-ranlib - llvm-strip - ) -endif() +# Set LLVM_DEFAULT_EXTERNAL_LIT to the directory of clang +# which was build in previous step. This path is not exported +# by add_subdirectory of llvm project +set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_BINARY_DIR}/bin/llvm-lit") add_custom_target(check-llvm-toolchain-runtimes) add_custom_target(check-${LLVM_TOOLCHAIN_C_LIBRARY}) @@ -535,116 +532,138 @@ add_custom_target(check-cxx) add_custom_target(check-cxxabi) add_custom_target(check-unwind) -add_dependencies( - check-llvm-toolchain-runtimes - check-${LLVM_TOOLCHAIN_C_LIBRARY} - check-compiler-rt - check-cxx - check-cxxabi - check-unwind -) +if(NOT PREBUILT_TARGET_LIBRARIES) + if(LIBS_DEPEND_ON_TOOLS) + set(lib_tool_dependencies + clang + lld + llvm-ar + llvm-config + llvm-nm + llvm-ranlib + llvm-strip + ) + endif() -if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) - # If we're building a non-default libc with the intention of - # installing it as an overlay on the main package archive, then - # all of its includes, libraries and multilib.yaml go in a - # subdirectory of lib/clang-runtimes. Configuration files in the - # bin directory will make it easy to reset the sysroot to point at - # that subdir. - set(library_subdir "/${LLVM_TOOLCHAIN_C_LIBRARY}") -else() - set(library_subdir "") -endif() -if(LIBS_USE_COMPILER_LAUNCHER) - if(CMAKE_C_COMPILER_LAUNCHER) - list(APPEND compiler_launcher_cmake_args "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}") + add_dependencies( + check-llvm-toolchain-runtimes + check-${LLVM_TOOLCHAIN_C_LIBRARY} + check-compiler-rt + check-cxx + check-cxxabi + check-unwind + ) + + if(LLVM_TOOLCHAIN_LIBRARY_OVERLAY_INSTALL) + # If we're building a non-default libc with the intention of + # installing it as an overlay on the main package archive, then + # all of its includes, libraries and multilib.yaml go in a + # subdirectory of lib/clang-runtimes. Configuration files in the + # bin directory will make it easy to reset the sysroot to point at + # that subdir. + set(library_subdir "/${LLVM_TOOLCHAIN_C_LIBRARY}") + else() + set(library_subdir "") endif() - if(CMAKE_CXX_COMPILER_LAUNCHER) - list(APPEND compiler_launcher_cmake_args "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") + + if(LIBS_USE_COMPILER_LAUNCHER) + if(CMAKE_C_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}") + endif() + if(CMAKE_CXX_COMPILER_LAUNCHER) + list(APPEND compiler_launcher_cmake_args "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") + endif() endif() -endif() -ExternalProject_Add( - multilib-${LLVM_TOOLCHAIN_C_LIBRARY} - PREFIX ${CMAKE_BINARY_DIR}/multilib-builds - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/arm-multilib - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir} - DEPENDS ${lib_tool_dependencies} - CMAKE_ARGS - ${compiler_launcher_cmake_args} - -DC_LIBRARY=${LLVM_TOOLCHAIN_C_LIBRARY} - -DLLVM_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/llvm - -DMULTILIB_JSON=${LLVM_TOOLCHAIN_MULTILIB_JSON} - -DENABLE_VARIANTS=${LLVM_TOOLCHAIN_LIBRARY_VARIANTS} - -DLIBC_HDRGEN=${LIBC_HDRGEN} - -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} - -DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config - -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT} - -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC} - -DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB} - -DCMAKE_INSTALL_PREFIX= - USES_TERMINAL_CONFIGURE FALSE - USES_TERMINAL_BUILD TRUE - USES_TERMINAL_TEST TRUE - LIST_SEPARATOR , - CONFIGURE_HANDLED_BY_BUILD TRUE - TEST_EXCLUDE_FROM_MAIN TRUE - STEP_TARGETS build install -) + # ENABLE_VARIANTS expects a semi-colon separated list. + # To prevent CMake expanding it automatically while passing it + # down, switch to comma separated. Enabling the ExternalProject + # LIST_SEPARATOR option will handle switching it back. + string(REPLACE ";" "," ENABLE_VARIANTS_PASSTHROUGH "${LLVM_TOOLCHAIN_LIBRARY_VARIANTS}") -add_dependencies( - llvm-toolchain-runtimes - multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install -) - -foreach(check_target check-${LLVM_TOOLCHAIN_C_LIBRARY} check-compiler-rt check-cxx check-cxxabi check-unwind) - ExternalProject_Add_Step( + ExternalProject_Add( multilib-${LLVM_TOOLCHAIN_C_LIBRARY} - ${check_target} - COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} - USES_TERMINAL TRUE - EXCLUDE_FROM_MAIN TRUE - ALWAYS TRUE + PREFIX ${CMAKE_BINARY_DIR}/multilib-builds + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/arm-multilib + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/llvm/${TARGET_LIBRARIES_DIR}${library_subdir} + DEPENDS ${lib_tool_dependencies} + CMAKE_ARGS + ${compiler_launcher_cmake_args} + -DC_LIBRARY=${LLVM_TOOLCHAIN_C_LIBRARY} + -DLLVM_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/llvm + -DMULTILIB_JSON=${LLVM_TOOLCHAIN_MULTILIB_JSON} + -DENABLE_VARIANTS=${ENABLE_VARIANTS_PASSTHROUGH} + -DLIBC_HDRGEN=${LIBC_HDRGEN} + -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} + -DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING} + -DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT} + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC} + -DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB} + -DCMAKE_INSTALL_PREFIX= + USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_BUILD TRUE + USES_TERMINAL_TEST TRUE + LIST_SEPARATOR , + CONFIGURE_HANDLED_BY_BUILD TRUE + TEST_EXCLUDE_FROM_MAIN TRUE + STEP_TARGETS build install ) - ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}) - ExternalProject_Add_StepDependencies( - multilib-${LLVM_TOOLCHAIN_C_LIBRARY} - ${check_target} + + add_dependencies( + llvm-toolchain-runtimes multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install ) - add_dependencies(${check_target} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}) -endforeach() - -# Read the json to generate variant specific target names for convenience. -file(READ ${LLVM_TOOLCHAIN_MULTILIB_JSON} multilib_json_str) -string(JSON multilib_defs GET ${multilib_json_str} "libs") -string(JSON lib_count LENGTH ${multilib_defs}) -math(EXPR lib_count_dec "${lib_count} - 1") - -foreach(lib_idx RANGE ${lib_count_dec}) - string(JSON lib_def GET ${multilib_defs} ${lib_idx}) - string(JSON variant GET ${lib_def} "variant") foreach(check_target check-${LLVM_TOOLCHAIN_C_LIBRARY} check-compiler-rt check-cxx check-cxxabi check-unwind) ExternalProject_Add_Step( multilib-${LLVM_TOOLCHAIN_C_LIBRARY} - ${check_target}-${variant} - COMMAND "${CMAKE_COMMAND}" --build --target ${check_target}-${variant} + ${check_target} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target} USES_TERMINAL TRUE EXCLUDE_FROM_MAIN TRUE ALWAYS TRUE ) - ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}-${variant}) + ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}) ExternalProject_Add_StepDependencies( multilib-${LLVM_TOOLCHAIN_C_LIBRARY} - ${check_target}-${variant} + ${check_target} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install ) - add_custom_target(${check_target}-${variant}) - add_dependencies(${check_target}-${variant} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}-${variant}) + add_dependencies(${check_target} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}) endforeach() -endforeach() + + # Read the json to generate variant specific target names for convenience. + file(READ ${LLVM_TOOLCHAIN_MULTILIB_JSON} multilib_json_str) + string(JSON multilib_defs GET ${multilib_json_str} "libs") + + string(JSON lib_count LENGTH ${multilib_defs}) + math(EXPR lib_count_dec "${lib_count} - 1") + + foreach(lib_idx RANGE ${lib_count_dec}) + string(JSON lib_def GET ${multilib_defs} ${lib_idx}) + string(JSON variant GET ${lib_def} "variant") + foreach(check_target check-${LLVM_TOOLCHAIN_C_LIBRARY} check-compiler-rt check-cxx check-cxxabi check-unwind) + ExternalProject_Add_Step( + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target}-${variant} + COMMAND "${CMAKE_COMMAND}" --build --target ${check_target}-${variant} + USES_TERMINAL TRUE + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + ) + ExternalProject_Add_StepTargets(multilib-${LLVM_TOOLCHAIN_C_LIBRARY} ${check_target}-${variant}) + ExternalProject_Add_StepDependencies( + multilib-${LLVM_TOOLCHAIN_C_LIBRARY} + ${check_target}-${variant} + multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-install + ) + add_custom_target(${check_target}-${variant}) + add_dependencies(${check_target}-${variant} multilib-${LLVM_TOOLCHAIN_C_LIBRARY}-${check_target}-${variant}) + endforeach() + endforeach() +endif() install( DIRECTORY ${LLVM_BINARY_DIR}/${TARGET_LIBRARIES_DIR}/. diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index a27bf752..62a3513b 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -33,6 +33,10 @@ set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.") set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") +option( + ENABLE_FVP_TESTING + "Tests using FVP need to be explictly enabled." +) set( FVP_INSTALL_DIR "" CACHE STRING @@ -151,6 +155,34 @@ foreach(lib_idx RANGE ${lib_count_dec}) ) set(variant_json_file ${CMAKE_CURRENT_SOURCE_DIR}/json/variants/${variant_json}) + # Read info from the variant specific json. + file(READ ${variant_json_file} variant_json_str) + string(JSON test_executor GET ${variant_json_str} "args" "common" "TEST_EXECUTOR") + + # FVP testing should default to off, so override any + # settings from the JSON. + if(test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING}) + set(additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF") + set(read_ENABLE_LIBC_TESTS "OFF") + set(read_ENABLE_COMPILER_RT_TESTS "OFF") + set(read_ENABLE_LIBCXX_TESTS "OFF") + else() + # From the json, check which tests are enabled. + foreach(test_enable_var + ENABLE_LIBC_TESTS + ENABLE_COMPILER_RT_TESTS + ENABLE_LIBCXX_TESTS + ) + string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" ${C_LIBRARY} ${test_enable_var}) + if(read_${test_enable_var} STREQUAL "json-NOTFOUND") + string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" "common" ${test_enable_var}) + if(read_${test_enable_var} STREQUAL "json-NOTFOUND") + set(read_${test_enable_var} "OFF") + endif() + endif() + endforeach() + endif() + ExternalProject_Add( runtimes-${variant} PREFIX ${CMAKE_BINARY_DIR}/lib-builds @@ -160,6 +192,7 @@ foreach(lib_idx RANGE ${lib_count_dec}) CMAKE_ARGS ${compiler_launcher_cmake_args} ${passthrough_dirs} + ${additional_cmake_args} -DVARIANT_JSON=${variant_json_file} -DC_LIBRARY=${C_LIBRARY} -DCMAKE_INSTALL_PREFIX= @@ -171,23 +204,6 @@ foreach(lib_idx RANGE ${lib_count_dec}) CONFIGURE_HANDLED_BY_BUILD TRUE TEST_EXCLUDE_FROM_MAIN TRUE ) - - # Read info from the variant specific json. - # From the json, check which tests are enabled. - file(READ ${variant_json_file} variant_json_str) - foreach(test_enable_var - ENABLE_LIBC_TESTS - ENABLE_COMPILER_RT_TESTS - ENABLE_LIBCXX_TESTS - ) - string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" ${C_LIBRARY} ${test_enable_var}) - if(read_${test_enable_var} STREQUAL "json-NOTFOUND") - string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" "common" ${test_enable_var}) - if(read_${test_enable_var} STREQUAL "json-NOTFOUND") - set(read_${test_enable_var} "OFF") - endif() - endif() - endforeach() set(check_targets "") if(read_ENABLE_LIBC_TESTS) list(APPEND check_targets check-${C_LIBRARY}) diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json index 38310c47..8e9e8f78 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json index c0f36770..ec4110e8 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fp_nomve_pacret_bti_exn_rtti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json index d51f2202..24fd0d09 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json index 0b221cd8..cef3207b 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_fpdp_nomve_pacret_bti_exn_rtti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json index 58c219bf..3ac88c14 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json index 34ea6ac4..40b8811e 100644 --- a/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json +++ b/arm-multilib/json/variants/armv8.1m.main_hard_nofp_mve_pacret_bti_exn_rtti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json index 599df22f..711e65fc 100644 --- a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json index e7bddab7..451889a4 100644 --- a/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json +++ b/arm-multilib/json/variants/armv8.1m.main_soft_nofp_nomve_pacret_bti_exn_rtti.json @@ -20,7 +20,7 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "release", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_LIBC_TESTS": "ON", "ENABLE_COMPILER_RT_TESTS": "OFF", "ENABLE_LIBCXX_TESTS": "OFF" }, diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 1d7e98ae..3208fd16 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -313,7 +313,7 @@ if(ENABLE_COMPILER_RT_TESTS) COMMAND "${CMAKE_COMMAND}" --build --target check-compiler-rt COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test-support/modify-compiler-rt-xml.py - --compiler-rt-build-dir + --dir --variant ${VARIANT} USES_TERMINAL TRUE EXCLUDE_FROM_MAIN TRUE @@ -431,7 +431,7 @@ if(C_LIBRARY STREQUAL picolibc) COMMAND ${MESON_EXECUTABLE} test -C COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test-support/modify-picolibc-xml.py - --picolibc-build-dir + --dir --variant ${VARIANT} USES_TERMINAL TRUE EXCLUDE_FROM_MAIN TRUE @@ -676,10 +676,10 @@ if(ENABLE_CXX_LIBS) -DLIBCXX_ENABLE_THREADS=OFF -DLIBCXX_ENABLE_WIDE_CHARACTERS=OFF -DLIBUNWIND_ENABLE_THREADS=OFF - -DLIBCXXABI_ENABLE_EXCEPTIONS=${enable_exceptions} - -DLIBCXXABI_ENABLE_STATIC_UNWINDER=${enable_exceptions} - -DLIBCXX_ENABLE_EXCEPTIONS=${enable_exceptions} - -DLIBCXX_ENABLE_RTTI=${enable_rtti} + -DLIBCXXABI_ENABLE_EXCEPTIONS=${ENABLE_EXCEPTIONS} + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=${ENABLE_EXCEPTIONS} + -DLIBCXX_ENABLE_EXCEPTIONS=${ENABLE_EXCEPTIONS} + -DLIBCXX_ENABLE_RTTI=${ENABLE_RTTI} ) if(ENABLE_LIBCXX_TESTS) set(cxxlibs_lit_args "${LLVM_LIT_ARGS} --xunit-xml-output=results.junit.xml") From 6209eba84a777c8f7049a807967d037d867fc57a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 21 Nov 2024 11:04:10 +0000 Subject: [PATCH 086/138] CMakeLists.txt: tiny fix to instructions comment. (#573) Now that our downstream picolibc changes are in the form of multiple patches in a subdirectory, it's better to apply them with 'git am' so they turn into separate commits, instead of 'git apply', the same way we do it for llvm-project. --- CMakeLists.txt | 2 +- docs/building-from-source.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b24a36b4..b8942842 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ # git -C repos clone https://github.com/llvm/llvm-project.git # git -C repos/llvm-project am -k $PWD/patches/llvm-project/*.patch # git -C repos clone https://github.com/picolibc/picolibc.git -# git -C repos/picolibc apply $PWD/patches/picolibc/*.patch +# git -C repos/picolibc am -k $PWD/patches/picolibc/*.patch # mkdir build # cd build # cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 8bf5cd57..9dcf6027 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -89,7 +89,7 @@ mkdir repos git -C repos clone https://github.com/llvm/llvm-project.git git -C repos/llvm-project am -k "$PWD"/patches/llvm-project/*.patch git -C repos clone https://github.com/picolibc/picolibc.git -git -C repos/picolibc apply "$PWD"/patches/picolibc/*.patch +git -C repos/picolibc am -k "$PWD"/patches/picolibc/*.patch mkdir build cd build cmake .. -GNinja -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=../repos/llvm-project -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=../repos/picolibc From d0b2af2736afdf3b001bc5a2bd27dc5e83db14a1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 21 Nov 2024 17:08:42 +0000 Subject: [PATCH 087/138] Docs fixes for arm-runtimes and arm-multilib sub-builds. (#575) The suggested build commands left out the usual `cd` after `mkdir`, so that if you followed them literally, you'd create an `arm-runtimes` or `arm-multilib` directory and then ignore it completely and put all your build debris at the level above it. Also, trying to follow the instructions, I was confused by the semantics of `LLVM_BINARY_DIR`: given the name, I instinctively pointed it at the actual `bin` directory, but it turned out I should have aimed one level up. Added some clarifying text, with particular reference to using a full build of this toolchain for a standalone build of one library. While I'm here, removed some apparently accidental physical tabs, so that all the continuation lines in the long cmake commands line up. --- docs/building-from-source.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 9dcf6027..c5baad80 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -171,7 +171,13 @@ format in the arm-multilib/json/variants folder, which can be loaded at configuration with the `-DVARIANT_JSON` setting. Any additional options provided on the command line will override values from he JSON. `-DC_LIBRARY` will be required to set which library to build, and `-DLLVM_BINARY_DIR` should -point to a build or install of LLVM. +point to the top-level directory of a build or install of LLVM. + +(The actual binaries, such as `clang`, are expected to be in +`$LLVM_BINARY_DIR/bin`, not `$LLVM_BINARY_DIR` itself. For example, if you're +using the results of a full build of this toolchain itself in another +directory, then you should set `LLVM_BINARY_DIR` to point at the `llvm` +subdirectory of the previous build tree, not the `llvm/bin` subdirectory.) For example, to build the `armv7a_soft_nofp` variant using `picolibc`, using an existing LLVM build and source checkouts: @@ -179,12 +185,13 @@ an existing LLVM build and source checkouts: ``` cd LLVM-embedded-toolchain-for-Arm mkdir build-lib +cd build-lib cmake ../arm-runtimes -G Ninja \ -DVARIANT_JSON=../arm-multilib/json/variants/armv7a_soft_nofp.json \ - -DC_LIBRARY=picolibc \ - -DLLVM_BINARY_DIR=/path/to/llvm \ - -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ - -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc + -DC_LIBRARY=picolibc \ + -DLLVM_BINARY_DIR=/path/to/llvm \ + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc ninja ``` @@ -213,12 +220,13 @@ source checkouts: ``` cd LLVM-embedded-toolchain-for-Arm mkdir build-multilib +cd build-multilib cmake ../arm-multilib -G Ninja \ -DMULTILIB_JSON=../arm-multilib/json/multilib.json \ - -DC_LIBRARY=picolibc \ - -DLLVM_BINARY_DIR=/path/to/llvm \ - -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ - -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc + -DC_LIBRARY=picolibc \ + -DLLVM_BINARY_DIR=/path/to/llvm \ + -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \ + -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc ninja ``` To only build a subset of the variants defined in the JSON file, From 327f60ce3132799455b492cdfa8c8cca8fc447f5 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 25 Nov 2024 13:28:39 +0000 Subject: [PATCH 088/138] Permit FVP tests to return a useful exit status. (#576) This allows picolibc tests to mark themselves as "skipped" by returning the special exit code 77. Previously that didn't work in an FVP test run, so those tests are marked as failed rather than skipped. In particular, test-sprintf-percent-n was affected, because we build picolibc in a mode that doesn't support printf("%n"), and that test knew it and was trying to return "skipped". Background: Fast Models does support the SYS_EXIT_EXTENDED semihosting request, which allows specifying an exit status. But it doesn't support the ":semihosting-features" pseudo-file that advertises support for non-default semihosting features including that one. So picolibc wrongly believes that SYS_EXIT_EXTENDED doesn't work, and doesn't try it. This commit works around that lack of support by simply creating a _real_ file called ":semihosting-features" in the directory where the model will run. Then picolibc does find it, and learns from it that it's allowed to SYS_EXIT_EXTENDED. This makes test-sprintf-percent-n stop failing. It also means we can remove the semihost-exit-extended test from the list of tests specially disabled on FVP runs, because now it works. --- arm-runtimes/test-support/picolibc-test-wrapper.py | 2 -- arm-runtimes/test-support/run_fvp.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arm-runtimes/test-support/picolibc-test-wrapper.py b/arm-runtimes/test-support/picolibc-test-wrapper.py index 2451599b..e391e692 100755 --- a/arm-runtimes/test-support/picolibc-test-wrapper.py +++ b/arm-runtimes/test-support/picolibc-test-wrapper.py @@ -40,8 +40,6 @@ ] disabled_tests_fvp = [ - # SDDKW-53824: ":semihosting-features" pseudo-file not implemented. - "test/semihost/semihost-exit-extended", # SDDKW-25808: SYS_SEEK returns wrong value. "test/semihost/semihost-seek", "test/test-fread-fwrite", diff --git a/arm-runtimes/test-support/run_fvp.py b/arm-runtimes/test-support/run_fvp.py index 1a882d2f..2822f0bd 100755 --- a/arm-runtimes/test-support/run_fvp.py +++ b/arm-runtimes/test-support/run_fvp.py @@ -67,6 +67,18 @@ def run_fvp( if verbose: print("running: {}".format(shlex.join(command))) + # SDDKW-53824: the ":semihosting-features" pseudo-file isn't simulated + # by these models. To work around that, we create one ourselves in the + # test process's working directory, containing the single feature flag + # SH_EXT_EXIT_EXTENDED, meaning that the SYS_EXIT_EXTENDED semihosting + # request will work. This permits the test program's exit status to be + # propagated to the exit status of the FVP, so that tests returning 77 + # for "test skipped" can be automatically detected. + with open( + path.join(working_directory, ":semihosting-features"), "wb" + ) as fh: + fh.write(b"SHFB\x01") + result = subprocess.run( command, stdout=subprocess.PIPE, From 1f255ac25207547e39c4e6542bef53d45777544e Mon Sep 17 00:00:00 2001 From: simpal01 Date: Mon, 25 Nov 2024 16:12:42 +0000 Subject: [PATCH 089/138] Make fvp work for anything other than aarch64 when being set as the test machine (#574) The current picolibc changes can't handle fvp being set as the test machine for anything other than aarch64. If fvp isn't set, it defaults to qemu, which works for now because the ARM fvp doesn't require anything special. However, when adding new aarch64 big-endian variants, one of the picolibc patches includes test-machine as an option in the Meson build scripts. Consequently, the library's CMake needs to set this option using -Dtest-machine=${TEST_EXECUTOR}. This means that for the armv8.1m library variant,we are explicitly passing the FPU, which can cause the error fvp: requested test machine not found since fvps are only defined for the aarch64 case. --- arm-runtimes/CMakeLists.txt | 1 + .../0002-Add-bootcode-for-AArch64-FVPs.patch | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 3208fd16..6493ef5d 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -390,6 +390,7 @@ if(C_LIBRARY STREQUAL picolibc) -Dmultilib=false -Dtests-enable-stack-protector=false -Dtest-long-double=${enable_picolibc_long_double_test} + -Dtest-machine=${TEST_EXECUTOR} -Dnewlib-nano-malloc=${newlib_nano_malloc} -Dtests=false --prefix diff --git a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch index cde586a3..f94b977d 100644 --- a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch +++ b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch @@ -1,6 +1,6 @@ -From f2ca20cebc85850a50b80424bb0f81c927edd04b Mon Sep 17 00:00:00 2001 +From 3b0b62ce6d81211a71eebe63b4b4ef0732da93ef Mon Sep 17 00:00:00 2001 From: Simi Pallipurath -Date: Thu, 14 Nov 2024 10:12:33 +0000 +Date: Mon, 25 Nov 2024 11:13:50 +0000 Subject: [PATCH 2/2] [PATCH 2/2] Add bootcode for AArch64 FVPs The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a @@ -18,12 +18,13 @@ few ways which affect the crt0 code: picocrt/machine/aarch64/crt0.S | 200 +++++++++++++++++++ picocrt/machine/aarch64/crt0.c | 198 +++---------------- picocrt/machine/aarch64/meson.build | 9 +- + picocrt/machine/arm/meson.build | 7 + picocrt/meson.build | 296 ++++++++++++++++------------ - 6 files changed, 404 insertions(+), 303 deletions(-) + 7 files changed, 411 insertions(+), 303 deletions(-) create mode 100644 picocrt/machine/aarch64/crt0.S diff --git a/meson.build b/meson.build -index 4161d6574..9d3f5c672 100644 +index 012d664bd..b8f43c800 100644 --- a/meson.build +++ b/meson.build @@ -151,6 +151,7 @@ multilib_exclude = get_option('multilib-exclude') @@ -534,6 +535,21 @@ index 808d691a5..923d32c3b 100644 + 'suffix': '-fvp', + }, +] +diff --git a/picocrt/machine/arm/meson.build b/picocrt/machine/arm/meson.build +index 808d691a5..ecc9a485b 100644 +--- a/picocrt/machine/arm/meson.build ++++ b/picocrt/machine/arm/meson.build +@@ -33,3 +33,10 @@ + # OF THE POSSIBILITY OF SUCH DAMAGE. + # + src_picocrt += files('crt0.c') ++ ++picocrt_machines += [ ++ { ++ 'name': 'fvp', ++ 'suffix': '-fvp', ++ }, ++] diff --git a/picocrt/meson.build b/picocrt/meson.build index 76965990f..be8f875be 100644 --- a/picocrt/meson.build @@ -868,3 +884,6 @@ index 76965990f..be8f875be 100644 + endforeach endforeach +-- +2.34.1 + From dbe235ad56d19261bfc6bbcc36e1dd7fb147f41c Mon Sep 17 00:00:00 2001 From: simpal01 Date: Tue, 26 Nov 2024 10:55:11 +0000 Subject: [PATCH 090/138] Add AArch64 Big Endian Variants using FVP models (#554) This patch add new aarch64 big endian library variants. 1. aarch64_be 2. aarch64_be_exn_rtti QEMU's doesn't have big-endian support in the release binaries. so need to use FVPs to test those libraries. --- arm-multilib/json/multilib.json | 10 +++++ arm-multilib/json/variants/aarch64a_be.json | 40 +++++++++++++++++++ .../json/variants/aarch64a_be_exn_rtti.json | 40 +++++++++++++++++++ fvp/config/big-endian.cfg | 1 + 4 files changed, 91 insertions(+) create mode 100644 arm-multilib/json/variants/aarch64a_be.json create mode 100644 arm-multilib/json/variants/aarch64a_be_exn_rtti.json create mode 100644 fvp/config/big-endian.cfg diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 7f675317..51a58288 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -10,6 +10,16 @@ "json": "aarch64a.json", "flags": "--target=aarch64-unknown-none-elf -fno-exceptions -fno-rtti" }, + { + "variant": "aarch64a_be_exn_rtti", + "json": "aarch64a_be_exn_rtti.json", + "flags": "--target=aarch64_be-unknown-none-elf" + }, + { + "variant": "aarch64a_be", + "json": "aarch64a_be.json", + "flags": "--target=aarch64_be-unknown-none-elf -fno-exceptions -fno-rtti" + }, { "variant": "armv4t_exn_rtti", "json": "armv4t_exn_rtti.json", diff --git a/arm-multilib/json/variants/aarch64a_be.json b/arm-multilib/json/variants/aarch64a_be.json new file mode 100644 index 00000000..429c1c65 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_be.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_be", + "COMPILE_FLAGS": "-march=armv8-a -mbig-endian", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64 big-endian", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/aarch64a_be_exn_rtti.json b/arm-multilib/json/variants/aarch64a_be_exn_rtti.json new file mode 100644 index 00000000..e0471393 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_be_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_be_exn_rtti", + "COMPILE_FLAGS": "-march=armv8-a -mbig-endian", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64 big-endian", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/fvp/config/big-endian.cfg b/fvp/config/big-endian.cfg new file mode 100644 index 00000000..4509f153 --- /dev/null +++ b/fvp/config/big-endian.cfg @@ -0,0 +1 @@ +cluster0.cpu0.CFGEND=1 From ed73480c611beb0d3973be66a7b2d1b9a4a3accc Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 26 Nov 2024 16:18:17 +0000 Subject: [PATCH 091/138] Fix install directory for FVP crypto plugin. (#577) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this patch, running get_fvps.sh --non-interactive would make a weirdly named directory in the user's home, with a name like "". or "." (depending on circumstances), with the crypto plugins installed in it. Now --non-interactive installs the plugins under fvp/install in your git checkout of this repository, which is where they should have been. The problem was because of this construction in get_fvps.sh: INSTALLER_FLAGS_CRYPTO="... --basepath \"$(dirname \"$0\")\"" which has multiple shell errors. Firstly, the \" around $0 are taken literally, so dirname is handed a path beginning with a double quote, which propagates into the path it returns. Secondly, the \" around $(dirname) are also literal, but _not_ reprocessed when $INSTALLER_FLAGS_CRYPTO is expanded on to the installer command line (because quote processing happens before variable expansion). The net effect is to give setup.bin a --basepath directory containing lots of confusing double quotes. For extra confusion, setup.bin appears to change directory to $HOME before interpreting that path, so you don't even get a strangely named directory under the FVP install directory – it appears in your home dir instead. Since this script already commits to bash rather than plain POSIX sh, the sensible fix for the quoting issues is to use a bash array variable to accumulate the extra arguments, and expand it via "${INSTALLER_FLAGS_CRYPTO[@]}". Also, the --basepath will need to be absolute rather than relative, to avoid confusion when setup.bin changes directory to $HOME. The easiest approach to _that_ is to use the fact that we were already issuing a `cd $(dirname "$0")` command to change into the fvp directory: do that earlier, and then we can use `$PWD` to retrieve the absolute path. This fixes --non-interactive. But another problem is that if you run setup.bin interactively, you'll have to enter the pathname by hand, and we don't give the user any guidance on what path to enter. So I've also updated the docs to explain the interactive installation more fully. This is all very error-prone, so I've also extended run_fvp.py so that it actually finds and loads the crypto plugin. That way, if it hasn't been installed in the right place, we find that out early, and can figure out what went wrong. (Finally, in this commit, I've also fixed a spelling error in one of the script's internal variables: CORSTONE, not CORSONE.) --- arm-runtimes/test-support/run_fvp.py | 5 +++++ docs/building-from-source.md | 19 +++++++++++++++---- fvp/get_fvps.sh | 27 +++++++++++++++------------ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/arm-runtimes/test-support/run_fvp.py b/arm-runtimes/test-support/run_fvp.py index 2822f0bd..8f3f9563 100755 --- a/arm-runtimes/test-support/run_fvp.py +++ b/arm-runtimes/test-support/run_fvp.py @@ -12,22 +12,26 @@ class FVP: model_exe: str tarmac_plugin: str + crypto_plugin: str cmdline_param: str MODELS = { "corstone-310": FVP( "Corstone-310/models/Linux64_GCC-9.3/FVP_Corstone_SSE-310", "Corstone-310/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "FastModelsPortfolio_11.27/plugins/Linux64_GCC-9.3/Crypto.so", "cpu0.semihosting-cmd_line", ), "aem-a": FVP( "Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3/FVP_Base_RevC-2xAEMvA", "Base_RevC_AEMvA_pkg/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "FastModelsPortfolio_11.27/plugins/Linux64_GCC-9.3/Crypto.so", "cluster0.cpu0.semihosting-cmd_line", ), "aem-r": FVP( "AEMv8R_base_pkg/models/Linux64_GCC-9.3/FVP_BaseR_AEMv8R", "AEMv8R_base_pkg/plugins/Linux64_GCC-9.3/TarmacTrace.so", + "FastModelsPortfolio_11.27/plugins/Linux64_GCC-9.3/Crypto.so", "cluster0.cpu0.semihosting-cmd_line", ), } @@ -56,6 +60,7 @@ def run_fvp( command.extend(["--config-file", path.join(fvp_config_dir, config + ".cfg")]) command.extend(["--application", image]) command.extend(["--parameter", f"{model.cmdline_param}={shlex.join(arguments)}"]) + command.extend(["--plugin", path.join(fvp_install_dir, model.crypto_plugin)]) if tarmac_file is not None: command.extend([ "--plugin", diff --git a/docs/building-from-source.md b/docs/building-from-source.md index c5baad80..ca44c172 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -47,11 +47,22 @@ which will prompt you to agree to their licenses. Some of the packages do not have installers, instead they place their license file into the `fvp/license_terms` directory, which you should read before continuing. +The installer for the cryptography plugin requires a graphical display to run: +it cannot run in a pure terminal session such as you might start via SSH. Also, +it will prompt for a directory to install the plugin into. You should enter the +pathname `fvp/install` relative to the root of your checkout. The installer +will automatically append a subdirectory `FastModelsPortfolio_11.27` to the end +of that, and respond with a warning such as 'Directory [...] not found (but in +patch mode). Continue installation?' Say yes to this prompt, and continue +clicking 'Next' until installation is complete. + For non-interactive use (for example in CI systems), `get_fvps.sh` can be run -with the `--non-interactive` option, which causes it to implcitly accept all of -the EULAs. If you have previously downloaded and installed the FVPs outside of -the source tree, you can set the `-DFVP_INSTALL_DIR=...` cmake option to set -the path to them. +with the `--non-interactive` option, which causes it to implicitly accept all +of the EULAs and set up the correct install directories. + +If you have previously downloaded and installed the FVPs outside of the source +tree, you can set the `-DFVP_INSTALL_DIR=...` cmake option to set the path to +them. If the FVPs are not installed, tests which need them will be skipped, but QEMU tests will still be run, and all library variants will still be built. diff --git a/fvp/get_fvps.sh b/fvp/get_fvps.sh index aa1ccd4b..379a5a63 100755 --- a/fvp/get_fvps.sh +++ b/fvp/get_fvps.sh @@ -15,14 +15,18 @@ set -euxo pipefail args=$(getopt --options "" --longoptions "non-interactive" -- "${@}") || exit eval "set -- ${args}" -INSTALLER_FLAGS_CORSTONE="" -INSTALLER_FLAGS_CRYPTO="" +# Change into the directory containing this script. We'll make +# "download" and "install" subdirectories below that. +cd "$(dirname "$0")" + +INSTALLER_FLAGS_CORSTONE=() +INSTALLER_FLAGS_CRYPTO=() while true; do case "${1}" in (--non-interactive) - INSTALLER_FLAGS_CORSTONE="--i-agree-to-the-contained-eula --no-interactive --force" - INSTALLER_FLAGS_CRYPTO="--i-accept-the-end-user-license-agreement --basepath \"$(dirname \"$0\")\"" + INSTALLER_FLAGS_CORSTONE=(--i-agree-to-the-contained-eula --no-interactive --force) + INSTALLER_FLAGS_CRYPTO=(--i-accept-the-end-user-license-agreement --basepath "$PWD/install") shift 1 ;; (--) @@ -34,17 +38,15 @@ while true; do esac done -URL_CORSONE_310='https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-310/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz?rev=c370b571bdff42d3a0152471eca3d798&hash=1E388EE3B6E8F675D02D2832DBE61946DEC0386A' +URL_CORSTONE_310='https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-310/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz?rev=c370b571bdff42d3a0152471eca3d798&hash=1E388EE3B6E8F675D02D2832DBE61946DEC0386A' URL_BASE_AEM_A='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.27/FVP_Base_RevC-2xAEMvA_11.27_19_Linux64.tgz' URL_BASE_AEM_R='https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.27/FVP_Base_AEMv8R_11.27_19_Linux64.tgz' URL_CRYPTO='https://developer.arm.com/-/cdn-downloads/permalink/Fast-Models-Crypto-Plug-in/FM-11.27/FastModels_crypto_11.27.019_Linux64.tgz' -cd "$(dirname "$0")" - mkdir -p download pushd download DOWNLOAD_DIR="$(pwd)" -wget --content-disposition --no-clobber "${URL_CORSONE_310}" +wget --content-disposition --no-clobber "${URL_CORSTONE_310}" wget --content-disposition --no-clobber "${URL_BASE_AEM_A}" wget --content-disposition --no-clobber "${URL_BASE_AEM_R}" wget --content-disposition --no-clobber "${URL_CRYPTO}" @@ -55,7 +57,7 @@ pushd install if [ ! -d "Corstone-310" ]; then tar -xf ${DOWNLOAD_DIR}/FVP_Corstone_SSE-310_11.24_13_Linux64.tgz -./FVP_Corstone_SSE-310.sh --destination ./Corstone-310 $INSTALLER_FLAGS_CORSTONE +./FVP_Corstone_SSE-310.sh --destination ./Corstone-310 "${INSTALLER_FLAGS_CORSTONE[@]}" fi if [ ! -d "Base_RevC_AEMvA_pkg" ]; then @@ -72,9 +74,10 @@ if [ ! -d "FastModelsPortfolio_11.27" ]; then tar -xf ${DOWNLOAD_DIR}/FastModels_crypto_11.27.019_Linux64.tgz # SDDKW-93582: Non-interactive installation fails if cwd is different. pushd FastModels_crypto_11.27.019_Linux64 -# This installer doesn't allow providing a default path for interactive -# installation. -./setup.bin $INSTALLER_FLAGS_CRYPTO +# This installer doesn't allow providing a default path for +# interactive installation. The user will have to enter the install +# directory as the target by hand. +./setup.bin "${INSTALLER_FLAGS_CRYPTO[@]}" popd fi From 00a466f21e8ec3ce4efc10a4ab35fcf52fc2aec0 Mon Sep 17 00:00:00 2001 From: simpal01 Date: Tue, 26 Nov 2024 16:21:35 +0000 Subject: [PATCH 092/138] Add Armv7a NO FP -mno-unaligned-access library variants (#553) This adds the following library: - armv7a_soft_nofp_strictly_aligned - armv7a_soft_nofp_strictly_aligned_exn_rtti --- arm-multilib/json/multilib.json | 10 +++++ .../armv7a_soft_nofp_strictly_aligned.json | 41 +++++++++++++++++++ ...a_soft_nofp_strictly_aligned_exn_rtti.json | 41 +++++++++++++++++++ test/multilib/armv7a.test | 9 ++++ 4 files changed, 101 insertions(+) create mode 100644 arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json create mode 100644 arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 51a58288..bc24d620 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -60,6 +60,16 @@ "json": "armv7a_soft_nofp.json", "flags": "--target=armv7-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, + { + "variant": "armv7a_soft_nofp_strictly_aligned_exn_rtti", + "json": "armv7a_soft_nofp_strictly_aligned_exn_rtti.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access" + }, + { + "variant": "armv7a_soft_nofp_strictly_aligned", + "json": "armv7a_soft_nofp_strictly_aligned.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access -fno-exceptions -fno-rtti" + }, { "variant": "armv7a_hard_vfpv3_d16_exn_rtti", "json": "armv7a_hard_vfpv3_d16_exn_rtti.json", diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json b/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json new file mode 100644 index 00000000..aea94f10 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_nofp_strictly_aligned", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a7", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json new file mode 100644 index 00000000..cc285a0c --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_nofp_strictly_aligned_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a7", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index 3d246b8c..3f3eecc8 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -7,6 +7,15 @@ # CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} # CHECK-EMPTY: +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=CHECK-NOUNALIGNED %s +# CHECK-NOUNALIGNED: arm-none-eabi/armv7a_soft_nofp_strictly_aligned_exn_rtti{{$}} +# CHECK-NOUNALIGNED-EMPTY: + # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3 %s From 4b047f6d830cd27d9ff128b033f22145c755c61e Mon Sep 17 00:00:00 2001 From: simpal01 Date: Tue, 26 Nov 2024 16:25:54 +0000 Subject: [PATCH 093/138] Add aarch64 library variants for no-unaligned-access (#572) This introduces new library variants for aarch64 to support targets where unaligned memory accesses are disabled. To enable these changes a patch to picolibc was required, ensuring the assembly implemenation that relies on unaligned accesses is not used when __ARM_FEATURE_UNALIGNED is not defined. Co-authored by: @pratlucas ( (https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/pull/567) --------- Co-authored-by: Lucas Prates --- arm-multilib/json/multilib.json | 12 +- .../json/variants/aarch64a_strictalign.json | 40 ++ .../aarch64a_strictalign_exn_rtti.json | 40 ++ .../picolibc/0001-Enable-libcxx-builds.patch | 7 +- .../0002-Add-bootcode-for-AArch64-FVPs.patch | 7 +- ...strict-align-no-unaligned-access-in-.patch | 431 ++++++++++++++++++ ...Code-Changes-to-enable-the-Alignment.patch | 68 +++ 7 files changed, 598 insertions(+), 7 deletions(-) create mode 100644 arm-multilib/json/variants/aarch64a_strictalign.json create mode 100644 arm-multilib/json/variants/aarch64a_strictalign_exn_rtti.json create mode 100644 patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch create mode 100644 patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index bc24d620..73d1bc95 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -10,7 +10,7 @@ "json": "aarch64a.json", "flags": "--target=aarch64-unknown-none-elf -fno-exceptions -fno-rtti" }, - { + { "variant": "aarch64a_be_exn_rtti", "json": "aarch64a_be_exn_rtti.json", "flags": "--target=aarch64_be-unknown-none-elf" @@ -20,6 +20,16 @@ "json": "aarch64a_be.json", "flags": "--target=aarch64_be-unknown-none-elf -fno-exceptions -fno-rtti" }, + { + "variant": "aarch64a_strictalign_exn_rtti", + "json": "aarch64a_strictalign_exn_rtti.json", + "flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access" + }, + { + "variant": "aarch64a_strictalign", + "json": "aarch64a_strictalign.json", + "flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access -fno-exceptions -fno-rtti" + }, { "variant": "armv4t_exn_rtti", "json": "armv4t_exn_rtti.json", diff --git a/arm-multilib/json/variants/aarch64a_strictalign.json b/arm-multilib/json/variants/aarch64a_strictalign.json new file mode 100644 index 00000000..98cc33c1 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_strictalign.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_strictalign", + "COMPILE_FLAGS": "-march=armv8-a -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/aarch64a_strictalign_exn_rtti.json b/arm-multilib/json/variants/aarch64a_strictalign_exn_rtti.json new file mode 100644 index 00000000..1f579b9c --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_strictalign_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_strictalign_exn_rtti", + "COMPILE_FLAGS": "-march=armv8-a -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/patches/picolibc/0001-Enable-libcxx-builds.patch b/patches/picolibc/0001-Enable-libcxx-builds.patch index 4ff07a16..7960ca12 100644 --- a/patches/picolibc/0001-Enable-libcxx-builds.patch +++ b/patches/picolibc/0001-Enable-libcxx-builds.patch @@ -1,7 +1,7 @@ -From 42f07bef7775a1387f9707e959f8b6782f9d6808 Mon Sep 17 00:00:00 2001 +From 028fe75e045951a9d091008a85971523358160db Mon Sep 17 00:00:00 2001 From: Simi Pallipurath Date: Thu, 14 Nov 2024 10:07:08 +0000 -Subject: [PATCH 1/2] [PATCH 1/2] Enable libcxx builds +Subject: Enable libcxx builds Modifications to build config and linker script required to enable libc++ builds. @@ -47,3 +47,6 @@ index 7b63ba172..cda5e1e7e 100644 *(.gnu.linkonce.t.*) KEEP (*(.fini .fini.*)) @PREFIX@__text_end = .; +-- +2.39.5 (Apple Git-154) + diff --git a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch index f94b977d..6cd23938 100644 --- a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch +++ b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch @@ -1,7 +1,7 @@ -From 3b0b62ce6d81211a71eebe63b4b4ef0732da93ef Mon Sep 17 00:00:00 2001 +From 58451642e678817d8822b04b8ff07ee4758a8f10 Mon Sep 17 00:00:00 2001 From: Simi Pallipurath -Date: Mon, 25 Nov 2024 11:13:50 +0000 -Subject: [PATCH 2/2] [PATCH 2/2] Add bootcode for AArch64 FVPs +Date: Thu, 14 Nov 2024 10:12:33 +0000 +Subject: Add bootcode for AArch64 FVPs The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a few ways which affect the crt0 code: @@ -886,4 +886,3 @@ index 76965990f..be8f875be 100644 endforeach -- 2.34.1 - diff --git a/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch b/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch new file mode 100644 index 00000000..eb366cc6 --- /dev/null +++ b/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch @@ -0,0 +1,431 @@ +From 79f3ce1b5f730b0293e8452d4e028e34c0e71736 Mon Sep 17 00:00:00 2001 +From: Lucas Prates +Date: Mon, 11 Nov 2024 16:37:04 +0000 +Subject: Add support for strict-align/no-unaligned-access in AArch64 + +--- + newlib/libc/machine/aarch64/memchr-stub.c | 2 +- + newlib/libc/machine/aarch64/memchr.S | 2 +- + newlib/libc/machine/aarch64/memcmp-stub.c | 2 +- + newlib/libc/machine/aarch64/memcmp.S | 2 +- + newlib/libc/machine/aarch64/memcpy-stub.c | 2 +- + newlib/libc/machine/aarch64/memcpy.S | 2 +- + newlib/libc/machine/aarch64/memmove-stub.c | 2 +- + newlib/libc/machine/aarch64/memrchr-stub.c | 2 +- + newlib/libc/machine/aarch64/memrchr.S | 2 +- + newlib/libc/machine/aarch64/memset-stub.c | 2 +- + newlib/libc/machine/aarch64/memset.S | 2 +- + newlib/libc/machine/aarch64/rawmemchr-stub.c | 2 +- + newlib/libc/machine/aarch64/rawmemchr.S | 2 +- + newlib/libc/machine/aarch64/stpcpy-stub.c | 2 +- + newlib/libc/machine/aarch64/strchr-stub.c | 2 +- + newlib/libc/machine/aarch64/strchr.S | 2 +- + newlib/libc/machine/aarch64/strchrnul-stub.c | 2 +- + newlib/libc/machine/aarch64/strchrnul.S | 2 +- + newlib/libc/machine/aarch64/strcmp-stub.c | 2 +- + newlib/libc/machine/aarch64/strcmp.S | 2 +- + newlib/libc/machine/aarch64/strcpy-stub.c | 2 +- + newlib/libc/machine/aarch64/strcpy.S | 2 +- + newlib/libc/machine/aarch64/strlen-stub.c | 2 +- + newlib/libc/machine/aarch64/strlen.S | 2 +- + newlib/libc/machine/aarch64/strncmp-stub.c | 2 +- + newlib/libc/machine/aarch64/strncmp.S | 2 +- + newlib/libc/machine/aarch64/strnlen-stub.c | 2 +- + newlib/libc/machine/aarch64/strnlen.S | 2 +- + newlib/libc/machine/aarch64/strrchr-stub.c | 2 +- + newlib/libc/machine/aarch64/strrchr.S | 2 +- + 30 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/newlib/libc/machine/aarch64/memchr-stub.c b/newlib/libc/machine/aarch64/memchr-stub.c +index c887bc62f..735fc9d31 100644 +--- a/newlib/libc/machine/aarch64/memchr-stub.c ++++ b/newlib/libc/machine/aarch64/memchr-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/memchr.c" + #else + /* See memchr.S */ +diff --git a/newlib/libc/machine/aarch64/memchr.S b/newlib/libc/machine/aarch64/memchr.S +index 29fc3c3c8..70686a8da 100644 +--- a/newlib/libc/machine/aarch64/memchr.S ++++ b/newlib/libc/machine/aarch64/memchr.S +@@ -7,7 +7,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See memchr-stub.c */ + #else + /* Assumptions: +diff --git a/newlib/libc/machine/aarch64/memcmp-stub.c b/newlib/libc/machine/aarch64/memcmp-stub.c +index af0cebf37..11aa224dc 100644 +--- a/newlib/libc/machine/aarch64/memcmp-stub.c ++++ b/newlib/libc/machine/aarch64/memcmp-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/memcmp.c" + #else + /* See memcmp.S */ +diff --git a/newlib/libc/machine/aarch64/memcmp.S b/newlib/libc/machine/aarch64/memcmp.S +index 11352ff21..2c9c8e9e3 100644 +--- a/newlib/libc/machine/aarch64/memcmp.S ++++ b/newlib/libc/machine/aarch64/memcmp.S +@@ -6,7 +6,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See memcmp-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/memcpy-stub.c b/newlib/libc/machine/aarch64/memcpy-stub.c +index 145f638da..df8bcf588 100644 +--- a/newlib/libc/machine/aarch64/memcpy-stub.c ++++ b/newlib/libc/machine/aarch64/memcpy-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/memcpy.c" + #else + /* See memcpy.S */ +diff --git a/newlib/libc/machine/aarch64/memcpy.S b/newlib/libc/machine/aarch64/memcpy.S +index 39ff69a16..11e573ee0 100644 +--- a/newlib/libc/machine/aarch64/memcpy.S ++++ b/newlib/libc/machine/aarch64/memcpy.S +@@ -13,7 +13,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + /* See memcpy-stub.c */ + #else + #include "asmdefs.h" +diff --git a/newlib/libc/machine/aarch64/memmove-stub.c b/newlib/libc/machine/aarch64/memmove-stub.c +index 41fd6643c..8498d3459 100644 +--- a/newlib/libc/machine/aarch64/memmove-stub.c ++++ b/newlib/libc/machine/aarch64/memmove-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/memmove.c" + #else + /* See memcpy.S */ +diff --git a/newlib/libc/machine/aarch64/memrchr-stub.c b/newlib/libc/machine/aarch64/memrchr-stub.c +index 63504543c..b9dc29211 100644 +--- a/newlib/libc/machine/aarch64/memrchr-stub.c ++++ b/newlib/libc/machine/aarch64/memrchr-stub.c +@@ -6,7 +6,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + #include "../../string/memrchr.c" + #else + /* See memrchr.S */ +diff --git a/newlib/libc/machine/aarch64/memrchr.S b/newlib/libc/machine/aarch64/memrchr.S +index a843de79e..d442e3d13 100644 +--- a/newlib/libc/machine/aarch64/memrchr.S ++++ b/newlib/libc/machine/aarch64/memrchr.S +@@ -13,7 +13,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See memrchr-stub.c */ + #else + #include "asmdefs.h" +diff --git a/newlib/libc/machine/aarch64/memset-stub.c b/newlib/libc/machine/aarch64/memset-stub.c +index e7e8b54f7..3c51d470f 100644 +--- a/newlib/libc/machine/aarch64/memset-stub.c ++++ b/newlib/libc/machine/aarch64/memset-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/memset.c" + #else + /* See memset.S */ +diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S +index 87a419964..7bb4525f4 100644 +--- a/newlib/libc/machine/aarch64/memset.S ++++ b/newlib/libc/machine/aarch64/memset.S +@@ -13,7 +13,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See memset-stub.c */ + #else + #include "asmdefs.h" +diff --git a/newlib/libc/machine/aarch64/rawmemchr-stub.c b/newlib/libc/machine/aarch64/rawmemchr-stub.c +index 032e0560c..c57f3ec30 100644 +--- a/newlib/libc/machine/aarch64/rawmemchr-stub.c ++++ b/newlib/libc/machine/aarch64/rawmemchr-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/rawmemchr.c" + #else + /* See rawmemchr.S. */ +diff --git a/newlib/libc/machine/aarch64/rawmemchr.S b/newlib/libc/machine/aarch64/rawmemchr.S +index dc4b257dd..4b114e746 100644 +--- a/newlib/libc/machine/aarch64/rawmemchr.S ++++ b/newlib/libc/machine/aarch64/rawmemchr.S +@@ -32,7 +32,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + /* See rawmemchr-stub.c. */ + #else + +diff --git a/newlib/libc/machine/aarch64/stpcpy-stub.c b/newlib/libc/machine/aarch64/stpcpy-stub.c +index 045f1a551..d7fe3066a 100644 +--- a/newlib/libc/machine/aarch64/stpcpy-stub.c ++++ b/newlib/libc/machine/aarch64/stpcpy-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/stpcpy.c" + #else + /* See stpcpy.S */ +diff --git a/newlib/libc/machine/aarch64/strchr-stub.c b/newlib/libc/machine/aarch64/strchr-stub.c +index b9ae08393..90eb01da2 100644 +--- a/newlib/libc/machine/aarch64/strchr-stub.c ++++ b/newlib/libc/machine/aarch64/strchr-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/strchr.c" + #else + /* See strchr.S */ +diff --git a/newlib/libc/machine/aarch64/strchr.S b/newlib/libc/machine/aarch64/strchr.S +index a735889b1..6e3575aa0 100644 +--- a/newlib/libc/machine/aarch64/strchr.S ++++ b/newlib/libc/machine/aarch64/strchr.S +@@ -28,7 +28,7 @@ + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strchr-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strchrnul-stub.c b/newlib/libc/machine/aarch64/strchrnul-stub.c +index aa1208cbb..e88cee2c6 100644 +--- a/newlib/libc/machine/aarch64/strchrnul-stub.c ++++ b/newlib/libc/machine/aarch64/strchrnul-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/strchrnul.c" + #else + /* See strchrnul.S */ +diff --git a/newlib/libc/machine/aarch64/strchrnul.S b/newlib/libc/machine/aarch64/strchrnul.S +index c60cef7d0..3a0b1dfde 100644 +--- a/newlib/libc/machine/aarch64/strchrnul.S ++++ b/newlib/libc/machine/aarch64/strchrnul.S +@@ -28,7 +28,7 @@ + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strchrnul-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strcmp-stub.c b/newlib/libc/machine/aarch64/strcmp-stub.c +index 652e4f651..c8d60c56d 100644 +--- a/newlib/libc/machine/aarch64/strcmp-stub.c ++++ b/newlib/libc/machine/aarch64/strcmp-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/strcmp.c" + #else + /* See strcmp.S */ +diff --git a/newlib/libc/machine/aarch64/strcmp.S b/newlib/libc/machine/aarch64/strcmp.S +index 641d6ae22..82635762b 100644 +--- a/newlib/libc/machine/aarch64/strcmp.S ++++ b/newlib/libc/machine/aarch64/strcmp.S +@@ -7,7 +7,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strcmp-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strcpy-stub.c b/newlib/libc/machine/aarch64/strcpy-stub.c +index 4cfa19e9c..4f9a95100 100644 +--- a/newlib/libc/machine/aarch64/strcpy-stub.c ++++ b/newlib/libc/machine/aarch64/strcpy-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/strcpy.c" + #else + /* See strcpy.S */ +diff --git a/newlib/libc/machine/aarch64/strcpy.S b/newlib/libc/machine/aarch64/strcpy.S +index 62e5f3f37..eecb81bb5 100644 +--- a/newlib/libc/machine/aarch64/strcpy.S ++++ b/newlib/libc/machine/aarch64/strcpy.S +@@ -28,7 +28,7 @@ + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strcpy-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strlen-stub.c b/newlib/libc/machine/aarch64/strlen-stub.c +index 3d9c3876c..ec44c927c 100644 +--- a/newlib/libc/machine/aarch64/strlen-stub.c ++++ b/newlib/libc/machine/aarch64/strlen-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/strlen.c" + #else + /* See strlen.S */ +diff --git a/newlib/libc/machine/aarch64/strlen.S b/newlib/libc/machine/aarch64/strlen.S +index 8e1a7cb7a..5204ad80d 100644 +--- a/newlib/libc/machine/aarch64/strlen.S ++++ b/newlib/libc/machine/aarch64/strlen.S +@@ -25,7 +25,7 @@ + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strlen-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strncmp-stub.c b/newlib/libc/machine/aarch64/strncmp-stub.c +index 504c12d7b..6751bad38 100644 +--- a/newlib/libc/machine/aarch64/strncmp-stub.c ++++ b/newlib/libc/machine/aarch64/strncmp-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/strncmp.c" + #else + /* See strncmp.S */ +diff --git a/newlib/libc/machine/aarch64/strncmp.S b/newlib/libc/machine/aarch64/strncmp.S +index b2470a408..34c8bbec2 100644 +--- a/newlib/libc/machine/aarch64/strncmp.S ++++ b/newlib/libc/machine/aarch64/strncmp.S +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strncmp-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strnlen-stub.c b/newlib/libc/machine/aarch64/strnlen-stub.c +index 2f50cdbdf..b1757b1ff 100644 +--- a/newlib/libc/machine/aarch64/strnlen-stub.c ++++ b/newlib/libc/machine/aarch64/strnlen-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + # include "../../string/strnlen.c" + #else + /* See strnlen.S */ +diff --git a/newlib/libc/machine/aarch64/strnlen.S b/newlib/libc/machine/aarch64/strnlen.S +index e64137665..40fbeafb0 100644 +--- a/newlib/libc/machine/aarch64/strnlen.S ++++ b/newlib/libc/machine/aarch64/strnlen.S +@@ -28,7 +28,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strnlen-stub.c */ + #else + +diff --git a/newlib/libc/machine/aarch64/strrchr-stub.c b/newlib/libc/machine/aarch64/strrchr-stub.c +index b8fe32f75..362a7086b 100644 +--- a/newlib/libc/machine/aarch64/strrchr-stub.c ++++ b/newlib/libc/machine/aarch64/strrchr-stub.c +@@ -26,7 +26,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined (__ARM_FEATURE_UNALIGNED) + # include "../../string/strrchr.c" + #else + /* See strrchr.S */ +diff --git a/newlib/libc/machine/aarch64/strrchr.S b/newlib/libc/machine/aarch64/strrchr.S +index 1fccba9f8..2f0cdc0c7 100644 +--- a/newlib/libc/machine/aarch64/strrchr.S ++++ b/newlib/libc/machine/aarch64/strrchr.S +@@ -29,7 +29,7 @@ + + #include + +-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) ++#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) || !defined(__LP64__) || !defined(__ARM_NEON) || !defined(__ARM_FEATURE_UNALIGNED) + /* See strrchr-stub.c */ + #else + +-- +2.39.5 (Apple Git-154) + diff --git a/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch b/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch new file mode 100644 index 00000000..0a0bd275 --- /dev/null +++ b/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch @@ -0,0 +1,68 @@ +From 11abbd6533eeacbb000fc19bd07316e11fcb6fea Mon Sep 17 00:00:00 2001 +From: Simi Pallipurath +Date: Tue, 26 Nov 2024 15:20:50 +0000 +Subject: [ARM/AARCH64] BootCode Changes to enable the Alignment Check + bit and disable the unaligned access bit + +We need changes in both Arm/AArch64 bootcode in +order for the -mno-unaligned-access to work. + +We need to enable the Alignment Check bit in the +System Control Register (SCTLR) which is the +Bit 1 (A) and it turn on alignment fault checking +for data accesses . If an unaligned data access +occurs, an alignment fault exception will be generated. + +Also need to disable the Unaligned Access Enable(U) bit +in the System Control Register (SCTLR). As a result, +unaligned data accesses will generate an alignment fault exception. +--- + picocrt/machine/aarch64/crt0.c | 7 ++++++- + picocrt/machine/arm/crt0.c | 6 ++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/picocrt/machine/aarch64/crt0.c b/picocrt/machine/aarch64/crt0.c +index dfe838111..885282f4d 100644 +--- a/picocrt/machine/aarch64/crt0.c ++++ b/picocrt/machine/aarch64/crt0.c +@@ -144,7 +144,12 @@ void _cstart(void) + */ + __asm__("mrs %x0, sctlr_"BOOT_EL"" : "=r" (sctlr)); + sctlr |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; +- sctlr &= ~(SCTLR_A | SCTLR_WXN); ++ #ifdef __ARM_FEATURE_UNALIGNED ++ sctlr &= ~SCTLR_A; ++ #else ++ sctlr |= SCTLR_A; ++ #endif ++ sctlr &= ~SCTLR_WXN; + __asm__("msr sctlr_"BOOT_EL", %x0" :: "r" (sctlr)); + __asm__("isb\n"); + +diff --git a/picocrt/machine/arm/crt0.c b/picocrt/machine/arm/crt0.c +index 60efafc9c..e27ccb6a9 100644 +--- a/picocrt/machine/arm/crt0.c ++++ b/picocrt/machine/arm/crt0.c +@@ -246,6 +246,8 @@ _cstart(void) + #define SCTLR_BRANCH_PRED (1 << 11) + #define SCTLR_ICACHE (1 << 12) + #define SCTLR_TRE (1 << 28) ++#define SCTLR_A (1 << 1) ++#define SCTLR_U (1 << 22) + + uint32_t mmfr0; + __asm__("mrc p15, 0, %0, c0, c1, 4" : "=r" (mmfr0)); +@@ -280,6 +282,10 @@ _cstart(void) + uint32_t sctlr; + __asm__("mrc p15, 0, %0, c1, c0, 0" : "=r" (sctlr)); + sctlr |= SCTLR_ICACHE | SCTLR_BRANCH_PRED | SCTLR_DATA_L2 | SCTLR_MMU; ++ #ifndef __ARM_FEATURE_UNALIGNED ++ sctlr |= SCTLR_A; ++ sctlr &= ~SCTLR_U; ++ #endif + sctlr &= ~SCTLR_TRE; + __asm__("mcr p15, 0, %0, c1, c0, 0\n" :: "r" (sctlr)); + __asm__("isb\n"); +-- +2.34.1 + From 8d4f804d251f8e8ba00ffe82f4e37af058cb532a Mon Sep 17 00:00:00 2001 From: simpal01 Date: Tue, 26 Nov 2024 16:53:33 +0000 Subject: [PATCH 094/138] Rename the variant name from strictly_aligned to strictalign. (#578) Rename the variant name from strictly_aligned to strictalign inorder to match with the corresponding aarch64 variant for -mno-unaligned-access. --- arm-multilib/json/multilib.json | 10 +++++----- ..._aligned.json => armv7a_soft_nofp_strictalign.json} | 4 ++-- ...json => armv7a_soft_nofp_strictalign_exn_rtti.json} | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename arm-multilib/json/variants/{armv7a_soft_nofp_strictly_aligned.json => armv7a_soft_nofp_strictalign.json} (95%) rename arm-multilib/json/variants/{armv7a_soft_nofp_strictly_aligned_exn_rtti.json => armv7a_soft_nofp_strictalign_exn_rtti.json} (94%) diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 73d1bc95..6b532ed9 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -71,13 +71,13 @@ "flags": "--target=armv7-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, { - "variant": "armv7a_soft_nofp_strictly_aligned_exn_rtti", - "json": "armv7a_soft_nofp_strictly_aligned_exn_rtti.json", + "variant": "armv7a_soft_nofp_strictalign_exn_rtti", + "json": "armv7a_soft_nofp_strictalign_exn_rtti.json", "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access" }, { - "variant": "armv7a_soft_nofp_strictly_aligned", - "json": "armv7a_soft_nofp_strictly_aligned.json", + "variant": "armv7a_soft_nofp_strictalign", + "json": "armv7a_soft_nofp_strictalign.json", "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access -fno-exceptions -fno-rtti" }, { @@ -286,4 +286,4 @@ "flags": "--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -mbranch-protection=pac-ret+bti -fno-exceptions -fno-rtti" } ] -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json b/arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json similarity index 95% rename from arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json rename to arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json index aea94f10..3312efe3 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json @@ -2,7 +2,7 @@ "args": { "common": { "TARGET_ARCH": "armv7a", - "VARIANT": "armv7a_soft_nofp_strictly_aligned", + "VARIANT": "armv7a_soft_nofp_strictalign", "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json similarity index 94% rename from arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json rename to arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json index cc285a0c..bb436482 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp_strictly_aligned_exn_rtti.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json @@ -2,7 +2,7 @@ "args": { "common": { "TARGET_ARCH": "armv7a", - "VARIANT": "armv7a_soft_nofp_strictly_aligned_exn_rtti", + "VARIANT": "armv7a_soft_nofp_strictalign_exn_rtti", "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} From 92d729af5caeb92562969a9335ab3bf5c753d0c3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 27 Nov 2024 12:01:00 +0000 Subject: [PATCH 095/138] Fixes to patch application. (#579) Every `CMakeLists.txt` that includes `fetch_llvm.cmake` must also call `find_package(Python3)`, because `fetch_llvm.cmake` tries to run `patch_llvm.py` by prefixing it with the Python interpreter name. The CMakeLists in `arm-multilib` wasn't looking for Python at all, and the one in `arm-runtimes` was looking for it _after_ including `fetch_llvm.cmake`. Also, `fetch_picolibc.cmake` was not reliably looking in the correct directory for its patches: it was using a path relative to `CMAKE_CURRENT_SOURCE_DIR`, which varies depending which CMakeLists it's invoked by. It should be relative to `CMAKE_CURRENT_LIST_DIR`, as the corresponding llvm and newlib paths already are. --- arm-multilib/CMakeLists.txt | 2 ++ arm-runtimes/CMakeLists.txt | 4 ++-- cmake/fetch_picolibc.cmake | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 62a3513b..753f553a 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -68,6 +68,8 @@ foreach(arg endif() endforeach() +find_package(Python3 REQUIRED COMPONENTS Interpreter) # needed by fetch_*.cmake + include(ExternalProject) include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_llvm.cmake) list(APPEND passthrough_dirs "-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT}") diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 6493ef5d..a817681a 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -101,11 +101,11 @@ set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LL # Temporary location to collect the libraries as they are built. set(TEMP_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp_install") +find_package(Python3 REQUIRED COMPONENTS Interpreter) + include(ExternalProject) include(${TOOLCHAIN_SOURCE_DIR}/cmake/fetch_llvm.cmake) -find_package(Python3 REQUIRED COMPONENTS Interpreter) - # If a compiler launcher such as ccache has been set, it should be # passed down to each subproject build. set(compiler_launcher_cmake_args "") diff --git a/cmake/fetch_picolibc.cmake b/cmake/fetch_picolibc.cmake index 3f4f8588..65b81880 100644 --- a/cmake/fetch_picolibc.cmake +++ b/cmake/fetch_picolibc.cmake @@ -13,8 +13,8 @@ read_repo_version(picolibc picolibc) set( picolibc_patches - ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0001-Enable-libcxx-builds.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch + ${CMAKE_CURRENT_LIST_DIR}/../patches/picolibc/0001-Enable-libcxx-builds.patch + ${CMAKE_CURRENT_LIST_DIR}/../patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch ) FetchContent_Declare(picolibc From 4dd4c4d399c073d953614e795ca364bcfc6abd10 Mon Sep 17 00:00:00 2001 From: David Candler Date: Wed, 27 Nov 2024 13:27:02 +0000 Subject: [PATCH 096/138] Set FETCHCONTENT_SOURCE_DIR so that repos are only checked out once The cmake scripts to fetch content such as llvm-project and picolibc can be called by both the top-level project as well as the sub-projects. To prevent the content being checked out and patched repeatedly, the FETCHCONTENT_SOURCE_DIR_ variables should be defined as these will override the declared source on any subsequent calls. These variables are already passed down from top-level to sub-project, however the variables themselves are never defined unless configured by a user. This patch addresses this by setting the variables inside the fetch scripts as soon as the fetch content is declared. --- cmake/fetch_llvm.cmake | 1 + cmake/fetch_newlib.cmake | 1 + cmake/fetch_picolibc.cmake | 1 + 3 files changed, 3 insertions(+) diff --git a/cmake/fetch_llvm.cmake b/cmake/fetch_llvm.cmake index 22688197..574c45a6 100644 --- a/cmake/fetch_llvm.cmake +++ b/cmake/fetch_llvm.cmake @@ -31,3 +31,4 @@ FetchContent_Declare(llvmproject SOURCE_SUBDIR do_not_add_llvm_subdir_yet ) FetchContent_MakeAvailable(llvmproject) +FetchContent_GetProperties(llvmproject SOURCE_DIR FETCHCONTENT_SOURCE_DIR_LLVMPROJECT) diff --git a/cmake/fetch_newlib.cmake b/cmake/fetch_newlib.cmake index 1413145f..4d7b3723 100644 --- a/cmake/fetch_newlib.cmake +++ b/cmake/fetch_newlib.cmake @@ -23,3 +23,4 @@ FetchContent_Declare(newlib SOURCE_SUBDIR do_not_add_newlib_subdir ) FetchContent_MakeAvailable(newlib) +FetchContent_GetProperties(newlib SOURCE_DIR FETCHCONTENT_SOURCE_DIR_NEWLIB) diff --git a/cmake/fetch_picolibc.cmake b/cmake/fetch_picolibc.cmake index 65b81880..67a3f3cd 100644 --- a/cmake/fetch_picolibc.cmake +++ b/cmake/fetch_picolibc.cmake @@ -29,3 +29,4 @@ FetchContent_Declare(picolibc SOURCE_SUBDIR do_not_add_picolibc_subdir ) FetchContent_MakeAvailable(picolibc) +FetchContent_GetProperties(picolibc SOURCE_DIR FETCHCONTENT_SOURCE_DIR_PICOLIBC) From 0af4597d68e2840eaf76e74697d3defabe34250c Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Wed, 27 Nov 2024 14:26:01 +0000 Subject: [PATCH 097/138] Fix print-multi-directory test for strict align variant (#581) The `test/multilib/armv7a.test` was looking for the incorrect multilib directory output when checking the behaviour for the strict align library variant. This patch fixes this issue. --- test/multilib/armv7a.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index 3f3eecc8..28739532 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -13,7 +13,7 @@ # RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=CHECK-NOUNALIGNED %s # RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=CHECK-NOUNALIGNED %s # RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# CHECK-NOUNALIGNED: arm-none-eabi/armv7a_soft_nofp_strictly_aligned_exn_rtti{{$}} +# CHECK-NOUNALIGNED: arm-none-eabi/armv7a_soft_nofp_strictalign_exn_rtti{{$}} # CHECK-NOUNALIGNED-EMPTY: # RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s From 6b5c3134375bb199e84e3228177c726120bf605a Mon Sep 17 00:00:00 2001 From: David Candler Date: Wed, 27 Nov 2024 14:16:37 +0000 Subject: [PATCH 098/138] Document option to enable FVP testing Previously FVP testing was enabled or disabled implicitly based on whether an FVP install could be found. This has since been changed to a specific CMake option, however the documentation fails to mention this. The build instructions have now been updated with the new CMake option. --- docs/building-from-source.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/building-from-source.md b/docs/building-from-source.md index ca44c172..6b70487c 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -64,8 +64,10 @@ If you have previously downloaded and installed the FVPs outside of the source tree, you can set the `-DFVP_INSTALL_DIR=...` cmake option to set the path to them. -If the FVPs are not installed, tests which need them will be skipped, but QEMU -tests will still be run, and all library variants will still be built. +Testing with FVPs is disabled by default, but QEMU tests will still be run, and +all library variants will still be built. Testing with FVPs can be enabled by +setting the `-DENABLE_FVP_TESTING=ON` CMake option if you have installed the +models as described above. ## Customizing From cdcf1d58601e44c887730897e5bc0df12066d8eb Mon Sep 17 00:00:00 2001 From: David Candler Date: Thu, 28 Nov 2024 15:25:58 +0000 Subject: [PATCH 099/138] When QEMU testing is enabled, QEMU should be required Since QEMU is needed to run tests with QEMU, if the program cannot be found the build should stop and an error generated. --- arm-runtimes/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index a817681a..97193d14 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -157,9 +157,9 @@ if(ENABLE_LIBC_TESTS OR ENABLE_COMPILER_RT_TESTS OR ENABLE_LIBCXX_TESTS) if(TEST_EXECUTOR STREQUAL qemu) if(TARGET_ARCH MATCHES "^aarch64") - find_program(QEMU_EXECUTABLE qemu-system-aarch64) + find_program(QEMU_EXECUTABLE qemu-system-aarch64 REQUIRED) else() - find_program(QEMU_EXECUTABLE qemu-system-arm) + find_program(QEMU_EXECUTABLE qemu-system-arm REQUIRED) endif() # Use colon as a separator because comma and semicolon are used for From e1d7bc9d99ab51a8e2f22cbd7dd2f8c3a1c52926 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy <66017160+voltur01@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:49:19 +0000 Subject: [PATCH 100/138] Update package name (#585) --- docs/newlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/newlib.md b/docs/newlib.md index a7174f0f..c7f19c3c 100644 --- a/docs/newlib.md +++ b/docs/newlib.md @@ -11,7 +11,7 @@ library variants is provided. ## Using pre-built `newlib` library package 1. Install LLVM Embedded Toolchain for Arm -1. Download corresponding `LLVMEmbeddedToolchainForArm-newlib-overlay` package +1. Download corresponding `LLVM-ET-Arm-newlib-overlay` package and extract it on top of the main toolchain folder. * Note: The overlay package copies all the `newlib` library variants into the From 14871ac19cc423354caa3414e547504267fe1512 Mon Sep 17 00:00:00 2001 From: dcandler Date: Mon, 2 Dec 2024 08:59:37 +0000 Subject: [PATCH 101/138] Use the same patching script and command for all repos (#584) To simplify patching, the script used for the LLVM repo can be expanded for use on all repos. This also updates the newlib patch to use the same format as llvm-project and picolibc; using git's patch format means the .patch file is compatible with both git am and git apply, whereas a simple diff only works with git apply. This also adds an option to control the patch method used by the script, since using git am may be preferable to the default git apply. The script already supports the option, so all that is needed to pass down the selection from the CMake cache if present. The --3way option has been removed as a default when using --apply, since it can leave conflict markers in place which will not get detected by the script or CMake and will lead to a compilation error. Instead, an option to the script has been added to use --3way. Since --check --apply --3way does not return an error code when the patch is valid but contains conflicts, the --restore_on_fail is now marked as incompatible with that combination. --- cmake/fetch_llvm.cmake | 11 ++--- cmake/fetch_newlib.cmake | 6 +-- cmake/fetch_picolibc.cmake | 10 ++-- cmake/patch_repo.cmake | 16 ++++++ cmake/{patch_llvm.py => patch_repo.py} | 49 +++++++++++++------ .../0001-Enable-newlib-build.patch} | 34 ++++++++++++- 6 files changed, 94 insertions(+), 32 deletions(-) create mode 100644 cmake/patch_repo.cmake rename cmake/{patch_llvm.py => patch_repo.py} (73%) rename patches/{newlib.patch => newlib/0001-Enable-newlib-build.patch} (94%) diff --git a/cmake/fetch_llvm.cmake b/cmake/fetch_llvm.cmake index 574c45a6..18381489 100644 --- a/cmake/fetch_llvm.cmake +++ b/cmake/fetch_llvm.cmake @@ -5,17 +5,16 @@ # top level to any library builds to prevent repeated checkouts. include(FetchContent) +include(${CMAKE_CURRENT_LIST_DIR}/patch_repo.cmake) if(NOT VERSIONS_JSON) include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) endif() read_repo_version(llvmproject llvm-project) - -set(llvm_patch_script ${CMAKE_CURRENT_LIST_DIR}/patch_llvm.py) -set(patch_dir ${CMAKE_CURRENT_LIST_DIR}/../patches) -set(LLVM_PATCH_COMMAND ${Python3_EXECUTABLE} ${llvm_patch_script} ${patch_dir}/llvm-project) +get_patch_command(${CMAKE_CURRENT_LIST_DIR}/.. llvm-project llvm_patch_command) if(APPLY_LLVM_PERFORMANCE_PATCHES) - set(LLVM_PATCH_COMMAND ${LLVM_PATCH_COMMAND} && ${Python3_EXECUTABLE} ${llvm_patch_script} ${patch_dir}/llvm-project-perf) + get_patch_command(${CMAKE_CURRENT_LIST_DIR}/.. llvm-project-perf llvm_perf_patch_command) + set(llvm_patch_command ${llvm_patch_command} && ${llvm_perf_patch_command} ) endif() FetchContent_Declare(llvmproject @@ -23,7 +22,7 @@ FetchContent_Declare(llvmproject GIT_TAG "${llvmproject_TAG}" GIT_SHALLOW "${llvmproject_SHALLOW}" GIT_PROGRESS TRUE - PATCH_COMMAND ${LLVM_PATCH_COMMAND} + PATCH_COMMAND ${llvm_patch_command} # Add the llvm subdirectory later to ensure that # LLVMEmbeddedToolchainForArm is the first project declared. # Otherwise CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT diff --git a/cmake/fetch_newlib.cmake b/cmake/fetch_newlib.cmake index 4d7b3723..6962b5bb 100644 --- a/cmake/fetch_newlib.cmake +++ b/cmake/fetch_newlib.cmake @@ -5,20 +5,20 @@ # top level to any library builss to prevent repeated checkouts. include(FetchContent) +include(${CMAKE_CURRENT_LIST_DIR}/patch_repo.cmake) if(NOT VERSIONS_JSON) include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) endif() read_repo_version(newlib newlib) - -set(newlib_patch ${CMAKE_CURRENT_LIST_DIR}/../patches/newlib.patch) +get_patch_command(${CMAKE_CURRENT_LIST_DIR}/.. newlib newlib_patch_command) FetchContent_Declare(newlib GIT_REPOSITORY https://sourceware.org/git/newlib-cygwin.git GIT_TAG "${newlib_TAG}" GIT_SHALLOW "${newlib_SHALLOW}" GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${newlib_patch} + PATCH_COMMAND ${newlib_patch_command} # Similarly to picolibc, we don't do the configuration here. SOURCE_SUBDIR do_not_add_newlib_subdir ) diff --git a/cmake/fetch_picolibc.cmake b/cmake/fetch_picolibc.cmake index 67a3f3cd..050b136b 100644 --- a/cmake/fetch_picolibc.cmake +++ b/cmake/fetch_picolibc.cmake @@ -5,24 +5,20 @@ # top level to any library builss to prevent repeated checkouts. include(FetchContent) +include(${CMAKE_CURRENT_LIST_DIR}/patch_repo.cmake) if(NOT VERSIONS_JSON) include(${CMAKE_CURRENT_LIST_DIR}/read_versions.cmake) endif() read_repo_version(picolibc picolibc) - -set( - picolibc_patches - ${CMAKE_CURRENT_LIST_DIR}/../patches/picolibc/0001-Enable-libcxx-builds.patch - ${CMAKE_CURRENT_LIST_DIR}/../patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch -) +get_patch_command(${CMAKE_CURRENT_LIST_DIR}/.. picolibc picolibc_patch_command) FetchContent_Declare(picolibc GIT_REPOSITORY https://github.com/picolibc/picolibc.git GIT_TAG "${picolibc_TAG}" GIT_SHALLOW "${picolibc_SHALLOW}" GIT_PROGRESS TRUE - PATCH_COMMAND git reset --quiet --hard && git clean --quiet --force -dx && git apply ${picolibc_patches} + PATCH_COMMAND ${picolibc_patch_command} # We only want to download the content, not configure it at this # stage. picolibc will be built in many configurations using # ExternalProject_Add using the sources that are checked out here. diff --git a/cmake/patch_repo.cmake b/cmake/patch_repo.cmake new file mode 100644 index 00000000..c81a76bd --- /dev/null +++ b/cmake/patch_repo.cmake @@ -0,0 +1,16 @@ + +# Function to generate a PATCH_COMMAND, calling the +# patch_repo.py script using a target set of patches. + +function(get_patch_command toolchain_root patch_dir patch_command_out) + set(patch_script ${toolchain_root}/cmake/patch_repo.py) + list(APPEND patch_script_args ${Python3_EXECUTABLE} ${patch_script}) + if(GIT_PATCH_METHOD STREQUAL "am") + list(APPEND patch_script_args "--method" "am") + elseif(GIT_PATCH_METHOD STREQUAL "apply") + list(APPEND patch_script_args "--method" "apply") + endif() + list(APPEND patch_script_args ${toolchain_root}/patches/${patch_dir}) + + set(${patch_command_out} ${patch_script_args} PARENT_SCOPE) +endfunction() diff --git a/cmake/patch_llvm.py b/cmake/patch_repo.py similarity index 73% rename from cmake/patch_llvm.py rename to cmake/patch_repo.py index 85bf535b..59294b14 100644 --- a/cmake/patch_llvm.py +++ b/cmake/patch_repo.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """ -Script to apply a set of patches to llvm-project sources. +Script to apply a set of patches to a git repository. """ import argparse @@ -18,8 +18,8 @@ def main(): help="Set of patches to apply. This should be a directory containing one or more ordered *.patch files.", ) parser.add_argument( - "--llvm_dir", - help="Directory of the llvm-project git checkout, if not the current directory.", + "--repo_dir", + help="Directory of the git checkout, if not the current directory.", ) parser.add_argument( "--method", @@ -36,10 +36,24 @@ def main(): action="store_true", help="If a patch in a series cannot be applied, restore the original state instead of leaving patches missing. Return code will be 2 instead of 1.", ) + parser.add_argument( + "--3way", + action="store_true", + dest="three_way", + help="If the patch does not apply cleanly, fall back on 3-way merge.", + ) args = parser.parse_args() - if args.llvm_dir: - git_cmd = ["git", "-C", args.llvm_dir] + # If the patch is valid but contain conflicts, using --3way --apply can apply + # the patch but leave conflict markers in the source for the user to resolve. + # This doesn't return an error code, making it compatible with this script's + # --restore_on_fail option, which relies on the error code from running --check. + if args.method == "apply" and args.restore_on_fail and args.three_way: + print("--restore_on_fail is incompatible with --3way using apply") + exit(1) + + if args.repo_dir: + git_cmd = ["git", "-C", args.repo_dir] else: git_cmd = ["git"] @@ -57,7 +71,9 @@ def main(): print("\n".join(p.name for p in patch_list)) if args.method == "am": - merge_args = git_cmd + ["am", "-k", "--ignore-whitespace", "--3way"] + merge_args = git_cmd + ["am", "-k", "--ignore-whitespace"] + if args.three_way: + merge_args.append("--3way") for patch in patch_list: merge_args.append(str(patch)) p = subprocess.run(merge_args, capture_output=True, text=True) @@ -72,8 +88,8 @@ def main(): # git am doesn't give any specific return codes, # so check for unresolved working files. rebase_apply_path = os.path.join(".git", "rebase-apply") - if args.llvm_dir: - rebase_apply_path = os.path.join(args.llvm_dir, rebase_apply_path) + if args.repo_dir: + rebase_apply_path = os.path.join(args.repo_dir, rebase_apply_path) if os.path.isdir(rebase_apply_path): print("Aborting git am...") subprocess.run(git_cmd + ["am", "--abort"], check=True) @@ -90,10 +106,11 @@ def main(): apply_check_args = git_cmd + [ "apply", "--ignore-whitespace", - "--3way", "--check", - str(current_patch), ] + if args.three_way: + apply_check_args.append("--3way") + apply_check_args.append(str(current_patch)) p_check = subprocess.run(apply_check_args) if p_check.returncode == 0: @@ -102,10 +119,11 @@ def main(): apply_args = git_cmd + [ "apply", "--ignore-whitespace", - "--3way", - str(current_patch), ] - apply_args = subprocess.run(apply_args, check=True) + if args.three_way: + apply_args.append("--3way") + apply_args.append(str(current_patch)) + p = subprocess.run(apply_args, check=True) applied_patches.append(current_patch) else: # Patch won't apply. @@ -118,10 +136,11 @@ def main(): reverse_args = git_cmd + [ "apply", "--ignore-whitespace", - "--3way", "--reverse", - str(previous_patch), ] + if args.three_way: + reverse_args.append("--3way") + reverse_args.append(str(previous_patch)) p_check = subprocess.run(reverse_args, check=True) print( f"Rollback successful, failure occured on {current_patch.name}" diff --git a/patches/newlib.patch b/patches/newlib/0001-Enable-newlib-build.patch similarity index 94% rename from patches/newlib.patch rename to patches/newlib/0001-Enable-newlib-build.patch index f520a7fc..e70a97a7 100644 --- a/patches/newlib.patch +++ b/patches/newlib/0001-Enable-newlib-build.patch @@ -1,3 +1,32 @@ +From 0e1475e5112b986ef5d9caee23dac554c749c54b Mon Sep 17 00:00:00 2001 +From: David Candler +Date: Thu, 28 Nov 2024 15:31:35 +0000 +Subject: [PATCH] Enable newlib build + +--- + libgloss/aarch64/syscalls.c | 6 ++ + libgloss/arm/cpu-init/rdimon-aem.S | 107 ++++++++++++------------ + libgloss/arm/crt0.S | 2 +- + libgloss/arm/linux-crt0.c | 2 +- + libgloss/arm/syscalls.c | 6 +- + libgloss/arm/trap.S | 2 +- + libgloss/libnosys/configure | 2 +- + newlib/libc/include/sys/features.h | 2 + + newlib/libc/machine/aarch64/memchr.S | 6 +- + newlib/libc/machine/aarch64/strchr.S | 6 +- + newlib/libc/machine/aarch64/strchrnul.S | 6 +- + newlib/libc/machine/aarch64/strrchr.S | 10 +-- + newlib/libc/stdlib/aligned_alloc.c | 1 + + newlib/libc/sys/arm/crt0.S | 2 +- + newlib/libc/sys/arm/trap.S | 2 +- + newlib/libm/machine/arm/sf_ceil.c | 2 +- + newlib/libm/machine/arm/sf_floor.c | 2 +- + newlib/libm/machine/arm/sf_nearbyint.c | 2 +- + newlib/libm/machine/arm/sf_rint.c | 2 +- + newlib/libm/machine/arm/sf_round.c | 2 +- + newlib/libm/machine/arm/sf_trunc.c | 2 +- + 21 files changed, 92 insertions(+), 82 deletions(-) + diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c index 7343cc61f..2c4b63c17 100644 --- a/libgloss/aarch64/syscalls.c @@ -5,7 +34,7 @@ index 7343cc61f..2c4b63c17 100644 @@ -172,6 +172,12 @@ newslot (void) return i; } - + +int __aarch64_sme_accessible() { + int result = 0; + asm volatile ( "mrs %x[result], id_aa64pfr1_el1" : [result]"=r"(result) : : ); @@ -635,3 +664,6 @@ index 64e4aeb9a..c08fa6fed 100644 #include float +-- +2.43.0 + From cba1a323845cf999212d92f57752131caeb69f2b Mon Sep 17 00:00:00 2001 From: dcandler Date: Mon, 2 Dec 2024 10:37:08 +0000 Subject: [PATCH 102/138] Prevent arm-runtime CMake arguments persisting over loops (#587) The additional_cmake_args variable is used to override the defaults and disable testing so that it can be controlled by the higher-level CMake project. But the variable is currently set only when the tests should be disabled. If the tests do not need to be disabled, the value is not updated and the version from the previous iteration of the loop will be used, potentially incorrectly disabling the tests. To fix this, clear the value on every loop if not needed. --- arm-multilib/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 753f553a..50df2c33 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -136,6 +136,7 @@ math(EXPR lib_count_dec "${lib_count} - 1") foreach(lib_idx RANGE ${lib_count_dec}) string(JSON lib_def GET ${multilib_defs} ${lib_idx}) string(JSON variant GET ${lib_def} "variant") + set(additional_cmake_args "") if(variant IN_LIST ENABLE_VARIANTS OR ENABLE_VARIANTS STREQUAL "all") string(JSON variant_multilib_flags GET ${lib_def} "flags") @@ -164,7 +165,7 @@ foreach(lib_idx RANGE ${lib_count_dec}) # FVP testing should default to off, so override any # settings from the JSON. if(test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING}) - set(additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF") + list(APPEND additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF") set(read_ENABLE_LIBC_TESTS "OFF") set(read_ENABLE_COMPILER_RT_TESTS "OFF") set(read_ENABLE_LIBCXX_TESTS "OFF") From 0b2dce04018326d29a36d5ad729def211a7de805 Mon Sep 17 00:00:00 2001 From: dcandler Date: Mon, 2 Dec 2024 11:09:15 +0000 Subject: [PATCH 103/138] Add an option to disable QEMU testing (#586) Testing with QEMU is implicitly enabled by default, but configuring the project to run with tests requires QEMU. As testing with QEMU is considered optional, it should be possible to disable tests when QEMU is not available or testing is not needed. Since there is already an option for controlling FVP testing, this patch adds a similar option for QEMU, ENABLE_QEMU_TESTING, which instead defaults to ON. This can then be turned off when QEMU is not installed, so that configurations where QEMU is expected can suitably detect and show an error when it is missing. --- CMakeLists.txt | 8 +++++++- arm-multilib/CMakeLists.txt | 13 +++++++++---- docs/building-from-source.md | 4 ++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8942842..416ce5dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,9 +150,14 @@ option( "During checkout, apply optional downstream patches to llvm-project to improve performance." ) +option( + ENABLE_QEMU_TESTING + "Enable tests that use QEMU. This option is ON by default." + ON +) option( ENABLE_FVP_TESTING - "Tests using FVP need to be explictly enabled." + "Enable tests that use FVPs. This option is OFF by default." ) set( FVP_INSTALL_DIR @@ -596,6 +601,7 @@ if(NOT PREBUILT_TARGET_LIBRARIES) -DENABLE_VARIANTS=${ENABLE_VARIANTS_PASSTHROUGH} -DLIBC_HDRGEN=${LIBC_HDRGEN} -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} + -DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING} -DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING} -DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT} diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 50df2c33..027332fa 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -33,9 +33,14 @@ set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.") set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") +option( + ENABLE_QEMU_TESTING + "Enable tests that use QEMU. This option is ON by default." + ON +) option( ENABLE_FVP_TESTING - "Tests using FVP need to be explictly enabled." + "Enable tests that use FVPs. This option is OFF by default." ) set( FVP_INSTALL_DIR @@ -162,9 +167,9 @@ foreach(lib_idx RANGE ${lib_count_dec}) file(READ ${variant_json_file} variant_json_str) string(JSON test_executor GET ${variant_json_str} "args" "common" "TEST_EXECUTOR") - # FVP testing should default to off, so override any - # settings from the JSON. - if(test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING}) + # The multilib project can be configured to disable QEMU and/or FVP + # testing, which will need to override the settings from the json. + if((test_executor STREQUAL "qemu" AND NOT ${ENABLE_QEMU_TESTING}) OR (test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING})) list(APPEND additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF") set(read_ENABLE_LIBC_TESTS "OFF") set(read_ENABLE_COMPILER_RT_TESTS "OFF") diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 6b70487c..e1efefa3 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -36,6 +36,10 @@ $ brew install llvm python3 git make ninja qemu cmake $ pip install meson ``` +Testing with QEMU is enabled by default, but can be disabled using the +`-DENABLE_QEMU_TESTING=OFF` CMake option if testing is not required or QEMU is +not installed. + Some recent targets are not supported by QEMU, for these the Arm FVP models are used instead. These models are available free-of-change but are not open-source, and come with their own licenses. From 0b32d960bd6237da2b34c9f88c2df883138ded4b Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Thu, 5 Dec 2024 09:54:38 +0000 Subject: [PATCH 104/138] Add aarch64a_soft_nofp variant (#588) Build a soft float multilib variant for aarch64 supporting targets without an FPU. Authored by Keith Packard and Victor Campos. --- arm-multilib/json/multilib.json | 5 +++ .../json/variants/aarch64a_soft_nofp.json | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 arm-multilib/json/variants/aarch64a_soft_nofp.json diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 6b532ed9..f26c76d2 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -30,6 +30,11 @@ "json": "aarch64a_strictalign.json", "flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access -fno-exceptions -fno-rtti" }, + { + "variant": "aarch64a_soft_nofp", + "json": "aarch64a_soft_nofp.json", + "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft" + }, { "variant": "armv4t_exn_rtti", "json": "armv4t_exn_rtti.json", diff --git a/arm-multilib/json/variants/aarch64a_soft_nofp.json b/arm-multilib/json/variants/aarch64a_soft_nofp.json new file mode 100644 index 00000000..27ee01c1 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_soft_nofp", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "virt", + "QEMU_CPU": "cortex-a57", + "BOOT_FLASH_ADDRESS": "0x40000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x40001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x41000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} From be02e50ce019930711e2a02e9087c1f3b267727b Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Fri, 6 Dec 2024 15:59:48 +0000 Subject: [PATCH 105/138] Changes to AArch64 nofp variant (#589) - Make the variants strictly aligned - Create new variant for big endian - Create new variant for exceptions and RTTI --- arm-multilib/json/multilib.json | 16 ++++++++ .../json/variants/aarch64a_be_soft_nofp.json | 40 +++++++++++++++++++ .../aarch64a_be_soft_nofp_exn_rtti.json | 40 +++++++++++++++++++ .../json/variants/aarch64a_soft_nofp.json | 2 +- .../variants/aarch64a_soft_nofp_exn_rtti.json | 40 +++++++++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 arm-multilib/json/variants/aarch64a_be_soft_nofp.json create mode 100644 arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json create mode 100644 arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index f26c76d2..19f4edd7 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -33,8 +33,24 @@ { "variant": "aarch64a_soft_nofp", "json": "aarch64a_soft_nofp.json", + "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti" + }, + { + "variant": "aarch64a_be_soft_nofp", + "json": "aarch64a_be_soft_nofp.json", + "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti" + }, + { + "variant": "aarch64a_soft_nofp_exn_rtti", + "json": "aarch64a_soft_nofp_exn_rtti.json", "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft" }, + { + "variant": "aarch64a_be_soft_nofp_exn_rtti", + "json": "aarch64a_be_soft_nofp_exn_rtti.json", + "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft" + }, + { "variant": "armv4t_exn_rtti", "json": "armv4t_exn_rtti.json", diff --git a/arm-multilib/json/variants/aarch64a_be_soft_nofp.json b/arm-multilib/json/variants/aarch64a_be_soft_nofp.json new file mode 100644 index 00000000..67ca0013 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_be_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_be_soft_nofp", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mbig-endian -mabi=aapcs-soft -mno-unaligned-access -fno-exceptions -fno-rtti", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64 big-endian", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..b1acc211 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_be_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mbig-endian -mabi=aapcs-soft -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "aem-a", + "FVP_CONFIG": "v8a-aarch64 big-endian", + "BOOT_FLASH_ADDRESS": "0x80000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x80001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x81000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/aarch64a_soft_nofp.json b/arm-multilib/json/variants/aarch64a_soft_nofp.json index 27ee01c1..b939c543 100644 --- a/arm-multilib/json/variants/aarch64a_soft_nofp.json +++ b/arm-multilib/json/variants/aarch64a_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_soft_nofp", - "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft -mno-unaligned-access -fno-exceptions -fno-rtti", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..52781406 --- /dev/null +++ b/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "aarch64a", + "VARIANT": "aarch64a_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "virt", + "QEMU_CPU": "cortex-a57", + "BOOT_FLASH_ADDRESS": "0x40000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x40001000", + "FLASH_SIZE": "0xfff000", + "RAM_ADDRESS": "0x41000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "8K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} From 938676cdd5a8914548c98623a29e4c0d8e46e486 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 9 Dec 2024 11:30:59 +0000 Subject: [PATCH 106/138] Remaster picolibc patches against commit e3a4f137d85c5e9 (#590) This deletes most of the previous patch 0002 (add bootcode for AArch64 FVPs), because it's now upstream in picolibc itself. The remaining vestige, defining picocrt_machines in the AArch32 picolibc build configuration, remains necessary until we conditionalise our definition of `test-machine` in our own builds. --- .../picolibc/0001-Enable-libcxx-builds.patch | 8 +- .../0002-Add-bootcode-for-AArch64-FVPs.patch | 888 ------------------ ...achines-for-AArch32-builds-as-well-a.patch | 29 + ...strict-align-no-unaligned-access-in-.patch | 4 +- ...Code-Changes-to-enable-the-Alignment.patch | 8 +- 5 files changed, 39 insertions(+), 898 deletions(-) delete mode 100644 patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch create mode 100644 patches/picolibc/0002-Define-picocrt_machines-for-AArch32-builds-as-well-a.patch diff --git a/patches/picolibc/0001-Enable-libcxx-builds.patch b/patches/picolibc/0001-Enable-libcxx-builds.patch index 7960ca12..ef76bb9c 100644 --- a/patches/picolibc/0001-Enable-libcxx-builds.patch +++ b/patches/picolibc/0001-Enable-libcxx-builds.patch @@ -1,4 +1,4 @@ -From 028fe75e045951a9d091008a85971523358160db Mon Sep 17 00:00:00 2001 +From bd1dcaa0e3e77260e264cc0c2580bf32f704a0ed Mon Sep 17 00:00:00 2001 From: Simi Pallipurath Date: Thu, 14 Nov 2024 10:07:08 +0000 Subject: Enable libcxx builds @@ -11,10 +11,10 @@ libc++ builds. 2 files changed, 15 insertions(+) diff --git a/meson.build b/meson.build -index 012d664bd..4161d6574 100644 +index b8f43c800..9d3f5c672 100644 --- a/meson.build +++ b/meson.build -@@ -1318,6 +1318,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') +@@ -1319,6 +1319,18 @@ if get_option('newlib-retargetable-locking') != get_option('newlib-multithread') error('newlib-retargetable-locking and newlib-multithread must be set to the same value') endif @@ -48,5 +48,5 @@ index 7b63ba172..cda5e1e7e 100644 KEEP (*(.fini .fini.*)) @PREFIX@__text_end = .; -- -2.39.5 (Apple Git-154) +2.43.0 diff --git a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch b/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch deleted file mode 100644 index 6cd23938..00000000 --- a/patches/picolibc/0002-Add-bootcode-for-AArch64-FVPs.patch +++ /dev/null @@ -1,888 +0,0 @@ -From 58451642e678817d8822b04b8ff07ee4758a8f10 Mon Sep 17 00:00:00 2001 -From: Simi Pallipurath -Date: Thu, 14 Nov 2024 10:12:33 +0000 -Subject: Add bootcode for AArch64 FVPs - -The AArch64 FVP (Fixed Virtual Platform) models differ from QEMU in a -few ways which affect the crt0 code: - -* The memory map is different, so needs different page tables. -* They boot up at EL3, instead of EL1, so we need to set the EL3 versions of the system registers. -* Add option to build crt0 bootcode for different machines -* Build new FVP variants of crt0, instead of replacing QEMU ones -* Split assembly parts of AArch64 crt0 into a separate file -* Make error checking target-specific ---- - meson.build | 1 + - meson_options.txt | 3 + - picocrt/machine/aarch64/crt0.S | 200 +++++++++++++++++++ - picocrt/machine/aarch64/crt0.c | 198 +++---------------- - picocrt/machine/aarch64/meson.build | 9 +- - picocrt/machine/arm/meson.build | 7 + - picocrt/meson.build | 296 ++++++++++++++++------------ - 7 files changed, 411 insertions(+), 303 deletions(-) - create mode 100644 picocrt/machine/aarch64/crt0.S - -diff --git a/meson.build b/meson.build -index 012d664bd..b8f43c800 100644 ---- a/meson.build -+++ b/meson.build -@@ -151,6 +151,7 @@ multilib_exclude = get_option('multilib-exclude') - enable_picolib = get_option('picolib') - enable_picocrt = get_option('picocrt') - enable_picocrt_lib = get_option('picocrt-lib') -+test_machine = get_option('test-machine') - enable_semihost = get_option('semihost') - enable_tests = get_option('tests') - if get_option('tests-cdefs') == 'auto' -diff --git a/meson_options.txt b/meson_options.txt -index e0eacb443..766129ebd 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -132,6 +132,9 @@ option('test-stdin', type: 'boolean', value: false, - description: 'Enable tests that use stdin. This only works on a few targets') - option('fortify-source', type: 'combo', choices: ['none', '1', '2', '3'], value: '3', - description: 'Set _FORTIFY_SOURCE= when building tests') -+option('test-machine', type: 'string', value: 'qemu', -+ description: 'Machine-specific startup code to use when running tests') -+ - - option('tinystdio', type: 'boolean', value: true, - description: 'Use tiny stdio from avr libc') -diff --git a/picocrt/machine/aarch64/crt0.S b/picocrt/machine/aarch64/crt0.S -new file mode 100644 -index 000000000..4cb19854a ---- /dev/null -+++ b/picocrt/machine/aarch64/crt0.S -@@ -0,0 +1,200 @@ -+/************ Page table ************/ -+/* -+ * The smallest VA we can construct is 8GB, which needs 8 block page table -+ * entries, each covering 1GiB. -+ */ -+#define MMU_BLOCK_COUNT 8 -+ -+#define MMU_DESCRIPTOR_VALID (1 << 0) -+#define MMU_DESCRIPTOR_BLOCK (0 << 1) -+#define MMU_DESCRIPTOR_TABLE (1 << 1) -+ -+#define MMU_BLOCK_XN (1LL << 54) -+#define MMU_BLOCK_PXN (1LL << 53) -+#define MMU_BLOCK_CONTIG (1LL << 52) -+#define MMU_BLOCK_DBM (1LL << 51) -+#define MMU_BLOCK_GP (1LL << 50) -+ -+#define MMU_BLOCK_NT (1 << 16) -+#define MMU_BLOCK_OA_BIT 12 -+#define MMU_BLOCK_NG (1 << 11) -+#define MMU_BLOCK_AF (1 << 10) -+#define MMU_BLOCK_SH_BIT 8 -+#define MMU_BLOCK_SH_NS (0 << MMU_BLOCK_SH_BIT) -+#define MMU_BLOCK_SH_OS (2 << MMU_BLOCK_SH_BIT) -+#define MMU_BLOCK_SH_IS (3 << MMU_BLOCK_SH_BIT) -+#define MMU_BLOCK_AP_BIT 6 -+#define MMU_BLOCK_NS (1 << 5) -+#define MMU_BLOCK_ATTR_BIT 2 -+ -+#define MMU_NORMAL_FLAGS (MMU_DESCRIPTOR_VALID | \ -+ MMU_DESCRIPTOR_BLOCK | \ -+ MMU_BLOCK_AF | \ -+ MMU_BLOCK_SH_IS | \ -+ (0 << MMU_BLOCK_ATTR_BIT)) -+ -+#define MMU_DEVICE_FLAGS (MMU_DESCRIPTOR_VALID | \ -+ MMU_DESCRIPTOR_BLOCK | \ -+ MMU_BLOCK_AF | \ -+ (1 << MMU_BLOCK_ATTR_BIT)) -+ -+#define MMU_INVALID_FLAGS 0 -+ -+ .macro start_page_table -+ .section .rodata -+ .global __identity_page_table -+ .balign 65536 -+__identity_page_table: -+ .set block_num, 0 -+ .endm -+ -+ .macro page_table_entries count, flags -+ .rept \count -+ .8byte (block_num << 30) | \flags -+ .set block_num, block_num + 1 -+ .endr -+ .endm -+ -+ .macro end_page_table -+ .size __identity_page_table, MMU_BLOCK_COUNT * 8 -+ .if block_num != MMU_BLOCK_COUNT -+ .error "Wrong number of page table entries" -+ .endif -+ .endm -+ -+#if defined(MACHINE_qemu) -+ start_page_table -+ // [0x0000_0000,0x8000_0000): 2GiB normal memory -+ page_table_entries 2, MMU_NORMAL_FLAGS -+ // [0x8000_0000,0x1_0000_0000): 2GiB device memory -+ page_table_entries 2, MMU_DEVICE_FLAGS -+ // [0x1_0000_0000,0x2_0000_0000): 4GiB un-mapped -+ page_table_entries 4, MMU_INVALID_FLAGS -+ end_page_table -+#elif defined(MACHINE_fvp) -+ start_page_table -+ // [0x0000_0000,0x8000_0000): 2GiB unmapped. This actually contains a lot -+ // of different memory regions and devices, but we don't need any of them -+ // for testing. -+ page_table_entries 2, MMU_INVALID_FLAGS -+ // [0x8000_0000,0x1_0000_0000): 2GiB normal memory -+ page_table_entries 2, MMU_NORMAL_FLAGS -+ // [0x1_0000_0000,0x2_0000_0000): 4GiB un-mapped -+ page_table_entries 4, MMU_INVALID_FLAGS -+ end_page_table -+#else -+#error "Unknown machine type" -+#endif -+ -+ -+/************ Entry point ************/ -+ -+ // Defined in crt0.c -+ .global _cstart -+ .type cstart, %function -+ -+ // _start: Main entry point function, sets up the hardware to the point where -+ // we can execute C code. -+ .section .text.init.enter, "ax", %progbits -+ .global _start -+ .type _start, %function -+_start: -+ /* Use EL-banked stack pointer */ -+ msr SPSel, #1 -+ -+ /* Initialize stack */ -+ adrp x1, __stack -+ add x1, x1, :lo12:__stack -+ mov sp, x1 -+ -+ /* Enable FPU */ -+#if __ARM_FP -+#if defined(MACHINE_qemu) -+ mov x1, #(0x3 << 20) -+ msr CPACR_EL1, x1 -+#elif defined(MACHINE_fvp) -+ mrs x0, CPTR_EL3 -+ /* Clear CPTR_ELx.TFP, to enable FP/SIMD instructions at EL0 and EL1. */ -+ and x0, x0, #~(1<<10) -+ /* Set CPTR_ELx.EZ and .ESM, to enable SVE and SME instructions at EL3. These -+ * bits are ignored for cores which don't have the relevant feature. */ -+ ORR x0, x0, #1<<8 -+ ORR x0, x0, #1<<12 -+ msr CPTR_EL3, x0 -+#else -+#error "Unknown machine type" -+#endif -+#endif // __ARM_FP -+ -+ /* Jump into C code */ -+ bl _cstart -+ .size _start, .-_start -+ -+ -+ -+/************ Exception handlers ************/ -+#ifdef CRT0_SEMIHOST -+ -+ .macro vector_common -+ sub sp, sp, #256 -+ str x0, [sp, #0] -+ str x1, [sp, #8] -+ str x2, [sp, #16] -+ str x3, [sp, #24] -+ str x4, [sp, #32] -+ str x5, [sp, #40] -+ str x6, [sp, #48] -+ str x7, [sp, #56] -+ str x8, [sp, #64] -+ str x9, [sp, #72] -+ str x10, [sp, #80] -+ str x11, [sp, #88] -+ str x12, [sp, #96] -+ str x13, [sp, #104] -+ str x14, [sp, #112] -+ str x15, [sp, #120] -+ str x16, [sp, #128] -+ str x17, [sp, #136] -+ str x18, [sp, #144] -+ str x19, [sp, #152] -+ str x20, [sp, #160] -+ str x21, [sp, #168] -+ str x22, [sp, #176] -+ str x23, [sp, #184] -+ str x24, [sp, #192] -+ str x25, [sp, #200] -+ str x26, [sp, #208] -+ str x27, [sp, #216] -+ str x28, [sp, #224] -+ str x29, [sp, #232] -+ str x30, [sp, #240] -+#if defined(MACHINE_qemu) -+ mrs x0, ELR_EL1 -+#elif defined(MACHINE_fvp) -+ mrs x0, ELR_EL3 -+#else -+#error "Unknown machine type" -+#endif -+ str x0, [sp, #248] -+ mov x0, sp -+ .endm -+ -+ .global aarch64_fault -+ .type aarch64_fault, %function -+ -+ .macro exception_handler name, number -+ .section .init, "ax", %progbits -+ .global aarch64_\name\()_vector -+ .type aarch64_\name\()_vector, %function -+aarch64_\name\()_vector: -+ vector_common -+ mov x1, #\number -+ b aarch64_fault -+ .endm -+ -+ exception_handler sync, 0 -+ exception_handler irq, 1 -+ exception_handler fiq, 2 -+ exception_handler serror, 3 -+ -+#endif // CRT0_SEMIHOST -diff --git a/picocrt/machine/aarch64/crt0.c b/picocrt/machine/aarch64/crt0.c -index affb41fa9..dfe838111 100644 ---- a/picocrt/machine/aarch64/crt0.c -+++ b/picocrt/machine/aarch64/crt0.c -@@ -60,75 +60,11 @@ _set_tls(void *tls) - - #include "../../crt0.h" - --/* -- * We need 4 1GB mappings to cover the usual Normal memory space, -- * which runs from 0x00000000 to 0x7fffffff along with the usual -- * Device space which runs from 0x80000000 to 0xffffffff. However, -- * it looks like the smallest VA we can construct is 8GB, so we'll -- * pad the space with invalid PTEs -- */ --#define MMU_NORMAL_COUNT 2 --#define MMU_DEVICE_COUNT 2 --#define MMU_INVALID_COUNT 4 --extern uint64_t __identity_page_table[MMU_NORMAL_COUNT + MMU_DEVICE_COUNT + MMU_INVALID_COUNT]; -- --#define MMU_DESCRIPTOR_VALID (1 << 0) --#define MMU_DESCRIPTOR_BLOCK (0 << 1) --#define MMU_DESCRIPTOR_TABLE (1 << 1) -- --#define MMU_BLOCK_XN (1LL << 54) --#define MMU_BLOCK_PXN (1LL << 53) --#define MMU_BLOCK_CONTIG (1LL << 52) --#define MMU_BLOCK_DBM (1LL << 51) --#define MMU_BLOCK_GP (1LL << 50) -- --#define MMU_BLOCK_NT (1 << 16) --#define MMU_BLOCK_OA_BIT 12 --#define MMU_BLOCK_NG (1 << 11) --#define MMU_BLOCK_AF (1 << 10) --#define MMU_BLOCK_SH_BIT 8 --#define MMU_BLOCK_SH_NS (0 << MMU_BLOCK_SH_BIT) --#define MMU_BLOCK_SH_OS (2 << MMU_BLOCK_SH_BIT) --#define MMU_BLOCK_SH_IS (3 << MMU_BLOCK_SH_BIT) --#define MMU_BLOCK_AP_BIT 6 --#define MMU_BLOCK_NS (1 << 5) --#define MMU_BLOCK_ATTR_BIT 2 -- --#define MMU_NORMAL_FLAGS (MMU_DESCRIPTOR_VALID | \ -- MMU_DESCRIPTOR_BLOCK | \ -- MMU_BLOCK_AF | \ -- MMU_BLOCK_SH_IS | \ -- (0 << MMU_BLOCK_ATTR_BIT)) -- --#define MMU_DEVICE_FLAGS (MMU_DESCRIPTOR_VALID | \ -- MMU_DESCRIPTOR_BLOCK | \ -- MMU_BLOCK_AF | \ -- (1 << MMU_BLOCK_ATTR_BIT)) -- --#define MMU_INVALID_FLAGS 0 -- --__asm__( -- ".section .rodata\n" -- ".global __identity_page_table\n" -- ".balign 65536\n" -- "__identity_page_table:\n" -- ".set _i, 0\n" -- ".rept " __XSTRING(MMU_NORMAL_COUNT) "\n" -- " .8byte (_i << 30) |" __XSTRING(MMU_NORMAL_FLAGS) "\n" -- " .set _i, _i + 1\n" -- ".endr\n" -- ".set _i, 0\n" -- ".rept " __XSTRING(MMU_DEVICE_COUNT) "\n" -- " .8byte (1 << 31) | (_i << 30) |" __XSTRING(MMU_DEVICE_FLAGS) "\n" -- " .set _i, _i + 1\n" -- ".endr\n" -- ".set _i, 0\n" -- ".rept " __XSTRING(MMU_INVALID_COUNT) "\n" -- " .8byte " __XSTRING(MMU_INVALID_FLAGS) "\n" -- " .set _i, _i + 1\n" -- ".endr\n" -- ".size __identity_page_table, " __XSTRING((MMU_NORMAL_COUNT + MMU_DEVICE_COUNT + MMU_INVALID_COUNT) * 8) "\n" --); -+/* Defined in crt0.S */ -+#define MMU_BLOCK_COUNT 8 -+extern uint64_t __identity_page_table[MMU_BLOCK_COUNT]; -+extern void _start(void); -+extern const void *__vector_table[]; - - #define SCTLR_MMU (1 << 0) - #define SCTLR_A (1 << 1) -@@ -159,12 +95,19 @@ __asm__( - #define TCR_IPS_BIT 32 - #define TCR_IPS_4GB (0LL << TCR_IPS_BIT) - --extern const void *__vector_table[]; -+/* QEMU boots into EL1, and FVPs boot into EL3, so we need to use the correct -+ * system registers. */ -+#if defined(MACHINE_qemu) -+#define BOOT_EL "EL1" -+#elif defined(MACHINE_fvp) -+#define BOOT_EL "EL3" -+#else -+#error "Unknown machine type" -+#endif - --static void __attribute((used)) --_cstart(void) -+void _cstart(void) - { -- uint64_t sctlr_el1; -+ uint64_t sctlr; - - /* Invalidate the cache */ - __asm__("ic iallu"); -@@ -174,7 +117,7 @@ _cstart(void) - * Set up the TCR register to provide a 33bit VA space using - * 4kB pages over 4GB of PA - */ -- __asm__("msr tcr_el1, %x0" :: -+ __asm__("msr tcr_"BOOT_EL", %x0" :: - "r" ((0x1f << TCR_T0SZ_BIT) | - TCR_IRGN0_WB_WA | - TCR_ORGN0_WB_WA | -@@ -184,7 +127,7 @@ _cstart(void) - TCR_IPS_4GB)); - - /* Load the page table base */ -- __asm__("msr ttbr0_el1, %x0" :: "r" (__identity_page_table)); -+ __asm__("msr ttbr0_"BOOT_EL", %x0" :: "r" (__identity_page_table)); - - /* - * Set the memory attributions in the MAIR register: -@@ -192,42 +135,24 @@ _cstart(void) - * Region 0 is Normal memory - * Region 1 is Device memory - */ -- __asm__("msr mair_el1, %x0" :: -+ __asm__("msr mair_"BOOT_EL", %x0" :: - "r" ((0xffLL << 0) | (0x00LL << 8))); - - /* - * Enable caches, and the MMU, disable alignment requirements - * and write-implies-XN - */ -- __asm__("mrs %x0, sctlr_el1" : "=r" (sctlr_el1)); -- sctlr_el1 |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; -- sctlr_el1 &= ~(SCTLR_A | SCTLR_WXN); -- __asm__("msr sctlr_el1, %x0" :: "r" (sctlr_el1)); -+ __asm__("mrs %x0, sctlr_"BOOT_EL"" : "=r" (sctlr)); -+ sctlr |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; -+ sctlr &= ~(SCTLR_A | SCTLR_WXN); -+ __asm__("msr sctlr_"BOOT_EL", %x0" :: "r" (sctlr)); - __asm__("isb\n"); - - /* Set the vector base address register */ -- __asm__("msr vbar_el1, %x0" :: "r" (__vector_table)); -+ __asm__("msr vbar_"BOOT_EL", %x0" :: "r" (__vector_table)); - __start(); - } - --void __section(".text.init.enter") --_start(void) --{ -- /* Switch to EL1 */ -- __asm__("msr SPSel, #1"); -- -- /* Initialize stack */ -- __asm__("adrp x1, __stack"); -- __asm__("add x1, x1, :lo12:__stack"); -- __asm__("mov sp, x1"); --#if __ARM_FP -- /* Enable FPU */ -- __asm__("mov x1, #(0x3 << 20)"); -- __asm__("msr cpacr_el1,x1"); --#endif -- /* Jump into C code */ -- __asm__("bl _cstart"); --} - - #ifdef CRT0_SEMIHOST - -@@ -269,13 +194,9 @@ static const char *const reasons[] = { - "serror\n" - }; - --#define REASON_SYNC 0 --#define REASON_IRQ 1 --#define REASON_FIQ 2 --#define REASON_SERROR 3 -- --static void __attribute__((used)) --aarch64_fault(struct fault *f, int reason) -+/* Called from assembly wrappers in crt0.S, which fills *f with the register -+ * values at the point the fault happened. */ -+void aarch64_fault(struct fault *f, int reason) - { - int r; - fputs("AARCH64 fault: ", stdout); -@@ -292,69 +213,4 @@ aarch64_fault(struct fault *f, int reason) - _exit(1); - } - --#define VECTOR_COMMON \ -- __asm__("sub sp, sp, #256"); \ -- __asm__("str x0, [sp, #0]"); \ -- __asm__("str x1, [sp, #8]"); \ -- __asm__("str x2, [sp, #16]"); \ -- __asm__("str x3, [sp, #24]"); \ -- __asm__("str x4, [sp, #32]"); \ -- __asm__("str x5, [sp, #40]"); \ -- __asm__("str x6, [sp, #48]"); \ -- __asm__("str x7, [sp, #56]"); \ -- __asm__("str x8, [sp, #64]"); \ -- __asm__("str x9, [sp, #72]"); \ -- __asm__("str x10, [sp, #80]"); \ -- __asm__("str x11, [sp, #88]"); \ -- __asm__("str x12, [sp, #96]"); \ -- __asm__("str x13, [sp, #104]"); \ -- __asm__("str x14, [sp, #112]"); \ -- __asm__("str x15, [sp, #120]"); \ -- __asm__("str x16, [sp, #128]"); \ -- __asm__("str x17, [sp, #136]"); \ -- __asm__("str x18, [sp, #144]"); \ -- __asm__("str x19, [sp, #152]"); \ -- __asm__("str x20, [sp, #160]"); \ -- __asm__("str x21, [sp, #168]"); \ -- __asm__("str x22, [sp, #176]"); \ -- __asm__("str x23, [sp, #184]"); \ -- __asm__("str x24, [sp, #192]"); \ -- __asm__("str x25, [sp, #200]"); \ -- __asm__("str x26, [sp, #208]"); \ -- __asm__("str x27, [sp, #216]"); \ -- __asm__("str x28, [sp, #224]"); \ -- __asm__("str x29, [sp, #232]"); \ -- __asm__("str x30, [sp, #240]"); \ -- __asm__("mrs x0, ELR_EL1\n"); \ -- __asm__("str x0, [sp, #248]"); \ -- __asm__("mrs x0, ESR_EL1\n"); \ -- __asm__("str x0, [sp, #256]"); \ -- __asm__("mrs x0, FAR_EL1\n"); \ -- __asm__("str x0, [sp, #264]"); \ -- __asm__("mov x0, sp") -- --void __section(".init") --aarch64_sync_vector(void) --{ -- VECTOR_COMMON; -- __asm__("mov x1, #" REASON(REASON_SYNC)); -- __asm__("b aarch64_fault"); --} -- --void __section(".init") --aarch64_irq_vector(void) --{ -- VECTOR_COMMON; -- __asm__("mov x1, #" REASON(REASON_IRQ)); -- __asm__("b aarch64_fault"); --} -- --void __section(".init") --aarch64_fiq_vector(void) --{ -- VECTOR_COMMON; -- __asm__("mov x1, #" REASON(REASON_FIQ)); -- __asm__("b aarch64_fault"); --} -- - #endif /* CRT0_SEMIHOST */ -diff --git a/picocrt/machine/aarch64/meson.build b/picocrt/machine/aarch64/meson.build -index 808d691a5..923d32c3b 100644 ---- a/picocrt/machine/aarch64/meson.build -+++ b/picocrt/machine/aarch64/meson.build -@@ -32,4 +32,11 @@ - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # --src_picocrt += files('crt0.c') -+src_picocrt += files('crt0.c', 'crt0.S') -+ -+picocrt_machines += [ -+ { -+ 'name': 'fvp', -+ 'suffix': '-fvp', -+ }, -+] -diff --git a/picocrt/machine/arm/meson.build b/picocrt/machine/arm/meson.build -index 808d691a5..ecc9a485b 100644 ---- a/picocrt/machine/arm/meson.build -+++ b/picocrt/machine/arm/meson.build -@@ -33,3 +33,10 @@ - # OF THE POSSIBILITY OF SUCH DAMAGE. - # - src_picocrt += files('crt0.c') -+ -+picocrt_machines += [ -+ { -+ 'name': 'fvp', -+ 'suffix': '-fvp', -+ }, -+] -diff --git a/picocrt/meson.build b/picocrt/meson.build -index 76965990f..be8f875be 100644 ---- a/picocrt/meson.build -+++ b/picocrt/meson.build -@@ -36,6 +36,17 @@ - src_picocrt = [] - src_picocrt_none = files('crt0-none.c') - -+# Machine-specific crt0 variants to build. -+picocrt_machines = [ -+ { -+ # Must match a valid value of the 'test-machine' option, and will cause the -+ # MACHINE_ preprocessor macro to be defined when compiling crt0. -+ 'name': 'qemu', -+ # Suffix used on file names, QEMU's is empty because it is the default. -+ 'suffix': '', -+ }, -+] -+ - machine_dir = 'machine' / host_cpu_family - picocrt_march_add='' - if fs.is_dir(machine_dir) -@@ -44,6 +55,16 @@ else - src_picocrt = files('shared/crt0.c') - endif - -+machine_found = false -+foreach machine : picocrt_machines -+ if machine['name'] == test_machine -+ machine_found = true -+ endif -+endforeach -+if not machine_found -+ error(test_machine + ': requested test machine not found') -+endif -+ - foreach target : targets - value = get_variable('target_' + target) - -@@ -60,150 +81,163 @@ foreach target : targets - value = [value[0], new_cflags] - endif - -- if target == '' -- crt_name = 'crt0.o' -- crt_hosted_name = 'crt0-hosted.o' -- crt_minimal_name = 'crt0-minimal.o' -- crt_semihost_name = 'crt0-semihost.o' -- crt_none_name = 'crt0-none.o' -- libcrt_name = 'crt0' -- libcrt_hosted_name = 'crt0-hosted' -- libcrt_minimal_name = 'crt0-minimal' -- libcrt_semihost_name = 'crt0-semihost' -- libcrt_none_name = 'crt0-none' -- else -- crt_name = join_paths(target, 'crt0.o') -- crt_hosted_name = join_paths(target, 'crt0-hosted.o') -- crt_minimal_name = join_paths(target, 'crt0-minimal.o') -- crt_semihost_name = join_paths(target, 'crt0-semihost.o') -- crt_none_name = join_paths(target, 'crt0-none.o') -- libcrt_name = join_paths(target, 'libcrt0') -- libcrt_hosted_name = join_paths(target, 'libcrt0-hosted') -- libcrt_minimal_name = join_paths(target, 'libcrt0-minimal') -- libcrt_semihost_name = join_paths(target, 'libcrt0-semihost') -- libcrt_none_name = join_paths(target, 'libcrt0-none') -- endif -+ foreach machine : picocrt_machines -+ suffix = machine['suffix'] -+ if target == '' -+ crt_name = 'crt0' + suffix + '.o' -+ crt_hosted_name = 'crt0-hosted' + suffix + '.o' -+ crt_minimal_name = 'crt0-minimal' + suffix + '.o' -+ crt_semihost_name = 'crt0-semihost' + suffix + '.o' -+ crt_none_name = 'crt0-none' + suffix + '.o' -+ libcrt_name = 'crt0' + suffix -+ libcrt_hosted_name = 'crt0-hosted' + suffix -+ libcrt_minimal_name = 'crt0-minimal' + suffix -+ libcrt_semihost_name = 'crt0-semihost' + suffix -+ libcrt_none_name = 'crt0-none' + suffix -+ else -+ crt_name = join_paths(target, 'crt0' + suffix + '.o') -+ crt_hosted_name = join_paths(target, 'crt0-hosted' + suffix + '.o') -+ crt_minimal_name = join_paths(target, 'crt0-minimal' + suffix + '.o') -+ crt_semihost_name = join_paths(target, 'crt0-semihost' + suffix + '.o') -+ crt_none_name = join_paths(target, 'crt0-none' + suffix + '.o') -+ libcrt_name = join_paths(target, 'libcrt0' + suffix) -+ libcrt_hosted_name = join_paths(target, 'libcrt0-hosted' + suffix) -+ libcrt_minimal_name = join_paths(target, 'libcrt0-minimal' + suffix) -+ libcrt_semihost_name = join_paths(target, 'libcrt0-semihost' + suffix) -+ libcrt_none_name = join_paths(target, 'libcrt0-none' + suffix) -+ endif - -- crt0_name = 'crt0' + target -- crt0_hosted_name = 'crt0_hosted' + target -- crt0_minimal_name = 'crt0_minimal' + target -- crt0_semihost_name = 'crt0_semihost' + target -- crt0_none_name = 'crt0_none' + target -- -- _c_args = value[1] + arg_fnobuiltin + ['-ffreestanding'] -- _link_args = value[1] + ['-r', '-ffreestanding'] -- -- # The normal variant does not call 'exit' after return from main (c lingo: freestanding execution environment) -- _crt = executable(crt_name, -- src_picocrt, -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args, -- link_args : _link_args) -- -- set_variable(crt0_name, -- _crt.extract_objects(src_picocrt) -- ) -- -- if enable_picocrt_lib -- static_library(libcrt_name, -- [], -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args, -- objects: get_variable(crt0_name), -- pic: false) -- endif -+ crt0_name = 'crt0' + target -+ crt0_hosted_name = 'crt0_hosted' + target -+ crt0_minimal_name = 'crt0_minimal' + target -+ crt0_semihost_name = 'crt0_semihost' + target -+ crt0_none_name = 'crt0_none' + target -+ -+ _c_args = value[1] + arg_fnobuiltin + ['-ffreestanding', '-DMACHINE_' + machine['name']] -+ _link_args = value[1] + ['-r', '-ffreestanding'] -+ -+ # The normal variant does not call 'exit' after return from main (c lingo: freestanding execution environment) -+ _crt = executable(crt_name, -+ src_picocrt, -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args, -+ link_args : _link_args) -+ -+ if machine['name'] == test_machine -+ set_variable(crt0_name, -+ _crt.extract_objects(src_picocrt) -+ ) -+ endif - -- # The 'hosted' variant calls 'exit' after return from main (c lingo: hosted execution environment) -- _crt = executable(crt_hosted_name, -- src_picocrt, -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args + ['-DCRT0_EXIT'], -- link_args : _link_args) -- -- set_variable(crt0_hosted_name, -- _crt.extract_objects(src_picocrt) -- ) -- -- if enable_picocrt_lib -- static_library(libcrt_hosted_name, -- [], -- include_directories : inc, -- install : true, -- install_dir : instdir, -- pic: false, -- objects: get_variable(crt0_hosted_name), -- c_args : value[1] + ['-DCRT0_EXIT']) -- endif -+ if enable_picocrt_lib -+ static_library(libcrt_name, -+ [], -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args, -+ objects: _crt.extract_objects(src_picocrt), -+ pic: false) -+ endif - -- # The 'minimal' variant doesn't call exit, nor does it invoke any constructors -- _crt = executable(crt_minimal_name, -- src_picocrt, -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args + ['-DCONSTRUCTORS=0'], -- link_args : _link_args) -- -- set_variable(crt0_minimal_name, -- _crt.extract_objects(src_picocrt) -- ) -- -- if enable_picocrt_lib -- static_library(libcrt_minimal_name, -- [], -- include_directories : inc, -- install : true, -- install_dir : instdir, -- pic: false, -- objects: get_variable(crt0_minimal_name), -- c_args : _c_args + ['-DCONSTRUCTORS=0']) -- endif -+ # The 'hosted' variant calls 'exit' after return from main (c lingo: hosted execution environment) -+ _crt = executable(crt_hosted_name, -+ src_picocrt, -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args + ['-DCRT0_EXIT'], -+ link_args : _link_args) -+ -+ if machine['name'] == test_machine -+ set_variable(crt0_hosted_name, -+ _crt.extract_objects(src_picocrt) -+ ) -+ endif - -- if has_arm_semihost -- # The 'semihost' variant calls sys_semihost_get_cmdline to build argv -- # and calls exit when main returns -- _crt = executable(crt_semihost_name, -- src_picocrt, -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST'], -- link_args : _link_args) -- -- set_variable(crt0_semihost_name, -- _crt.extract_objects(src_picocrt) -- ) -+ if enable_picocrt_lib -+ static_library(libcrt_hosted_name, -+ [], -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ pic: false, -+ objects: _crt.extract_objects(src_picocrt), -+ c_args : value[1] + ['-DCRT0_EXIT']) -+ endif -+ -+ # The 'minimal' variant doesn't call exit, nor does it invoke any constructors -+ _crt = executable(crt_minimal_name, -+ src_picocrt, -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args + ['-DCONSTRUCTORS=0'], -+ link_args : _link_args) -+ -+ if machine['name'] == test_machine -+ set_variable(crt0_minimal_name, -+ _crt.extract_objects(src_picocrt) -+ ) -+ endif - - if enable_picocrt_lib -- static_library(libcrt_semihost_name, -+ static_library(libcrt_minimal_name, - [], -- include_directories : inc, -+ include_directories : inc, - install : true, - install_dir : instdir, - pic: false, -- objects: get_variable(crt0_semihost_name), -- c_args : value[1] + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST']) -+ objects: _crt.extract_objects(src_picocrt), -+ c_args : _c_args + ['-DCONSTRUCTORS=0']) - endif -- endif - -- # The 'none' variant is completely empty -- _crt = executable(crt_none_name, -- src_picocrt_none, -- include_directories : inc, -- install : true, -- install_dir : instdir, -- c_args : _c_args, -- link_args : _link_args) -+ if has_arm_semihost -+ # The 'semihost' variant calls sys_semihost_get_cmdline to build argv -+ # and calls exit when main returns -+ _crt = executable(crt_semihost_name, -+ src_picocrt, -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST'], -+ link_args : _link_args) -+ -+ if machine['name'] == test_machine -+ set_variable(crt0_semihost_name, -+ _crt.extract_objects(src_picocrt) -+ ) -+ endif - -- set_variable(crt0_none_name, -- _crt.extract_objects(src_picocrt_none) -- ) -+ if enable_picocrt_lib -+ static_library(libcrt_semihost_name, -+ [], -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ pic: false, -+ objects: _crt.extract_objects(src_picocrt), -+ c_args : value[1] + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST']) -+ endif -+ endif -+ -+ # The 'none' variant is completely empty -+ _crt = executable(crt_none_name, -+ src_picocrt_none, -+ include_directories : inc, -+ install : true, -+ install_dir : instdir, -+ c_args : _c_args, -+ link_args : _link_args) -+ -+ if machine['name'] == test_machine -+ set_variable(crt0_none_name, -+ _crt.extract_objects(src_picocrt_none) -+ ) -+ endif - -+ endforeach - - endforeach --- -2.34.1 diff --git a/patches/picolibc/0002-Define-picocrt_machines-for-AArch32-builds-as-well-a.patch b/patches/picolibc/0002-Define-picocrt_machines-for-AArch32-builds-as-well-a.patch new file mode 100644 index 00000000..a18166df --- /dev/null +++ b/patches/picolibc/0002-Define-picocrt_machines-for-AArch32-builds-as-well-a.patch @@ -0,0 +1,29 @@ +From c9a704b1322aec5f699e2962368bbffd286eb010 Mon Sep 17 00:00:00 2001 +From: Simi Pallipurath +Date: Thu, 14 Nov 2024 10:12:33 +0000 +Subject: Define picocrt_machines for AArch32 builds as well as 64. + +Our cmake build command for picolibc unconditionally includes +`-Dtest-machine=...`, which depends on this being defined. +--- + picocrt/machine/arm/meson.build | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/picocrt/machine/arm/meson.build b/picocrt/machine/arm/meson.build +index 808d691a5..ecc9a485b 100644 +--- a/picocrt/machine/arm/meson.build ++++ b/picocrt/machine/arm/meson.build +@@ -33,3 +33,10 @@ + # OF THE POSSIBILITY OF SUCH DAMAGE. + # + src_picocrt += files('crt0.c') ++ ++picocrt_machines += [ ++ { ++ 'name': 'fvp', ++ 'suffix': '-fvp', ++ }, ++] +-- +2.43.0 + diff --git a/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch b/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch index eb366cc6..1b30ab50 100644 --- a/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch +++ b/patches/picolibc/0003-Add-support-for-strict-align-no-unaligned-access-in-.patch @@ -1,4 +1,4 @@ -From 79f3ce1b5f730b0293e8452d4e028e34c0e71736 Mon Sep 17 00:00:00 2001 +From ef4378c3f62947b9ce1eac19b717ac44d5aeecb7 Mon Sep 17 00:00:00 2001 From: Lucas Prates Date: Mon, 11 Nov 2024 16:37:04 +0000 Subject: Add support for strict-align/no-unaligned-access in AArch64 @@ -427,5 +427,5 @@ index 1fccba9f8..2f0cdc0c7 100644 #else -- -2.39.5 (Apple Git-154) +2.43.0 diff --git a/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch b/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch index 0a0bd275..69f8930d 100644 --- a/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch +++ b/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch @@ -1,8 +1,8 @@ -From 11abbd6533eeacbb000fc19bd07316e11fcb6fea Mon Sep 17 00:00:00 2001 +From e6a1281ca4e08c0fe4da97e2dbb8d2bd1f049b1b Mon Sep 17 00:00:00 2001 From: Simi Pallipurath Date: Tue, 26 Nov 2024 15:20:50 +0000 -Subject: [ARM/AARCH64] BootCode Changes to enable the Alignment Check - bit and disable the unaligned access bit +Subject: [ARM/AARCH64] BootCode Changes to enable the Alignment Check bit and + disable the unaligned access bit We need changes in both Arm/AArch64 bootcode in order for the -mno-unaligned-access to work. @@ -64,5 +64,5 @@ index 60efafc9c..e27ccb6a9 100644 __asm__("mcr p15, 0, %0, c1, c0, 0\n" :: "r" (sctlr)); __asm__("isb\n"); -- -2.34.1 +2.43.0 From 8139c96510a952d3faa39c605091a23553f7083f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 9 Dec 2024 13:54:21 +0000 Subject: [PATCH 107/138] Fix build failures in aarch64a_[be_]soft_nofp variants. (#591) Those two variants have `-fno-exceptions -fno-rtti` in the configuration file that specifies options for building the library. None of the other library variants is built with this flags, not even the other variants intended for use in _applications_ without exceptions and RTTI. If you try to build libc++abi with those flags, it fails to build, because `private_typeinfo.cpp` is unconditionally included in the library and unconditionally uses `dynamic_cast`. (And I assume that it's OK to use `dynamic_cast` in that part of libc++abi if the application will never use RTTI, because then it won't include that object file in the first place.) --- arm-multilib/json/variants/aarch64a_be_soft_nofp.json | 2 +- arm-multilib/json/variants/aarch64a_soft_nofp.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-multilib/json/variants/aarch64a_be_soft_nofp.json b/arm-multilib/json/variants/aarch64a_be_soft_nofp.json index 67ca0013..378d6017 100644 --- a/arm-multilib/json/variants/aarch64a_be_soft_nofp.json +++ b/arm-multilib/json/variants/aarch64a_be_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_be_soft_nofp", - "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mbig-endian -mabi=aapcs-soft -mno-unaligned-access -fno-exceptions -fno-rtti", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mbig-endian -mabi=aapcs-soft -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "fvp", diff --git a/arm-multilib/json/variants/aarch64a_soft_nofp.json b/arm-multilib/json/variants/aarch64a_soft_nofp.json index b939c543..4eb508a3 100644 --- a/arm-multilib/json/variants/aarch64a_soft_nofp.json +++ b/arm-multilib/json/variants/aarch64a_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_soft_nofp", - "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft -mno-unaligned-access -fno-exceptions -fno-rtti", + "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", From cff8232860e237a89171616af5d73ef4d04f1f3c Mon Sep 17 00:00:00 2001 From: dcandler Date: Mon, 9 Dec 2024 17:09:50 +0000 Subject: [PATCH 108/138] Do not build AArch64a soft no_fp variants using llvm-libc (#592) LLVM-libc does not currently support no-neon soft float on AArch64 targets. To prevent building these until support is available, this patch adds an option to explicitly set which C libraries a variant can be built with. If the option is absent, the default is to build with all library options. --- arm-multilib/CMakeLists.txt | 9 +++++++++ arm-multilib/json/multilib.json | 12 ++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 027332fa..7329502f 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -143,6 +143,15 @@ foreach(lib_idx RANGE ${lib_count_dec}) string(JSON variant GET ${lib_def} "variant") set(additional_cmake_args "") + # If a variant doesn't support all possible C library + # options, check if it should be skipped. + string(JSON variant_support ERROR_VARIABLE json_error GET ${lib_def} "libraries_supported") + if(NOT variant_support STREQUAL "libraries_supported-NOTFOUND") + if(NOT C_LIBRARY IN_LIST variant_support) + continue() + endif() + endif() + if(variant IN_LIST ENABLE_VARIANTS OR ENABLE_VARIANTS STREQUAL "all") string(JSON variant_multilib_flags GET ${lib_def} "flags") # Placeholder libraries won't have a json, so store the error in diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 19f4edd7..4101e3e1 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -33,22 +33,26 @@ { "variant": "aarch64a_soft_nofp", "json": "aarch64a_soft_nofp.json", - "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti" + "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_be_soft_nofp", "json": "aarch64a_be_soft_nofp.json", - "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti" + "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_soft_nofp_exn_rtti", "json": "aarch64a_soft_nofp_exn_rtti.json", - "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft" + "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_be_soft_nofp_exn_rtti", "json": "aarch64a_be_soft_nofp_exn_rtti.json", - "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft" + "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "libraries_supported": "picolibc,newlib" }, { From 776a44c48a480a180992d19ce7a5cb460de5b975 Mon Sep 17 00:00:00 2001 From: dcandler Date: Tue, 10 Dec 2024 15:23:46 +0000 Subject: [PATCH 109/138] Fix delimiter so CMake reads string as a list (#593) The libraries_supported property is a comma separated list, but CMake uses semi-colons to understand lists. Replacing the character will allow CMake to check which libraries are set within. --- arm-multilib/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 7329502f..0b371ad2 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -147,6 +147,8 @@ foreach(lib_idx RANGE ${lib_count_dec}) # options, check if it should be skipped. string(JSON variant_support ERROR_VARIABLE json_error GET ${lib_def} "libraries_supported") if(NOT variant_support STREQUAL "libraries_supported-NOTFOUND") + # Replace colons with semi-colons so CMake comprehends the list. + string(REPLACE "," ";" variant_support ${variant_support}) if(NOT C_LIBRARY IN_LIST variant_support) continue() endif() From 5c4cebcefaf24c81b27803e957643e107cab0c9a Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Wed, 11 Dec 2024 11:10:38 +0000 Subject: [PATCH 110/138] Fixes in the AArch64 nofp variants regarding RTTI and exceptions (#594) This patch fixes a few issues in the AArch64 nofp variants: - AArch64 nofp variants without exceptions and RTTI must have higher priority The presence of `-fno-exceptions` and `-fno-rtti` in the driver invocation causes matching with two variants: the one with RTTI/Exceptions and the one without. In the multilib system, the last match is the one that wins, therefore in the JSON file we must list the variant without RTTI/Exceptions *after* the one with. - Enable exceptions and RTTI in the build of aarch64 nofp variants supposed to have them --- arm-multilib/json/multilib.json | 25 +++++++++---------- .../aarch64a_be_soft_nofp_exn_rtti.json | 4 +-- .../variants/aarch64a_soft_nofp_exn_rtti.json | 4 +-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 4101e3e1..87fde0e0 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -30,31 +30,30 @@ "json": "aarch64a_strictalign.json", "flags": "--target=aarch64-unknown-none-elf -mno-unaligned-access -fno-exceptions -fno-rtti" }, - { - "variant": "aarch64a_soft_nofp", - "json": "aarch64a_soft_nofp.json", - "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", - "libraries_supported": "picolibc,newlib" - }, - { - "variant": "aarch64a_be_soft_nofp", - "json": "aarch64a_be_soft_nofp.json", - "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", - "libraries_supported": "picolibc,newlib" - }, { "variant": "aarch64a_soft_nofp_exn_rtti", "json": "aarch64a_soft_nofp_exn_rtti.json", "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", "libraries_supported": "picolibc,newlib" }, + { + "variant": "aarch64a_soft_nofp", + "json": "aarch64a_soft_nofp.json", + "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "libraries_supported": "picolibc,newlib" + }, { "variant": "aarch64a_be_soft_nofp_exn_rtti", "json": "aarch64a_be_soft_nofp_exn_rtti.json", "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", "libraries_supported": "picolibc,newlib" }, - + { + "variant": "aarch64a_be_soft_nofp", + "json": "aarch64a_be_soft_nofp.json", + "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "libraries_supported": "picolibc,newlib" + }, { "variant": "armv4t_exn_rtti", "json": "armv4t_exn_rtti.json", diff --git a/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json index b1acc211..f4fc47d0 100644 --- a/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/aarch64a_be_soft_nofp_exn_rtti.json @@ -4,8 +4,8 @@ "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_be_soft_nofp_exn_rtti", "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mbig-endian -mabi=aapcs-soft -mno-unaligned-access", - "ENABLE_EXCEPTIONS": "OFF", - "ENABLE_RTTI": "OFF", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "fvp", "FVP_MODEL": "aem-a", "FVP_CONFIG": "v8a-aarch64 big-endian", diff --git a/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json index 52781406..90e703e6 100644 --- a/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/aarch64a_soft_nofp_exn_rtti.json @@ -4,8 +4,8 @@ "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_soft_nofp_exn_rtti", "COMPILE_FLAGS": "-march=armv8-a+nofp+nosimd -mabi=aapcs-soft -mno-unaligned-access", - "ENABLE_EXCEPTIONS": "OFF", - "ENABLE_RTTI": "OFF", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", "QEMU_MACHINE": "virt", "QEMU_CPU": "cortex-a57", From 1d6668d86a2fa75a2ef4c9a3e00e2396f097b7b1 Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Mon, 16 Dec 2024 11:18:29 +0000 Subject: [PATCH 111/138] =?UTF-8?q?Update=20the=20patch=20file=20with=20up?= =?UTF-8?q?stream=20changes=20of=20file=20libcxxabi/test/te=E2=80=A6=20(#5?= =?UTF-8?q?99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the patch file with upstream changes of test_demangle.pass.cpp --- .../0002-libc-tests-with-picolibc-disable-large-tests.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch index 0e9821d2..8f7a9ba6 100644 --- a/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch +++ b/patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch @@ -51,7 +51,8 @@ index ad131bb3a8a7..ac612c79f71c 100644 -// XFAIL: LIBCXX-PICOLIBC-FIXME +// REQUIRES: large_tests - // This test exercises support for char array initializer lists added in dd8b266ef. + // This test exercises support for char array initializer lists added in + // dd8b266ef. // UNSUPPORTED: using-built-library-before-llvm-20 -- 2.39.5 (Apple Git-154) From 3f6e358eeae2e33f4fb5d5ab2cffac7ca57321e2 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 16 Dec 2024 15:33:55 +0000 Subject: [PATCH 112/138] Fix multilib flags of AArch64 soft nofp (#600) This patch fixes the multilib flags required to select the AArch64 soft nofp variants. The `+nofp` and `+nosimd` arch extensions are specified in the `-march` or `-mcpu` command line options. Before this patch, the multilib flags specified this part as `-march=armv8-a+nofp+nosimd`, however this does not work for any architecture greater than v8, including point releases, nor does it for any `-mcpu` value whose underlying architecture is greater than v8. In the former case because any point release would lead to a regular expression mismatch; and in the latter, `-mcpu` option processing introduces extra architecture extensions in the string. Hence the correct way is to match agains `-march=armvX+nofp` and `-march=armvX+nosimd`. These two multilib flags are inserted by our implementation of `multilib.yaml` when `+nofp` and `+nosimd` are present anywhere in the `-march=` or `-mcpu=` values, respectively. --- arm-multilib/json/multilib.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 87fde0e0..86b4e63f 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -33,25 +33,25 @@ { "variant": "aarch64a_soft_nofp_exn_rtti", "json": "aarch64a_soft_nofp_exn_rtti.json", - "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "flags": "--target=aarch64-unknown-none-elf -march=armvX+nofp -march=armvX+nosimd -mabi=aapcs-soft", "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_soft_nofp", "json": "aarch64a_soft_nofp.json", - "flags": "--target=aarch64-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "flags": "--target=aarch64-unknown-none-elf -march=armvX+nofp -march=armvX+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_be_soft_nofp_exn_rtti", "json": "aarch64a_be_soft_nofp_exn_rtti.json", - "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft", + "flags": "--target=aarch64_be-unknown-none-elf -march=armvX+nofp -march=armvX+nosimd -mabi=aapcs-soft", "libraries_supported": "picolibc,newlib" }, { "variant": "aarch64a_be_soft_nofp", "json": "aarch64a_be_soft_nofp.json", - "flags": "--target=aarch64_be-unknown-none-elf -march=armv8-a+nofp+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", + "flags": "--target=aarch64_be-unknown-none-elf -march=armvX+nofp -march=armvX+nosimd -mabi=aapcs-soft -fno-exceptions -fno-rtti", "libraries_supported": "picolibc,newlib" }, { From 4e1a0e189579b89681854f0b167818b15de0e361 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Tue, 17 Dec 2024 09:35:47 +0000 Subject: [PATCH 113/138] Remove downstream picolibc patch (#602) This patch was merged in upstream picolibc: https://github.com/picolibc/picolibc/pull/895 --- ...Code-Changes-to-enable-the-Alignment.patch | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch diff --git a/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch b/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch deleted file mode 100644 index 69f8930d..00000000 --- a/patches/picolibc/0004-ARM-AARCH64-BootCode-Changes-to-enable-the-Alignment.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e6a1281ca4e08c0fe4da97e2dbb8d2bd1f049b1b Mon Sep 17 00:00:00 2001 -From: Simi Pallipurath -Date: Tue, 26 Nov 2024 15:20:50 +0000 -Subject: [ARM/AARCH64] BootCode Changes to enable the Alignment Check bit and - disable the unaligned access bit - -We need changes in both Arm/AArch64 bootcode in -order for the -mno-unaligned-access to work. - -We need to enable the Alignment Check bit in the -System Control Register (SCTLR) which is the -Bit 1 (A) and it turn on alignment fault checking -for data accesses . If an unaligned data access -occurs, an alignment fault exception will be generated. - -Also need to disable the Unaligned Access Enable(U) bit -in the System Control Register (SCTLR). As a result, -unaligned data accesses will generate an alignment fault exception. ---- - picocrt/machine/aarch64/crt0.c | 7 ++++++- - picocrt/machine/arm/crt0.c | 6 ++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/picocrt/machine/aarch64/crt0.c b/picocrt/machine/aarch64/crt0.c -index dfe838111..885282f4d 100644 ---- a/picocrt/machine/aarch64/crt0.c -+++ b/picocrt/machine/aarch64/crt0.c -@@ -144,7 +144,12 @@ void _cstart(void) - */ - __asm__("mrs %x0, sctlr_"BOOT_EL"" : "=r" (sctlr)); - sctlr |= SCTLR_ICACHE | SCTLR_C | SCTLR_MMU; -- sctlr &= ~(SCTLR_A | SCTLR_WXN); -+ #ifdef __ARM_FEATURE_UNALIGNED -+ sctlr &= ~SCTLR_A; -+ #else -+ sctlr |= SCTLR_A; -+ #endif -+ sctlr &= ~SCTLR_WXN; - __asm__("msr sctlr_"BOOT_EL", %x0" :: "r" (sctlr)); - __asm__("isb\n"); - -diff --git a/picocrt/machine/arm/crt0.c b/picocrt/machine/arm/crt0.c -index 60efafc9c..e27ccb6a9 100644 ---- a/picocrt/machine/arm/crt0.c -+++ b/picocrt/machine/arm/crt0.c -@@ -246,6 +246,8 @@ _cstart(void) - #define SCTLR_BRANCH_PRED (1 << 11) - #define SCTLR_ICACHE (1 << 12) - #define SCTLR_TRE (1 << 28) -+#define SCTLR_A (1 << 1) -+#define SCTLR_U (1 << 22) - - uint32_t mmfr0; - __asm__("mrc p15, 0, %0, c0, c1, 4" : "=r" (mmfr0)); -@@ -280,6 +282,10 @@ _cstart(void) - uint32_t sctlr; - __asm__("mrc p15, 0, %0, c1, c0, 0" : "=r" (sctlr)); - sctlr |= SCTLR_ICACHE | SCTLR_BRANCH_PRED | SCTLR_DATA_L2 | SCTLR_MMU; -+ #ifndef __ARM_FEATURE_UNALIGNED -+ sctlr |= SCTLR_A; -+ sctlr &= ~SCTLR_U; -+ #endif - sctlr &= ~SCTLR_TRE; - __asm__("mcr p15, 0, %0, c1, c0, 0\n" :: "r" (sctlr)); - __asm__("isb\n"); --- -2.43.0 - From ff324bc961f55d7e6edce39663a35ce97dcdd994 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy <66017160+voltur01@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:09:59 +0000 Subject: [PATCH 114/138] Add a temporary workaround for 597 (#606) This adds a patch file that reverts the order of libraries added on the command line to previously working one to avoid error about duplicate __aeabi_mem* symbols. This patch will be removed, once we implement a proper permanent solution in llvm-project. --- .../0008-library-order-workaround-for-597.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/llvm-project/0008-library-order-workaround-for-597.patch diff --git a/patches/llvm-project/0008-library-order-workaround-for-597.patch b/patches/llvm-project/0008-library-order-workaround-for-597.patch new file mode 100644 index 00000000..747d2f71 --- /dev/null +++ b/patches/llvm-project/0008-library-order-workaround-for-597.patch @@ -0,0 +1,15 @@ +diff --git a/clang/lib/Driver/ToolChains/BareMetal.cpp b/clang/lib/Driver/ToolChains/BareMetal.cpp +index eecaaa9a4293..7d07079b5dd4 100644 +--- a/clang/lib/Driver/ToolChains/BareMetal.cpp ++++ b/clang/lib/Driver/ToolChains/BareMetal.cpp +@@ -491,9 +491,8 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, + } + + if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { +- AddRunTimeLibs(TC, D, CmdArgs, Args); +- + CmdArgs.push_back("-lc"); ++ AddRunTimeLibs(TC, D, CmdArgs, Args); + } + + if (D.isUsingLTO()) { From 8c1eb6cc46dfdaaf77b2c5cd18e78a2af690a1e5 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy <66017160+voltur01@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:43:23 +0000 Subject: [PATCH 115/138] Update patch file format to git format-patch (#608) --- .../0008-library-order-workaround-for-597.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/llvm-project/0008-library-order-workaround-for-597.patch b/patches/llvm-project/0008-library-order-workaround-for-597.patch index 747d2f71..70bb0762 100644 --- a/patches/llvm-project/0008-library-order-workaround-for-597.patch +++ b/patches/llvm-project/0008-library-order-workaround-for-597.patch @@ -1,3 +1,12 @@ +From f037d9740bf53cf43142595330355a3b61304dd7 Mon Sep 17 00:00:00 2001 +From: Volodymyr Turanskyy +Date: Wed, 18 Dec 2024 16:29:25 +0000 +Subject: [PATCH] Revert order of libraries on the command line + +--- + clang/lib/Driver/ToolChains/BareMetal.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + diff --git a/clang/lib/Driver/ToolChains/BareMetal.cpp b/clang/lib/Driver/ToolChains/BareMetal.cpp index eecaaa9a4293..7d07079b5dd4 100644 --- a/clang/lib/Driver/ToolChains/BareMetal.cpp @@ -13,3 +22,6 @@ index eecaaa9a4293..7d07079b5dd4 100644 } if (D.isUsingLTO()) { +-- +2.47.0 + From b9e382074ae245a354bf973d28a8212de3ee7fd1 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy <66017160+voltur01@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:32:45 +0000 Subject: [PATCH 116/138] Update the #597 workaround patch to also fix tests (#610) --- ...008-library-order-workaround-for-597.patch | 225 +++++++++++++++++- 1 file changed, 220 insertions(+), 5 deletions(-) diff --git a/patches/llvm-project/0008-library-order-workaround-for-597.patch b/patches/llvm-project/0008-library-order-workaround-for-597.patch index 70bb0762..6854fe3f 100644 --- a/patches/llvm-project/0008-library-order-workaround-for-597.patch +++ b/patches/llvm-project/0008-library-order-workaround-for-597.patch @@ -1,11 +1,14 @@ -From f037d9740bf53cf43142595330355a3b61304dd7 Mon Sep 17 00:00:00 2001 +From 3c25466248617c03c4db62504b226f82b568be5e Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy -Date: Wed, 18 Dec 2024 16:29:25 +0000 -Subject: [PATCH] Revert order of libraries on the command line +Date: Thu, 19 Dec 2024 12:01:58 +0000 +Subject: [PATCH] Revert order of libraries and update tests --- - clang/lib/Driver/ToolChains/BareMetal.cpp | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + clang/lib/Driver/ToolChains/BareMetal.cpp | 3 +- + clang/test/Driver/baremetal-multilib.yaml | 2 +- + clang/test/Driver/baremetal-sysroot.cpp | 2 +- + clang/test/Driver/baremetal.cpp | 38 +++++++++++------------ + 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/clang/lib/Driver/ToolChains/BareMetal.cpp b/clang/lib/Driver/ToolChains/BareMetal.cpp index eecaaa9a4293..7d07079b5dd4 100644 @@ -22,6 +25,218 @@ index eecaaa9a4293..7d07079b5dd4 100644 } if (D.isUsingLTO()) { +diff --git a/clang/test/Driver/baremetal-multilib.yaml b/clang/test/Driver/baremetal-multilib.yaml +index 853a4e9e36e4..847b1d6b3377 100644 +--- a/clang/test/Driver/baremetal-multilib.yaml ++++ b/clang/test/Driver/baremetal-multilib.yaml +@@ -10,8 +10,8 @@ + # CHECK-SAME: "-x" "c++" "{{.*}}baremetal-multilib.yaml" + # CHECK-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + # CHECK-SAME: "-L[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib" +-# CHECK-SAME: "{{[^"]*}}libclang_rt.builtins.a" + # CHECK-SAME: "-lc" ++# CHECK-SAME: "{{[^"]*}}libclang_rt.builtins.a" + # CHECK-SAME: "-o" "{{.*}}.tmp.out" + + # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \ +diff --git a/clang/test/Driver/baremetal-sysroot.cpp b/clang/test/Driver/baremetal-sysroot.cpp +index 5cbb7ac69a7a..2b836e65016b 100644 +--- a/clang/test/Driver/baremetal-sysroot.cpp ++++ b/clang/test/Driver/baremetal-sysroot.cpp +@@ -18,6 +18,6 @@ + // CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal-sysroot.cpp" + // CHECK-V6M-C-NEXT: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-V6M-C-SAME: "-L{{.*}}/baremetal_default_sysroot{{[/\\]+}}bin{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+}}armv6m-none-eabi{{[/\\]+}}lib" +-// CHECK-V6M-C-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-C-SAME: "-lc" ++// CHECK-V6M-C-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-C-SAME: "-o" "{{.*}}.o" +diff --git a/clang/test/Driver/baremetal.cpp b/clang/test/Driver/baremetal.cpp +index 6d6255ef5970..08c49a1beec0 100644 +--- a/clang/test/Driver/baremetal.cpp ++++ b/clang/test/Driver/baremetal.cpp +@@ -19,8 +19,8 @@ + // CHECK-V6M-C-SAME: "[[SYSROOT:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}crt0.o" + // CHECK-V6M-C-SAME: "-T" "semihosted.lds" "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for" + // CHECK-V6M-C-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib" +-// CHECK-V6M-C-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-C-SAME: "-lc" ++// CHECK-V6M-C-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-C-SAME: "--target2=rel" "-o" "{{.*}}.tmp.out" + + // RUN: %clang %s -### --target=armv6m-none-eabi -nostdlibinc -nobuiltininc 2>&1 \ +@@ -42,8 +42,8 @@ + // CHECK-V6M-TREE-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL" + // CHECK-V6M-TREE-SAME: "[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}armv6m-unknown-none-eabi{{[/\\]+}}crt0.o" + // CHECK-V6M-TREE-SAME: "-L[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}armv6m-unknown-none-eabi" +-// CHECK-V6M-TREE-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-TREE-SAME: "-lc" ++// CHECK-V6M-TREE-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-TREE-SAME: "--target2=rel" "-o" "{{.*}}.tmp.out" + + // RUN: %clang %s -### --target=armv7m-vendor-none-eabi -rtlib=compiler-rt 2>&1 \ +@@ -57,8 +57,8 @@ + // CHECK-ARMV7M-PER_TARGET: "[[SYSROOT:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}crt0.o" + // CHECK-ARMV7M-PER-TARGET: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib" + // CHECK-ARMV7M-PER-TARGET: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}armv7m-vendor-none-eabi +-// CHECK-ARMV7M-PER-TARGET: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-ARMV7M-PER-TARGET: "-lc" ++// CHECK-ARMV7M-PER-TARGET: "{{[^"]*}}libclang_rt.builtins.a" + + // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \ + // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-DEFAULTCXX %s +@@ -68,8 +68,8 @@ + // CHECK-V6M-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib" + // CHECK-V6M-DEFAULTCXX-SAME: "-lc++" + // CHECK-V6M-DEFAULTCXX-SAME: "-lm" +-// CHECK-V6M-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-DEFAULTCXX-SAME: "-lc" ++// CHECK-V6M-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-DEFAULTCXX-SAME: "--target2=rel" "-o" "a.out" + + // RUN: %clangxx %s -### --target=armv6m-none-eabi -stdlib=libc++ 2>&1 \ +@@ -81,8 +81,8 @@ + // CHECK-V6M-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib" + // CHECK-V6M-LIBCXX-SAME: "-lc++" + // CHECK-V6M-LIBCXX-SAME: "-lm" +-// CHECK-V6M-LIBCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-LIBCXX-SAME: "-lc" ++// CHECK-V6M-LIBCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-LIBCXX-SAME: "--target2=rel" "-o" "a.out" + + // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \ +@@ -95,8 +95,8 @@ + // CHECK-V6M-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL" + // CHECK-V6M-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib" + // CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lm" +-// CHECK-V6M-LIBSTDCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-LIBSTDCXX-SAME: "-lc" ++// CHECK-V6M-LIBSTDCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-LIBSTDCXX-SAME: "--target2=rel" "-o" "a.out" + + // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \ +@@ -120,8 +120,8 @@ + // CHECK-V6M-LIBCXX-USR: "{{[^"]*}}-Bstatic" + // CHECK-V6M-LIBCXX-USR-SAME: "-L{{[^"]*}}{{[/\\]+}}baremetal_cxx_sysroot{{[/\\]+}}lib" + // CHECK-V6M-LIBCXX-USR-SAME: "-lc++" "-lm" +-// CHECK-V6M-LIBCXX-USR-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-V6M-LIBCXX-USR-SAME: "-lc" ++// CHECK-V6M-LIBCXX-USR-SAME: "{{[^"]*}}libclang_rt.builtins.a" + + // RUN: %clangxx --target=arm-none-eabi -v 2>&1 \ + // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL +@@ -208,8 +208,8 @@ + // CHECK-RV64-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV64-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for" + // CHECK-RV64-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib" +-// CHECK-RV64-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-SAME: "-lc" ++// CHECK-RV64-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-SAME: "-X" "-o" "{{.*}}.tmp.out" + + // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \ +@@ -219,8 +219,8 @@ + // CHECK-RV64-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV64-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib" + // CHECK-RV64-DEFAULTCXX-SAME: "-lc++" "-lm" +-// CHECK-RV64-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-DEFAULTCXX-SAME: "-lc" ++// CHECK-RV64-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-DEFAULTCXX-SAME: "-X" "-o" "a.out" + + // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \ +@@ -233,8 +233,8 @@ + // CHECK-RV64-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV64-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib" + // CHECK-RV64-LIBCXX-SAME: "-lc++" "-lm" +-// CHECK-RV64-LIBCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-LIBCXX-SAME: "-lc" ++// CHECK-RV64-LIBCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-LIBCXX-SAME: "-X" "-o" "a.out" + + // RUN: %clangxx %s -### 2>&1 --target=riscv64-unknown-elf \ +@@ -247,8 +247,8 @@ + // CHECK-RV64-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV64-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib" + // CHECK-RV64-LIBSTDCXX-SAME: "-lstdc++" "-lm" +-// CHECK-RV64-LIBSTDCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-LIBSTDCXX-SAME: "-lc" ++// CHECK-RV64-LIBSTDCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV64-LIBSTDCXX-SAME: "-X" "-o" "a.out" + + // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \ +@@ -264,8 +264,8 @@ + // CHECK-RV32-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV32-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for" + // CHECK-RV32-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib" +-// CHECK-RV32-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV32-SAME: "-lc" ++// CHECK-RV32-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV32-SAME: "-X" "-o" "a.out" + + // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \ +@@ -275,8 +275,8 @@ + // CHECK-RV32-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV32-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib" + // CHECK-RV32-DEFAULTCXX-SAME: "-lc++" "-lm" +-// CHECK-RV32-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV32-DEFAULTCXX-SAME: "-lc" ++// CHECK-RV32-DEFAULTCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-RV32-DEFAULTCXX-SAME: "-X" "-o" "a.out" + + // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \ +@@ -301,9 +301,9 @@ + // CHECK-RV32-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}8.0.1" + // CHECK-RV32-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-RV32-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib" +-// CHECK-RV32-LIBSTDCXX-SAME: "-lstdc++" "-lm" ++// CHECK-RV32-LIBSTDCXX-SAME: "-lstdc++" "-lm" "-lc" + // CHECK-RV32-LIBSTDCXX-SAME: "{{[^"]*}}libclang_rt.builtins.a" +-// CHECK-RV32-LIBSTDCXX-SAME: "-lc" "-X" "-o" "a.out" ++// CHECK-RV32-LIBSTDCXX-SAME: "-X" "-o" "a.out" + + // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \ + // RUN: -nostdlibinc -nobuiltininc \ +@@ -425,8 +425,8 @@ + // CHECK-PPCEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include" + // CHECK-PPCEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-PPCEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib" +-// CHECK-PPCEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPCEABI-SAME: "-lc" ++// CHECK-PPCEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPCEABI-SAME: "-o" "a.out" + + // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64-unknown-eabi 2>&1 \ +@@ -439,8 +439,8 @@ + // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include" + // CHECK-PPC64EABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-PPC64EABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib" +-// CHECK-PPC64EABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPC64EABI-SAME: "-lc" ++// CHECK-PPC64EABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPC64EABI-SAME: "-o" "a.out" + + // RUN: %clang -no-canonical-prefixes %s -### --target=powerpcle-unknown-eabi 2>&1 \ +@@ -453,8 +453,8 @@ + // CHECK-PPCLEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include" + // CHECK-PPCLEEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-PPCLEEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib" +-// CHECK-PPCLEEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPCLEEABI-SAME: "-lc" ++// CHECK-PPCLEEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPCLEEABI-SAME: "-o" "a.out" + + // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64le-unknown-eabi 2>&1 \ +@@ -467,8 +467,8 @@ + // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include" + // CHECK-PPC64LEEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-PPC64LEEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib" +-// CHECK-PPC64LEEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPC64LEEABI-SAME: "-lc" ++// CHECK-PPC64LEEABI-SAME: "{{[^"]*}}libclang_rt.builtins.a" + // CHECK-PPC64LEEABI-SAME: "-o" "a.out" + + // Check that compiler-rt library without the arch filename suffix will -- 2.47.0 From 59f5919a20d5bbec141b9d5a60a6fa00c00f1b01 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy <66017160+voltur01@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:00:23 +0000 Subject: [PATCH 117/138] Clarify license for patch files (#611) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad7e865a..062d55c7 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,12 @@ picolibc | https://github.com/picolibc/picolibc ## License -Content of this repository is licensed under Apache-2.0. See -[LICENSE.txt](LICENSE.txt). +Content of this repository is licensed under Apache-2.0, see +[LICENSE.txt](LICENSE.txt). Individual patch files under the +[patches](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/tree/main/patches) +folder may contain code under the upstream project license, if they are +cherry-picks of upstream commits into the LLVM Embedded Toolchain for Arm +release branches, see corresponding pull requests for references. The resulting binaries are covered under their respective open source licenses, see component links above. From 8cfc242436c95e2f0d469c9b820bd9bdaa9ebbe9 Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Fri, 20 Dec 2024 15:54:09 +0000 Subject: [PATCH 118/138] Reinstate armv4t and armv5te compiler_rt and libcxx tests Pull request #109628 automatically turned on frame pointers for leaf functions in Clang when frame pointers are enabled. This triggered a latent bug in picolibc for armv4t and armv5te, which consequentially broke our tests for them. There is currently a pull request that fixes this bug (https://github.com/picolibc/picolibc/pull/897), but we don't have to wait for this to merge to reinstate the tests, because we recently changed the behaviour of Clang to by default omit frame pointers altogether (https://github.com/llvm/llvm-project/pull/117140), and that is how picolibc is built now. In general the advice is that you shouldn't build AArch32 targets with frame pointers enabled for various reasons. --- arm-multilib/json/variants/armv4t.json | 8 ++++---- arm-multilib/json/variants/armv5te.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arm-multilib/json/variants/armv4t.json b/arm-multilib/json/variants/armv4t.json index 63a07866..83a4553d 100644 --- a/arm-multilib/json/variants/armv4t.json +++ b/arm-multilib/json/variants/armv4t.json @@ -21,9 +21,9 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "minsize", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", - "ENABLE_COMPILER_RT_TESTS": "OFF", - "ENABLE_LIBCXX_TESTS": "OFF" + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" }, "newlib": { "ENABLE_CXX_LIBS": "ON", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv5te.json b/arm-multilib/json/variants/armv5te.json index 76f67f35..55c7b4a1 100644 --- a/arm-multilib/json/variants/armv5te.json +++ b/arm-multilib/json/variants/armv5te.json @@ -21,9 +21,9 @@ "picolibc": { "PICOLIBC_BUILD_TYPE": "minsize", "ENABLE_CXX_LIBS": "ON", - "ENABLE_LIBC_TESTS": "OFF", - "ENABLE_COMPILER_RT_TESTS": "OFF", - "ENABLE_LIBCXX_TESTS": "OFF" + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" }, "newlib": { "ENABLE_CXX_LIBS": "ON", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} From 4826680bfdc00f3a8350f46b39eec0ad2b93a45c Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Thu, 2 Jan 2025 11:50:23 +0000 Subject: [PATCH 119/138] Update the patch file with upstream changes of SelectionDAG (#617) --- ...-LDM-STM-inlining-preference-for-v7m.patch | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch index b0b72487..7c666bc1 100644 --- a/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch +++ b/patches/llvm-project-perf/0002-ARM-Codegen-Set-LDM-STM-inlining-preference-for-v7m.patch @@ -1,14 +1,8 @@ -From 8aa999e52ef03be7d8c05f4bd151d7df60d17e8f Mon Sep 17 00:00:00 2001 -From: Scott Douglass -Date: Tue, 13 Aug 2024 10:55:51 +0100 -Subject: [PATCH] [ARM][CodeGen]Prefer MEMCPY LDM/STM inlining for v7-m +From 411bab1ff439215c060127b6a5188ed0c9ed5d65 Mon Sep 17 00:00:00 2001 +From: Vrukesh V Panse +Date: Thu, 2 Jan 2025 10:29:56 +0000 +Subject: [NFC]: Update the patch file with upstream changes of SelectionDAG -This patch changes the behaviour of memcpy inlining on v7m targets. -The old behaviour was to inline memcpys with LDM/STM instructions. -Alternatively, using LD/ST instructions for memcpy inlining allowed -for performance gains of 1% to 2% on selected benchmarks. - -Co-authored-by: Nashe Mncube --- llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 120 +++++++++++++++ llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 6 + @@ -17,7 +11,7 @@ Co-authored-by: Nashe Mncube create mode 100644 llvm/test/CodeGen/ARM/memcpy-v7m.ll diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp -index e7ea10ff971a..09ed4ab219a1 100644 +index a39487c318f8..ca8de16e66c4 100644 --- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp +++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp @@ -30,6 +30,10 @@ cl::opt EnableMemtransferTPLoop( @@ -28,10 +22,10 @@ index e7ea10ff971a..09ed4ab219a1 100644 + "enable-inline-memcpy-ld-st", cl::init(false), cl::Hidden, + cl::desc("Inline memcpy with LD/ST instructions.")); + - // Emit, if possible, a specialized version of the given Libcall. Typically this - // means selecting the appropriately aligned version, but we also convert memset - // of 0 into memclr. -@@ -136,6 +140,118 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( + bool ARMSelectionDAGInfo::isTargetMemoryOpcode(unsigned Opcode) const { + return Opcode >= ARMISD::FIRST_MEMORY_OPCODE && + Opcode <= ARMISD::LAST_MEMORY_OPCODE; +@@ -141,6 +145,118 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall( return CallResult.second; } @@ -150,7 +144,7 @@ index e7ea10ff971a..09ed4ab219a1 100644 static bool shouldGenerateInlineTPLoop(const ARMSubtarget &Subtarget, const SelectionDAG &DAG, ConstantSDNode *ConstantSize, -@@ -190,6 +306,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( +@@ -195,6 +311,10 @@ SDValue ARMSelectionDAGInfo::EmitTargetCodeForMemcpy( return EmitSpecializedLibcall(DAG, dl, Chain, Dst, Src, Size, Alignment.value(), RTLIB::MEMCPY); @@ -162,10 +156,10 @@ index e7ea10ff971a..09ed4ab219a1 100644 unsigned NumMemOps = SizeVal >> 2; unsigned EmittedNumMemOps = 0; diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h -index 275b1c0f8dc0..6ff422c15b12 100644 +index d68150e66567..bdc9bbd697a3 100644 --- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h -@@ -44,6 +44,12 @@ public: +@@ -46,6 +46,12 @@ public: MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const override; @@ -180,7 +174,7 @@ index 275b1c0f8dc0..6ff422c15b12 100644 SDValue Dst, SDValue Src, SDValue Size, diff --git a/llvm/test/CodeGen/ARM/memcpy-v7m.ll b/llvm/test/CodeGen/ARM/memcpy-v7m.ll new file mode 100644 -index 000000000000..12f74c04087e +index 000000000000..e549958494dc --- /dev/null +++ b/llvm/test/CodeGen/ARM/memcpy-v7m.ll @@ -0,0 +1,161 @@ From 89a9ee304ab2d9ca544f1b57fc5767946708d591 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Fri, 3 Jan 2025 11:49:24 +0000 Subject: [PATCH 120/138] Update newlib to 4.5.0 (#618) --- patches/newlib/0001-Enable-newlib-build.patch | 307 +++--------------- versions.json | 2 +- 2 files changed, 42 insertions(+), 267 deletions(-) diff --git a/patches/newlib/0001-Enable-newlib-build.patch b/patches/newlib/0001-Enable-newlib-build.patch index e70a97a7..87ac4195 100644 --- a/patches/newlib/0001-Enable-newlib-build.patch +++ b/patches/newlib/0001-Enable-newlib-build.patch @@ -1,34 +1,24 @@ -From 0e1475e5112b986ef5d9caee23dac554c749c54b Mon Sep 17 00:00:00 2001 -From: David Candler -Date: Thu, 28 Nov 2024 15:31:35 +0000 -Subject: [PATCH] Enable newlib build +From ff1718e7c6fdb4cace44c90213a00bc6db6450f5 Mon Sep 17 00:00:00 2001 +From: Volodymyr Turanskyy +Date: Thu, 2 Jan 2025 16:23:27 +0000 +Subject: [PATCH] Update patch for newlib-4.5.0 tag +Change-Id: Iec24f4305ad35a3a6df1672bb14555bf81249130 --- - libgloss/aarch64/syscalls.c | 6 ++ - libgloss/arm/cpu-init/rdimon-aem.S | 107 ++++++++++++------------ - libgloss/arm/crt0.S | 2 +- - libgloss/arm/linux-crt0.c | 2 +- - libgloss/arm/syscalls.c | 6 +- - libgloss/arm/trap.S | 2 +- - libgloss/libnosys/configure | 2 +- - newlib/libc/include/sys/features.h | 2 + - newlib/libc/machine/aarch64/memchr.S | 6 +- - newlib/libc/machine/aarch64/strchr.S | 6 +- - newlib/libc/machine/aarch64/strchrnul.S | 6 +- - newlib/libc/machine/aarch64/strrchr.S | 10 +-- - newlib/libc/stdlib/aligned_alloc.c | 1 + - newlib/libc/sys/arm/crt0.S | 2 +- - newlib/libc/sys/arm/trap.S | 2 +- - newlib/libm/machine/arm/sf_ceil.c | 2 +- - newlib/libm/machine/arm/sf_floor.c | 2 +- - newlib/libm/machine/arm/sf_nearbyint.c | 2 +- - newlib/libm/machine/arm/sf_rint.c | 2 +- - newlib/libm/machine/arm/sf_round.c | 2 +- - newlib/libm/machine/arm/sf_trunc.c | 2 +- - 21 files changed, 92 insertions(+), 82 deletions(-) + libgloss/aarch64/syscalls.c | 6 ++ + libgloss/arm/cpu-init/rdimon-aem.S | 107 +++++++++++++++-------------- + libgloss/arm/crt0.S | 2 +- + libgloss/arm/linux-crt0.c | 2 +- + libgloss/arm/syscalls.c | 6 +- + libgloss/arm/trap.S | 2 +- + newlib/libc/include/sys/features.h | 2 + + newlib/libc/machine/arm/setjmp.S | 4 +- + newlib/libc/sys/arm/crt0.S | 2 +- + newlib/libc/sys/arm/trap.S | 2 +- + 10 files changed, 72 insertions(+), 63 deletions(-) diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c -index 7343cc61f..2c4b63c17 100644 +index 5b4071893..cfe1d6d23 100644 --- a/libgloss/aarch64/syscalls.c +++ b/libgloss/aarch64/syscalls.c @@ -172,6 +172,12 @@ newslot (void) @@ -325,10 +315,10 @@ index 95b86e4d4..b91034ae6 100644 movt r9, #0xff0f and r8, r8, r9 diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S -index 8490bde2f..8b85b28f4 100644 +index 9ff0e6323..b9e768007 100644 --- a/libgloss/arm/crt0.S +++ b/libgloss/arm/crt0.S -@@ -565,7 +565,7 @@ change_back: +@@ -566,7 +566,7 @@ change_back: /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ @@ -351,7 +341,7 @@ index 6b2d62a9b..000a2c728 100644 #endif { diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c -index fc394f94b..0b3287df4 100644 +index 710a741ee..9e710b09a 100644 --- a/libgloss/arm/syscalls.c +++ b/libgloss/arm/syscalls.c @@ -180,7 +180,7 @@ initialise_monitor_handles (void) @@ -393,21 +383,8 @@ index 845ad0173..2056c2adf 100644 .global __rt_stkovf_split_big .global __rt_stkovf_split_small -diff --git a/libgloss/libnosys/configure b/libgloss/libnosys/configure -index 7c23c7a0a..2fc584169 100755 ---- a/libgloss/libnosys/configure -+++ b/libgloss/libnosys/configure -@@ -2058,7 +2058,7 @@ case "${target}" in - esac - - case "${target}" in -- *-*-elf) -+ *-*-elf|*-*-eabi*) - $as_echo "#define HAVE_ELF 1" >>confdefs.h - - diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h -index 218807178..b86caeaff 100644 +index 325acdf5f..12cb6465b 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -27,6 +27,8 @@ extern "C" { @@ -419,152 +396,28 @@ index 218807178..b86caeaff 100644 /* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */ #ifndef __GNUC_PREREQ # if defined __GNUC__ && defined __GNUC_MINOR__ -diff --git a/newlib/libc/machine/aarch64/memchr.S b/newlib/libc/machine/aarch64/memchr.S -index 53f5d6bc0..81fcecccd 100644 ---- a/newlib/libc/machine/aarch64/memchr.S -+++ b/newlib/libc/machine/aarch64/memchr.S -@@ -110,7 +110,7 @@ def_fn memchr - and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b - addp vend.16b, vhas_chr1.16b, vhas_chr2.16b /* 256->128 */ - addp vend.16b, vend.16b, vend.16b /* 128->64 */ -- mov synd, vend.2d[0] -+ mov synd, vend.d[0] - /* Clear the soff*2 lower bits */ - lsl tmp, soff, #1 - lsr synd, synd, tmp -@@ -130,7 +130,7 @@ def_fn memchr - /* Use a fast check for the termination condition */ - orr vend.16b, vhas_chr1.16b, vhas_chr2.16b - addp vend.2d, vend.2d, vend.2d -- mov synd, vend.2d[0] -+ mov synd, vend.d[0] - /* We're not out of data, loop if we haven't found the character */ - cbz synd, .Lloop - -@@ -140,7 +140,7 @@ def_fn memchr - and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b - addp vend.16b, vhas_chr1.16b, vhas_chr2.16b /* 256->128 */ - addp vend.16b, vend.16b, vend.16b /* 128->64 */ -- mov synd, vend.2d[0] -+ mov synd, vend.d[0] - /* Only do the clear for the last possible block */ - b.hi .Ltail - -diff --git a/newlib/libc/machine/aarch64/strchr.S b/newlib/libc/machine/aarch64/strchr.S -index 2448dbc7d..706107836 100644 ---- a/newlib/libc/machine/aarch64/strchr.S -+++ b/newlib/libc/machine/aarch64/strchr.S -@@ -117,7 +117,7 @@ def_fn strchr - addp vend1.16b, vend1.16b, vend2.16b // 128->64 - lsr tmp1, tmp3, tmp1 - -- mov tmp3, vend1.2d[0] -+ mov tmp3, vend1.d[0] - bic tmp1, tmp3, tmp1 // Mask padding bits. - cbnz tmp1, .Ltail - -@@ -132,7 +132,7 @@ def_fn strchr - orr vend2.16b, vhas_nul2.16b, vhas_chr2.16b - orr vend1.16b, vend1.16b, vend2.16b - addp vend1.2d, vend1.2d, vend1.2d -- mov tmp1, vend1.2d[0] -+ mov tmp1, vend1.d[0] - cbz tmp1, .Lloop - - /* Termination condition found. Now need to establish exactly why -@@ -146,7 +146,7 @@ def_fn strchr - addp vend1.16b, vend1.16b, vend2.16b // 256->128 - addp vend1.16b, vend1.16b, vend2.16b // 128->64 - -- mov tmp1, vend1.2d[0] -+ mov tmp1, vend1.d[0] - .Ltail: - /* Count the trailing zeros, by bit reversing... */ - rbit tmp1, tmp1 -diff --git a/newlib/libc/machine/aarch64/strchrnul.S b/newlib/libc/machine/aarch64/strchrnul.S -index a0ac13b7f..fd2002f0d 100644 ---- a/newlib/libc/machine/aarch64/strchrnul.S -+++ b/newlib/libc/machine/aarch64/strchrnul.S -@@ -109,7 +109,7 @@ def_fn strchrnul - addp vend1.16b, vend1.16b, vend1.16b // 128->64 - lsr tmp1, tmp3, tmp1 - -- mov tmp3, vend1.2d[0] -+ mov tmp3, vend1.d[0] - bic tmp1, tmp3, tmp1 // Mask padding bits. - cbnz tmp1, .Ltail - -@@ -124,7 +124,7 @@ def_fn strchrnul - orr vhas_chr2.16b, vhas_nul2.16b, vhas_chr2.16b - orr vend1.16b, vhas_chr1.16b, vhas_chr2.16b - addp vend1.2d, vend1.2d, vend1.2d -- mov tmp1, vend1.2d[0] -+ mov tmp1, vend1.d[0] - cbz tmp1, .Lloop - - /* Termination condition found. Now need to establish exactly why -@@ -134,7 +134,7 @@ def_fn strchrnul - addp vend1.16b, vhas_chr1.16b, vhas_chr2.16b // 256->128 - addp vend1.16b, vend1.16b, vend1.16b // 128->64 - -- mov tmp1, vend1.2d[0] -+ mov tmp1, vend1.d[0] - .Ltail: - /* Count the trailing zeros, by bit reversing... */ - rbit tmp1, tmp1 -diff --git a/newlib/libc/machine/aarch64/strrchr.S b/newlib/libc/machine/aarch64/strrchr.S -index d64fc09b1..1b6f07562 100644 ---- a/newlib/libc/machine/aarch64/strrchr.S -+++ b/newlib/libc/machine/aarch64/strrchr.S -@@ -120,10 +120,10 @@ def_fn strrchr - addp vhas_chr1.16b, vhas_chr1.16b, vhas_chr2.16b // 256->128 - addp vhas_nul1.16b, vhas_nul1.16b, vhas_nul1.16b // 128->64 - addp vhas_chr1.16b, vhas_chr1.16b, vhas_chr1.16b // 128->64 -- mov nul_match, vhas_nul1.2d[0] -+ mov nul_match, vhas_nul1.d[0] - lsl tmp1, tmp1, #1 - mov const_m1, #~0 -- mov chr_match, vhas_chr1.2d[0] -+ mov chr_match, vhas_chr1.d[0] - lsr tmp3, const_m1, tmp1 - - bic nul_match, nul_match, tmp3 // Mask padding bits. -@@ -146,15 +146,15 @@ def_fn strrchr - addp vhas_chr1.16b, vhas_chr1.16b, vhas_chr2.16b // 256->128 - addp vend1.16b, vend1.16b, vend1.16b // 128->64 - addp vhas_chr1.16b, vhas_chr1.16b, vhas_chr1.16b // 128->64 -- mov nul_match, vend1.2d[0] -- mov chr_match, vhas_chr1.2d[0] -+ mov nul_match, vend1.d[0] -+ mov chr_match, vhas_chr1.d[0] - cbz nul_match, .Lloop - - and vhas_nul1.16b, vhas_nul1.16b, vrepmask_0.16b - and vhas_nul2.16b, vhas_nul2.16b, vrepmask_0.16b - addp vhas_nul1.16b, vhas_nul1.16b, vhas_nul2.16b - addp vhas_nul1.16b, vhas_nul1.16b, vhas_nul1.16b -- mov nul_match, vhas_nul1.2d[0] -+ mov nul_match, vhas_nul1.d[0] - - .Ltail: - /* Work out exactly where the string ends. */ -diff --git a/newlib/libc/stdlib/aligned_alloc.c b/newlib/libc/stdlib/aligned_alloc.c -index feb22c24b..06b3883cf 100644 ---- a/newlib/libc/stdlib/aligned_alloc.c -+++ b/newlib/libc/stdlib/aligned_alloc.c -@@ -28,6 +28,7 @@ - - #include - #include -+#include - - void * - aligned_alloc (size_t align, size_t size) +diff --git a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S +index 0070f17cd..a53f7918e 100644 +--- a/newlib/libc/machine/arm/setjmp.S ++++ b/newlib/libc/machine/arm/setjmp.S +@@ -78,10 +78,10 @@ + covers all the cases we need in this file for hardware + floating-point and should be compatible with all required FPUs + that we need to support. */ +-# if __ARM_FP ++# if __ARM_FP && !__clang__ + .fpu vfpxd + # endif +-# if __ARM_FEATURE_MVE ++# if __ARM_FEATURE_MVE && !__clang__ + .arch_extension mve + # endif + #endif diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S -index 5e677a23c..6faf74096 100644 +index dae0f0465..51e86d549 100644 --- a/newlib/libc/sys/arm/crt0.S +++ b/newlib/libc/sys/arm/crt0.S -@@ -556,7 +556,7 @@ change_back: +@@ -557,7 +557,7 @@ change_back: /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ @@ -586,84 +439,6 @@ index 681b3dbe0..8a49f39f3 100644 .global __rt_stkovf_split_big .global __rt_stkovf_split_small -diff --git a/newlib/libm/machine/arm/sf_ceil.c b/newlib/libm/machine/arm/sf_ceil.c -index b6efbff0b..44fdf834a 100644 ---- a/newlib/libm/machine/arm/sf_ceil.c -+++ b/newlib/libm/machine/arm/sf_ceil.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -diff --git a/newlib/libm/machine/arm/sf_floor.c b/newlib/libm/machine/arm/sf_floor.c -index 7bc95808c..44c38c42c 100644 ---- a/newlib/libm/machine/arm/sf_floor.c -+++ b/newlib/libm/machine/arm/sf_floor.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -diff --git a/newlib/libm/machine/arm/sf_nearbyint.c b/newlib/libm/machine/arm/sf_nearbyint.c -index c70d84442..126673e97 100644 ---- a/newlib/libm/machine/arm/sf_nearbyint.c -+++ b/newlib/libm/machine/arm/sf_nearbyint.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -diff --git a/newlib/libm/machine/arm/sf_rint.c b/newlib/libm/machine/arm/sf_rint.c -index d9c383a7e..5def21009 100644 ---- a/newlib/libm/machine/arm/sf_rint.c -+++ b/newlib/libm/machine/arm/sf_rint.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -diff --git a/newlib/libm/machine/arm/sf_round.c b/newlib/libm/machine/arm/sf_round.c -index 232fc0848..88c53ba13 100644 ---- a/newlib/libm/machine/arm/sf_round.c -+++ b/newlib/libm/machine/arm/sf_round.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -diff --git a/newlib/libm/machine/arm/sf_trunc.c b/newlib/libm/machine/arm/sf_trunc.c -index 64e4aeb9a..c08fa6fed 100644 ---- a/newlib/libm/machine/arm/sf_trunc.c -+++ b/newlib/libm/machine/arm/sf_trunc.c -@@ -24,7 +24,7 @@ - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - --#if __ARM_ARCH >= 8 && !defined (__SOFTFP__) -+#if __ARM_ARCH >= 8 && (__ARM_FP & 0x4) && !defined (__SOFTFP__) - #include - - float -- -2.43.0 +2.47.1 diff --git a/versions.json b/versions.json index 95b25230..c3ebe78b 100644 --- a/versions.json +++ b/versions.json @@ -17,7 +17,7 @@ }, "newlib": { "tagType": "tag", - "tag": "newlib-4.1.0" + "tag": "newlib-4.5.0" } } } From 32e520172b4ccc324460b9fff0a04662432382fd Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 6 Jan 2025 15:21:21 +0000 Subject: [PATCH 121/138] Turn AArch64 big endian variants into strictly aligned (#607) We've decided to have just two variants here: one with and one without RTTI and exceptions. We will not have variants across the strict aligment dimension. And since a strictly aligned variant is more compatible than one that's not, this change is made. --- arm-multilib/json/variants/aarch64a_be.json | 2 +- arm-multilib/json/variants/aarch64a_be_exn_rtti.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-multilib/json/variants/aarch64a_be.json b/arm-multilib/json/variants/aarch64a_be.json index 429c1c65..eba9806c 100644 --- a/arm-multilib/json/variants/aarch64a_be.json +++ b/arm-multilib/json/variants/aarch64a_be.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_be", - "COMPILE_FLAGS": "-march=armv8-a -mbig-endian", + "COMPILE_FLAGS": "-march=armv8-a -mbig-endian -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "fvp", diff --git a/arm-multilib/json/variants/aarch64a_be_exn_rtti.json b/arm-multilib/json/variants/aarch64a_be_exn_rtti.json index e0471393..33b77da5 100644 --- a/arm-multilib/json/variants/aarch64a_be_exn_rtti.json +++ b/arm-multilib/json/variants/aarch64a_be_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "aarch64a", "VARIANT": "aarch64a_be_exn_rtti", - "COMPILE_FLAGS": "-march=armv8-a -mbig-endian", + "COMPILE_FLAGS": "-march=armv8-a -mbig-endian -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "fvp", From c38433ac253632fe553e0c4c8d8bcfeffeda7797 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Tue, 7 Jan 2025 11:32:14 +0000 Subject: [PATCH 122/138] Update newlib patch to remove dependency on the makeinfo tool (#619) --- patches/newlib/0001-Enable-newlib-build.patch | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/patches/newlib/0001-Enable-newlib-build.patch b/patches/newlib/0001-Enable-newlib-build.patch index 87ac4195..244b923d 100644 --- a/patches/newlib/0001-Enable-newlib-build.patch +++ b/patches/newlib/0001-Enable-newlib-build.patch @@ -1,10 +1,11 @@ -From ff1718e7c6fdb4cace44c90213a00bc6db6450f5 Mon Sep 17 00:00:00 2001 +From 928f527624c6cbc1d897c5f36309981971f47873 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Thu, 2 Jan 2025 16:23:27 +0000 Subject: [PATCH] Update patch for newlib-4.5.0 tag Change-Id: Iec24f4305ad35a3a6df1672bb14555bf81249130 --- + libgloss/Makefile.in | 2 +- libgloss/aarch64/syscalls.c | 6 ++ libgloss/arm/cpu-init/rdimon-aem.S | 107 +++++++++++++++-------------- libgloss/arm/crt0.S | 2 +- @@ -15,8 +16,21 @@ Change-Id: Iec24f4305ad35a3a6df1672bb14555bf81249130 newlib/libc/machine/arm/setjmp.S | 4 +- newlib/libc/sys/arm/crt0.S | 2 +- newlib/libc/sys/arm/trap.S | 2 +- - 10 files changed, 72 insertions(+), 63 deletions(-) + 11 files changed, 73 insertions(+), 64 deletions(-) +diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in +index 54a00614d..be1450749 100644 +--- a/libgloss/Makefile.in ++++ b/libgloss/Makefile.in +@@ -1864,7 +1864,7 @@ AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) + am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) + am__v_texidevnull_0 = > /dev/null + am__v_texidevnull_1 = +-INFO_DEPS = $(srcdir)/doc/porting.info ++INFO_DEPS = + am__TEXINFO_TEX_DIR = $(srcdir)/../texinfo + DVIS = doc/porting.dvi + PDFS = doc/porting.pdf diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c index 5b4071893..cfe1d6d23 100644 --- a/libgloss/aarch64/syscalls.c From 1c3c1914428505ca88b6df20a82a403d76236854 Mon Sep 17 00:00:00 2001 From: Vrukesh Panse Date: Tue, 7 Jan 2025 15:02:44 +0000 Subject: [PATCH 123/138] =?UTF-8?q?[NFC]:=20Remove=20dead=20code=20from=20?= =?UTF-8?q?newlib=20env=20configuration=20in=20arm-runtimes=E2=80=A6=20(#6?= =?UTF-8?q?21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …/CMakeLists.txt --- arm-runtimes/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 97193d14..b7929dfa 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -463,7 +463,6 @@ if(C_LIBRARY STREQUAL newlib) "CC_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang -target ${target_triple} -ffreestanding" "CXX_FOR_TARGET=${LLVM_BINARY_DIR}/bin/clang++ -target ${target_triple} -ffreestanding" "AR_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ar" - "AS_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-as" "NM_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-nm" "OBJDUMP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-objdump" "RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib" From a4e01e0c408a3672c264812ef410ecde779290cd Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Thu, 9 Jan 2025 10:58:44 +0000 Subject: [PATCH 124/138] Add tests for AArch64 A-profile big endian library selection (#622) The tests check if the same variant is chosen with or without `-mno-unaligned-access`. For AArch64 A-profile big endian we provide only strictly aligned libraries. --- test/multilib/aarch64.test | 43 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/test/multilib/aarch64.test b/test/multilib/aarch64.test index 9bd19c73..95e94907 100644 --- a/test/multilib/aarch64.test +++ b/test/multilib/aarch64.test @@ -11,11 +11,50 @@ # AARCH64-EXNRTTI: aarch64-none-elf/aarch64a_exn_rtti{{$}} # AARCH64-EXNRTTI-EMPTY: -# + # RUN: %clang -print-multi-directory --target=aarch64-none-elf -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 # RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv8.5-a+nodotprod -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 # RUN: %clang -print-multi-directory --target=aarch64-none-elf -march=armv9.5-a+sve2+sme2 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 # RUN: %clang -print-multi-directory --target=aarch64-none-elf -mcpu=cortex-a57+fp16 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64 -# + # AARCH64: aarch64-none-elf/aarch64a{{$}} # AARCH64-EMPTY: + + +# Big endian + +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8-a | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8-a+fp16 | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.1-a | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.5-a+nodotprod | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.9-a | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a+sve2+sme2 | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57 | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57+fp16 | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8-a -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8-a+fp16 -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.1-a -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.5-a+nodotprod -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.9-a -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a+sve2+sme2 -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57 -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57+fp16 -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE-EXNRTTI + +# AARCH64-BE-EXNRTTI: aarch64-none-elf/aarch64a_be_exn_rtti{{$}} +# AARCH64-BE-EXNRTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.5-a+nodotprod -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a+sve2+sme2 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57+fp16 -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv8.5-a+nodotprod -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -march=armv9.5-a+sve2+sme2 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE +# RUN: %clang -print-multi-directory --target=aarch64-none-elf -mbig-endian -mcpu=cortex-a57+fp16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=AARCH64-BE + +# AARCH64-BE: aarch64-none-elf/aarch64a_be{{$}} +# AARCH64-BE-EMPTY: From 20bce4210344ee075abb70a39e36526e88f104ee Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Thu, 9 Jan 2025 10:59:09 +0000 Subject: [PATCH 125/138] Add AArch32 base variants with strict alignment (#605) This patch adds AArch32 base variants with `-mno-unaligned-access`. Base variants are the set of libraries that provide the most compatible functionality. As a consequence, they are built with strict alignment in order to work nicely with client code that is compiled with or without strict alignment. --- arm-multilib/json/multilib.json | 158 +++++++++++--- .../json/variants/armv6m_soft_nofp.json | 2 +- .../variants/armv6m_soft_nofp_exn_rtti.json | 2 +- .../armv6m_soft_nofp_exn_rtti_unaligned.json | 40 ++++ .../variants/armv6m_soft_nofp_unaligned.json | 40 ++++ .../json/variants/armv7a_hard_vfpv3_d16.json | 4 +- .../armv7a_hard_vfpv3_d16_exn_rtti.json | 4 +- ...v7a_hard_vfpv3_d16_exn_rtti_unaligned.json | 41 ++++ .../armv7a_hard_vfpv3_d16_unaligned.json | 41 ++++ .../json/variants/armv7a_soft_nofp.json | 4 +- .../variants/armv7a_soft_nofp_exn_rtti.json | 4 +- ... armv7a_soft_nofp_exn_rtti_unaligned.json} | 4 +- ...n.json => armv7a_soft_nofp_unaligned.json} | 4 +- .../json/variants/armv7a_soft_vfpv3_d16.json | 2 +- .../armv7a_soft_vfpv3_d16_exn_rtti.json | 4 +- ...v7a_soft_vfpv3_d16_exn_rtti_unaligned.json | 41 ++++ .../armv7a_soft_vfpv3_d16_unaligned.json | 41 ++++ .../variants/armv7m_hard_fpv4_sp_d16.json | 2 +- .../armv7m_hard_fpv4_sp_d16_exn_rtti.json | 2 +- ...m_hard_fpv4_sp_d16_exn_rtti_unaligned.json | 40 ++++ .../armv7m_hard_fpv4_sp_d16_unaligned.json | 40 ++++ .../variants/armv7m_soft_fpv4_sp_d16.json | 2 +- .../armv7m_soft_fpv4_sp_d16_exn_rtti.json | 2 +- ...m_soft_fpv4_sp_d16_exn_rtti_unaligned.json | 40 ++++ .../armv7m_soft_fpv4_sp_d16_unaligned.json | 40 ++++ .../json/variants/armv7m_soft_nofp.json | 2 +- .../variants/armv7m_soft_nofp_exn_rtti.json | 2 +- .../armv7m_soft_nofp_exn_rtti_unaligned.json | 40 ++++ .../variants/armv7m_soft_nofp_unaligned.json | 40 ++++ .../json/variants/armv7r_hard_vfpv3_d16.json | 2 +- .../armv7r_hard_vfpv3_d16_exn_rtti.json | 2 +- ...v7r_hard_vfpv3_d16_exn_rtti_unaligned.json | 41 ++++ .../armv7r_hard_vfpv3_d16_unaligned.json | 41 ++++ .../json/variants/armv7r_hard_vfpv3xd.json | 2 +- .../armv7r_hard_vfpv3xd_exn_rtti.json | 2 +- ...rmv7r_hard_vfpv3xd_exn_rtti_unaligned.json | 41 ++++ .../armv7r_hard_vfpv3xd_unaligned.json | 41 ++++ .../json/variants/armv7r_soft_nofp.json | 4 +- .../variants/armv7r_soft_nofp_exn_rtti.json | 4 +- .../armv7r_soft_nofp_exn_rtti_unaligned.json | 41 ++++ .../variants/armv7r_soft_nofp_unaligned.json | 41 ++++ .../json/variants/armv7r_soft_vfpv3xd.json | 2 +- .../armv7r_soft_vfpv3xd_exn_rtti.json | 2 +- ...rmv7r_soft_vfpv3xd_exn_rtti_unaligned.json | 41 ++++ .../armv7r_soft_vfpv3xd_unaligned.json | 41 ++++ test/multilib/armv6m.test | 18 +- test/multilib/armv7a.test | 196 ++++++++++++++---- test/multilib/armv7m.test | 86 ++++++-- test/multilib/armv7r.test | 108 ++++++++-- test/multilib/armv8a.test | 4 +- test/multilib/armv8m.main.test | 2 +- test/multilib/armv8r.test | 8 +- 52 files changed, 1308 insertions(+), 150 deletions(-) create mode 100644 arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv6m_soft_nofp_unaligned.json create mode 100644 arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7a_hard_vfpv3_d16_unaligned.json rename arm-multilib/json/variants/{armv7a_soft_nofp_strictalign_exn_rtti.json => armv7a_soft_nofp_exn_rtti_unaligned.json} (93%) rename arm-multilib/json/variants/{armv7a_soft_nofp_strictalign.json => armv7a_soft_nofp_unaligned.json} (93%) create mode 100644 arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7a_soft_vfpv3_d16_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7m_soft_nofp_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3_d16_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_hard_vfpv3xd_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_soft_nofp_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti_unaligned.json create mode 100644 arm-multilib/json/variants/armv7r_soft_vfpv3xd_unaligned.json diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 86b4e63f..95ef58d6 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -74,115 +74,205 @@ "json": "armv5te.json", "flags": "--target=armv5e-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, + { + "variant": "armv6m_soft_nofp_exn_rtti_unaligned", + "json": "armv6m_soft_nofp_exn_rtti_unaligned.json", + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none" + }, { "variant": "armv6m_soft_nofp_exn_rtti", "json": "armv6m_soft_nofp_exn_rtti.json", - "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none" + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -mno-unaligned-access" + }, + { + "variant": "armv6m_soft_nofp_unaligned", + "json": "armv6m_soft_nofp_unaligned.json", + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, { "variant": "armv6m_soft_nofp", "json": "armv6m_soft_nofp.json", - "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7a_soft_nofp_exn_rtti_unaligned", + "json": "armv7a_soft_nofp_exn_rtti_unaligned.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none" }, { "variant": "armv7a_soft_nofp_exn_rtti", "json": "armv7a_soft_nofp_exn_rtti.json", - "flags": "--target=armv7-unknown-none-eabi -mfpu=none" + "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access" }, { - "variant": "armv7a_soft_nofp", - "json": "armv7a_soft_nofp.json", + "variant": "armv7a_soft_nofp_unaligned", + "json": "armv7a_soft_nofp_unaligned.json", "flags": "--target=armv7-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, { - "variant": "armv7a_soft_nofp_strictalign_exn_rtti", - "json": "armv7a_soft_nofp_strictalign_exn_rtti.json", - "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access" + "variant": "armv7a_soft_nofp", + "json": "armv7a_soft_nofp.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access" }, { - "variant": "armv7a_soft_nofp_strictalign", - "json": "armv7a_soft_nofp_strictalign.json", - "flags": "--target=armv7-unknown-none-eabi -mfpu=none -mno-unaligned-access -fno-exceptions -fno-rtti" + "variant": "armv7a_hard_vfpv3_d16_exn_rtti_unaligned", + "json": "armv7a_hard_vfpv3_d16_exn_rtti_unaligned.json", + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16" }, { "variant": "armv7a_hard_vfpv3_d16_exn_rtti", "json": "armv7a_hard_vfpv3_d16_exn_rtti.json", - "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16" + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16 -mno-unaligned-access" + }, + { + "variant": "armv7a_hard_vfpv3_d16_unaligned", + "json": "armv7a_hard_vfpv3_d16_unaligned.json", + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" }, { "variant": "armv7a_hard_vfpv3_d16", "json": "armv7a_hard_vfpv3_d16.json", - "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + "flags": "--target=armv7-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7a_soft_vfpv3_d16_exn_rtti_unaligned", + "json": "armv7a_soft_vfpv3_d16_exn_rtti_unaligned.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16" }, { "variant": "armv7a_soft_vfpv3_d16_exn_rtti", "json": "armv7a_soft_vfpv3_d16_exn_rtti.json", - "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16" + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16 -mno-unaligned-access" + }, + { + "variant": "armv7a_soft_vfpv3_d16_unaligned", + "json": "armv7a_soft_vfpv3_d16_unaligned.json", + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" }, { "variant": "armv7a_soft_vfpv3_d16", "json": "armv7a_soft_vfpv3_d16.json", - "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + "flags": "--target=armv7-unknown-none-eabi -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7r_soft_nofp_exn_rtti_unaligned", + "json": "armv7r_soft_nofp_exn_rtti_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none" }, { "variant": "armv7r_soft_nofp_exn_rtti", "json": "armv7r_soft_nofp_exn_rtti.json", - "flags": "--target=armv7r-unknown-none-eabi -mfpu=none" + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none -mno-unaligned-access" + }, + { + "variant": "armv7r_soft_nofp_unaligned", + "json": "armv7r_soft_nofp_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, { "variant": "armv7r_soft_nofp", "json": "armv7r_soft_nofp.json", - "flags": "--target=armv7r-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + "flags": "--target=armv7r-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7r_hard_vfpv3xd_exn_rtti_unaligned", + "json": "armv7r_hard_vfpv3xd_exn_rtti_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" }, { "variant": "armv7r_hard_vfpv3xd_exn_rtti", "json": "armv7r_hard_vfpv3xd_exn_rtti.json", - "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd" + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd -mno-unaligned-access" + }, + { + "variant": "armv7r_hard_vfpv3xd_unaligned", + "json": "armv7r_hard_vfpv3xd_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti" }, { "variant": "armv7r_hard_vfpv3xd", "json": "armv7r_hard_vfpv3xd.json", - "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti" + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7r_hard_vfpv3_d16_exn_rtti_unaligned", + "json": "armv7r_hard_vfpv3_d16_exn_rtti_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" }, { "variant": "armv7r_hard_vfpv3_d16_exn_rtti", "json": "armv7r_hard_vfpv3_d16_exn_rtti.json", - "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16" + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16 -mno-unaligned-access" + }, + { + "variant": "armv7r_hard_vfpv3_d16_unaligned", + "json": "armv7r_hard_vfpv3_d16_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" }, { "variant": "armv7r_hard_vfpv3_d16", "json": "armv7r_hard_vfpv3_d16.json", - "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti" + "flags": "--target=armv7r-unknown-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7r_soft_vfpv3xd_exn_rtti_unaligned", + "json": "armv7r_soft_vfpv3xd_exn_rtti_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd" }, { "variant": "armv7r_soft_vfpv3xd_exn_rtti", "json": "armv7r_soft_vfpv3xd_exn_rtti.json", - "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd" + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd -mno-unaligned-access" + }, + { + "variant": "armv7r_soft_vfpv3xd_unaligned", + "json": "armv7r_soft_vfpv3xd_unaligned.json", + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd -fno-exceptions -fno-rtti" }, { "variant": "armv7r_soft_vfpv3xd", "json": "armv7r_soft_vfpv3xd.json", - "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd -fno-exceptions -fno-rtti" + "flags": "--target=armv7r-unknown-none-eabi -mfpu=vfpv3xd -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned", + "json": "armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16" }, { "variant": "armv7m_soft_fpv4_sp_d16_exn_rtti", "json": "armv7m_soft_fpv4_sp_d16_exn_rtti.json", - "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16" + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16 -mno-unaligned-access" + }, + { + "variant": "armv7m_soft_fpv4_sp_d16_unaligned", + "json": "armv7m_soft_fpv4_sp_d16_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" }, { "variant": "armv7m_soft_fpv4_sp_d16", "json": "armv7m_soft_fpv4_sp_d16.json", - "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti -mno-unaligned-access" + }, + { + "variant": "armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned", + "json": "armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16" }, { "variant": "armv7m_hard_fpv4_sp_d16_exn_rtti", "json": "armv7m_hard_fpv4_sp_d16_exn_rtti.json", - "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16" + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16 -mno-unaligned-access" + }, + { + "variant": "armv7m_hard_fpv4_sp_d16_unaligned", + "json": "armv7m_hard_fpv4_sp_d16_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" }, { "variant": "armv7m_hard_fpv4_sp_d16", "json": "armv7m_hard_fpv4_sp_d16.json", - "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti" + "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti -mno-unaligned-access" }, { "variant": "armv7m_hard_fpv5_d16_exn_rtti", @@ -194,15 +284,25 @@ "json": "armv7m_hard_fpv5_d16.json", "flags": "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16 -fno-exceptions -fno-rtti" }, + { + "variant": "armv7m_soft_nofp_exn_rtti_unaligned", + "json": "armv7m_soft_nofp_exn_rtti_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none" + }, { "variant": "armv7m_soft_nofp_exn_rtti", "json": "armv7m_soft_nofp_exn_rtti.json", - "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none" + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none -mno-unaligned-access" + }, + { + "variant": "armv7m_soft_nofp_unaligned", + "json": "armv7m_soft_nofp_unaligned.json", + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" }, { "variant": "armv7m_soft_nofp", "json": "armv7m_soft_nofp.json", - "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + "flags": "--target=thumbv7m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access" }, { "variant": "armv8m.main_soft_nofp_exn_rtti", diff --git a/arm-multilib/json/variants/armv6m_soft_nofp.json b/arm-multilib/json/variants/armv6m_soft_nofp.json index f1548a50..36c55ca7 100644 --- a/arm-multilib/json/variants/armv6m_soft_nofp.json +++ b/arm-multilib/json/variants/armv6m_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv6m", "VARIANT": "armv6m_soft_nofp", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json index 0821eb18..0efd1605 100644 --- a/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv6m", "VARIANT": "armv6m_soft_nofp_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti_unaligned.json new file mode 100644 index 00000000..0821eb18 --- /dev/null +++ b/arm-multilib/json/variants/armv6m_soft_nofp_exn_rtti_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armv6m_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an385", + "QEMU_CPU": "cortex-m3", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv6m_soft_nofp_unaligned.json b/arm-multilib/json/variants/armv6m_soft_nofp_unaligned.json new file mode 100644 index 00000000..f1548a50 --- /dev/null +++ b/arm-multilib/json/variants/armv6m_soft_nofp_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armv6m_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an385", + "QEMU_CPU": "cortex-m3", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json index 0edc2b06..66cc3b06 100644 --- a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_hard_vfpv3_d16", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json index f056361c..db259c65 100644 --- a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_hard_vfpv3_d16_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti_unaligned.json new file mode 100644 index 00000000..734461df --- /dev/null +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_hard_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_unaligned.json b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_unaligned.json new file mode 100644 index 00000000..e801a409 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_hard_vfpv3_d16_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_hard_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armv7a_soft_nofp.json b/arm-multilib/json/variants/armv7a_soft_nofp.json index 3104e285..d75d85c6 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_soft_nofp", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json index 8373df82..e706f465 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_soft_nofp_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti_unaligned.json similarity index 93% rename from arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json rename to arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti_unaligned.json index bb436482..2857e3f3 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp_strictalign_exn_rtti.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp_exn_rtti_unaligned.json @@ -2,8 +2,8 @@ "args": { "common": { "TARGET_ARCH": "armv7a", - "VARIANT": "armv7a_soft_nofp_strictalign_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", + "VARIANT": "armv7a_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json b/arm-multilib/json/variants/armv7a_soft_nofp_unaligned.json similarity index 93% rename from arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json rename to arm-multilib/json/variants/armv7a_soft_nofp_unaligned.json index 3312efe3..cb67b50d 100644 --- a/arm-multilib/json/variants/armv7a_soft_nofp_strictalign.json +++ b/arm-multilib/json/variants/armv7a_soft_nofp_unaligned.json @@ -2,8 +2,8 @@ "args": { "common": { "TARGET_ARCH": "armv7a", - "VARIANT": "armv7a_soft_nofp_strictalign", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none -mno-unaligned-access", + "VARIANT": "armv7a_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7a -mfpu=none", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json index 734945b6..ff464f0c 100644 --- a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_soft_vfpv3_d16", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json index 471f934f..c5c08bd4 100644 --- a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7a", "VARIANT": "armv7a_soft_vfpv3_d16_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti_unaligned.json new file mode 100644 index 00000000..bda4401a --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_unaligned.json b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_unaligned.json new file mode 100644 index 00000000..734945b6 --- /dev/null +++ b/arm-multilib/json/variants/armv7a_soft_vfpv3_d16_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7a", + "VARIANT": "armv7a_soft_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7a -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-a8", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json index 443d3375..e3d3c8de 100644 --- a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_hard_fpv4_sp_d16", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json index 8c0d32f6..09ac08ae 100644 --- a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_hard_fpv4_sp_d16_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned.json new file mode 100644 index 00000000..8c0d32f6 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv4_sp_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_unaligned.json b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_unaligned.json new file mode 100644 index 00000000..443d3375 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_hard_fpv4_sp_d16_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_hard_fpv4_sp_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json index 014a5c32..87765063 100644 --- a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_soft_fpv4_sp_d16", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json index a28dece2..aeab1910 100644 --- a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_soft_fpv4_sp_d16_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned.json new file mode 100644 index 00000000..a28dece2 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_fpv4_sp_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_unaligned.json b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_unaligned.json new file mode 100644 index 00000000..014a5c32 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_fpv4_sp_d16_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_fpv4_sp_d16", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7m -mfpu=fpv4-sp-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_nofp.json b/arm-multilib/json/variants/armv7m_soft_nofp.json index 0d2033a6..70cf7d6d 100644 --- a/arm-multilib/json/variants/armv7m_soft_nofp.json +++ b/arm-multilib/json/variants/armv7m_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_soft_nofp", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json index f024ba55..fdd35710 100644 --- a/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7m", "VARIANT": "armv7m_soft_nofp_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti_unaligned.json new file mode 100644 index 00000000..f024ba55 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_nofp_exn_rtti_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7m_soft_nofp_unaligned.json b/arm-multilib/json/variants/armv7m_soft_nofp_unaligned.json new file mode 100644 index 00000000..0d2033a6 --- /dev/null +++ b/arm-multilib/json/variants/armv7m_soft_nofp_unaligned.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7m", + "VARIANT": "armv7m_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7m -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "mps2-an386", + "QEMU_CPU": "cortex-m4", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x21000000", + "FLASH_SIZE": "0x600000", + "RAM_ADDRESS": "0x21600000", + "RAM_SIZE": "0xa00000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json index a3d4fc7d..5a933877 100644 --- a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_hard_vfpv3_d16", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json index 148424be..7a376aa2 100644 --- a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_hard_vfpv3_d16_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16 -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti_unaligned.json new file mode 100644 index 00000000..148424be --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3_d16_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_unaligned.json b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_unaligned.json new file mode 100644 index 00000000..a3d4fc7d --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3_d16_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3_d16", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3-d16", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json index 3eeb40e9..09a16606 100644 --- a/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_hard_vfpv3xd", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json index 6b06f628..b2a8273c 100644 --- a/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_hard_vfpv3xd_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti_unaligned.json new file mode 100644 index 00000000..6b06f628 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3xd_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_hard_vfpv3xd_unaligned.json b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_unaligned.json new file mode 100644 index 00000000..3eeb40e9 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_hard_vfpv3xd_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_hard_vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=hard -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_nofp.json b/arm-multilib/json/variants/armv7r_soft_nofp.json index b641d7ba..411bbf8f 100644 --- a/arm-multilib/json/variants/armv7r_soft_nofp.json +++ b/arm-multilib/json/variants/armv7r_soft_nofp.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_soft_nofp", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json index af4c221d..a25aefc3 100644 --- a/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json +++ b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_soft_nofp_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", @@ -38,4 +38,4 @@ "ENABLE_LIBCXX_TESTS": "OFF" } } -} \ No newline at end of file +} diff --git a/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti_unaligned.json new file mode 100644 index 00000000..e8973e3a --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_nofp_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armv7r_soft_nofp_unaligned.json b/arm-multilib/json/variants/armv7r_soft_nofp_unaligned.json new file mode 100644 index 00000000..20b04ba6 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_nofp_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv7r -mfpu=none", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json index 6940c0de..efcbb86c 100644 --- a/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_soft_vfpv3xd", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd -mno-unaligned-access", "ENABLE_EXCEPTIONS": "OFF", "ENABLE_RTTI": "OFF", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json index cbdf3924..219368fe 100644 --- a/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti.json @@ -3,7 +3,7 @@ "common": { "TARGET_ARCH": "armv7r", "VARIANT": "armv7r_soft_vfpv3xd_exn_rtti", - "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd -mno-unaligned-access", "ENABLE_EXCEPTIONS": "ON", "ENABLE_RTTI": "ON", "TEST_EXECUTOR": "qemu", diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti_unaligned.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti_unaligned.json new file mode 100644 index 00000000..cbdf3924 --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_exn_rtti_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_vfpv3xd_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/arm-multilib/json/variants/armv7r_soft_vfpv3xd_unaligned.json b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_unaligned.json new file mode 100644 index 00000000..6940c0de --- /dev/null +++ b/arm-multilib/json/variants/armv7r_soft_vfpv3xd_unaligned.json @@ -0,0 +1,41 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv7r", + "VARIANT": "armv7r_soft_vfpv3xd", + "COMPILE_FLAGS": "-mfloat-abi=softfp -march=armv7r -mfpu=vfpv3xd", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "qemu", + "QEMU_MACHINE": "none", + "QEMU_CPU": "cortex-r5f", + "QEMU_PARAMS": "-m 1G", + "BOOT_FLASH_ADDRESS": "0x00000000", + "BOOT_FLASH_SIZE": "0x1000", + "FLASH_ADDRESS": "0x20000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x21000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "release", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} \ No newline at end of file diff --git a/test/multilib/armv6m.test b/test/multilib/armv6m.test index e9f86699..d9cb3c9a 100644 --- a/test/multilib/armv6m.test +++ b/test/multilib/armv6m.test @@ -1,3 +1,15 @@ -# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none | FileCheck %s -# CHECK: arm-none-eabi/armv6m_soft_nofp_exn_rtti{{$}} -# CHECK-EMPTY: +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none | FileCheck %s --check-prefix=CHECK-NOFP-EXN-RTTI-UNALIGNED +# CHECK-NOFP-EXN-RTTI-UNALIGNED: arm-none-eabi/armv6m_soft_nofp_exn_rtti_unaligned{{$}} +# CHECK-NOFP-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-NOFP-EXN-RTTI +# CHECK-NOFP-EXN-RTTI: arm-none-eabi/armv6m_soft_nofp_exn_rtti{{$}} +# CHECK-NOFP-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=CHECK-NOFP-UNALIGNED +# CHECK-NOFP-UNALIGNED: arm-none-eabi/armv6m_soft_nofp_unaligned{{$}} +# CHECK-NOFP-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-NOFP +# CHECK-NOFP: arm-none-eabi/armv6m_soft_nofp{{$}} +# CHECK-NOFP-EMPTY: diff --git a/test/multilib/armv7a.test b/test/multilib/armv7a.test index 28739532..72cd25ff 100644 --- a/test/multilib/armv7a.test +++ b/test/multilib/armv7a.test @@ -1,49 +1,157 @@ -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -marm | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mthumb| FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -marm | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mthumb| FileCheck %s -# CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} -# CHECK-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=CHECK-NOUNALIGNED %s -# CHECK-NOUNALIGNED: arm-none-eabi/armv7a_soft_nofp_strictalign_exn_rtti{{$}} -# CHECK-NOUNALIGNED-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -marm | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mthumb| FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -marm | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mthumb| FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# NOFP-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7a_soft_nofp_exn_rtti_unaligned{{$}} +# NOFP-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=NOFP-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=NOFP-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=NOFP-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access | FileCheck --check-prefix=NOFP-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -marm | FileCheck --check-prefix=NOFP-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mno-unaligned-access -mthumb| FileCheck --check-prefix=NOFP-EXN-RTTI %s +# NOFP-EXN-RTTI: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} +# NOFP-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -marm -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -mthumb -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -marm -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -mthumb -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# NOFP-UNALIGNED: arm-none-eabi/armv7a_soft_nofp_unaligned{{$}} +# NOFP-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=NOFP %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access -marm | FileCheck --check-prefix=NOFP %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access -mthumb| FileCheck --check-prefix=NOFP %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=NOFP %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access -marm | FileCheck --check-prefix=NOFP %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access -mthumb| FileCheck --check-prefix=NOFP %s +# NOFP: arm-none-eabi/armv7a_soft_nofp{{$}} +# NOFP-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# VFPV3-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti_unaligned{{$}} +# VFPV3-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# VFPV3-EXN-RTTI: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti | FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -mthumb -fno-exceptions -fno-rtti| FileCheck --check-prefix=VFPV3-UNALIGNED %s +# VFPV3-UNALIGNED: arm-none-eabi/armv7a_hard_vfpv3_d16_unaligned{{$}} +# VFPV3-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv3 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16-fp16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-fp16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv4 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-fp16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=neon-vfpv4 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -marm -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabihf -mfpu=vfpv3-d16 -mthumb -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7ve-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16{{$}} # VFPV3-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# SOFT-VFPV3: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# SOFT-VFPV3-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti_unaligned{{$}} +# SOFT-VFPV3-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# SOFT-VFPV3-EXN-RTTI: arm-none-eabi/armv7a_soft_vfpv3_d16_exn_rtti{{$}} +# SOFT-VFPV3-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# SOFT-VFPV3-UNALIGNED: arm-none-eabi/armv7a_soft_vfpv3_d16_unaligned{{$}} +# SOFT-VFPV3-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv3 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv4 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-fp16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=neon-vfpv4 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7a-none-eabi -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# SOFT-VFPV3: arm-none-eabi/armv7a_soft_vfpv3_d16{{$}} # SOFT-VFPV3-EMPTY: # We have no valid variant for this configuration, yet. diff --git a/test/multilib/armv7m.test b/test/multilib/armv7m.test index 6d98aaad..18d5c578 100644 --- a/test/multilib/armv7m.test +++ b/test/multilib/armv7m.test @@ -1,21 +1,75 @@ -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s --check-prefix=NONE -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE -# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE -# NONE: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}} -# NONE-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s -# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s -# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s -# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s -# SOFT-FPV4: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# NOFP-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7m_soft_nofp_exn_rtti_unaligned{{$}} +# NOFP-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -mfloat-abi=softfp -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# NOFP-EXN-RTTI: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}} +# NOFP-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mfloat-abi=softfp | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mfloat-abi=softfp | FileCheck %s --check-prefix=NOFP-UNALIGNED +# NOFP-UNALIGNED: arm-none-eabi/armv7m_soft_nofp_unaligned{{$}} +# NOFP-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mfloat-abi=softfp -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mfloat-abi=softfp -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# NOFP: arm-none-eabi/armv7m_soft_nofp{{$}} +# NOFP-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI-UNALIGNED %s +# SOFT-FPV4-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned{{$}} +# SOFT-FPV4-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4-EXN-RTTI %s +# SOFT-FPV4-EXN-RTTI: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti{{$}} +# SOFT-FPV4-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-FPV4-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-FPV4-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-FPV4-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-FPV4-UNALIGNED %s +# SOFT-FPV4-UNALIGNED: arm-none-eabi/armv7m_soft_fpv4_sp_d16_unaligned{{$}} +# SOFT-FPV4-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-FPV4 %s +# SOFT-FPV4: arm-none-eabi/armv7m_soft_fpv4_sp_d16{{$}} # SOFT-FPV4-EMPTY: -# -# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s -# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s -# FPV4: arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti{{$}} + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4-EXN-RTTI-UNALIGNED %s +# FPV4-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned{{$}} +# FPV4-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 -mno-unaligned-access | FileCheck --check-prefix=FPV4-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 -mno-unaligned-access | FileCheck --check-prefix=FPV4-EXN-RTTI %s +# FPV4-EXN-RTTI: arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti{{$}} +# FPV4-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti | FileCheck --check-prefix=FPV4-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti | FileCheck --check-prefix=FPV4-UNALIGNED %s +# FPV4-UNALIGNED: arm-none-eabi/armv7m_hard_fpv4_sp_d16_unaligned{{$}} +# FPV4-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=FPV4 %s +# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=FPV4 %s +# FPV4: arm-none-eabi/armv7m_hard_fpv4_sp_d16{{$}} # FPV4-EMPTY: -# + # RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s # RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s # FPV5: arm-none-eabi/armv7m_hard_fpv5_d16_exn_rtti{{$}} diff --git a/test/multilib/armv7r.test b/test/multilib/armv7r.test index 7a4e4e3e..dd700093 100644 --- a/test/multilib/armv7r.test +++ b/test/multilib/armv7r.test @@ -1,23 +1,95 @@ -# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -marm | FileCheck %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -mthumb | FileCheck %s -# CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} -# CHECK-EMPTY: - -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -marm | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -mthumb | FileCheck %s --check-prefix=NOFP-EXN-RTTI-UNALIGNED +# NOFP-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7r_soft_nofp_exn_rtti_unaligned{{$}} +# NOFP-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -marm -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -mthumb -mno-unaligned-access | FileCheck %s --check-prefix=NOFP-EXN-RTTI +# NOFP-EXN-RTTI: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} +# NOFP-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti -marm | FileCheck %s --check-prefix=NOFP-UNALIGNED +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mthumb | FileCheck %s --check-prefix=NOFP-UNALIGNED +# NOFP-UNALIGNED: arm-none-eabi/armv7r_soft_nofp_unaligned{{$}} +# NOFP-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti -marm -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# RUN: %clang -print-multi-directory --target=armv7r-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mthumb -mno-unaligned-access | FileCheck %s --check-prefix=NOFP +# NOFP: arm-none-eabi/armv7r_soft_nofp{{$}} +# NOFP-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb | FileCheck --check-prefix=VFPV3-EXN-RTTI-UNALIGNED %s +# VFPV3-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti_unaligned{{$}} +# VFPV3-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3-EXN-RTTI %s +# VFPV3-EXN-RTTI: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti | FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -marm | FileCheck --check-prefix=VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mthumb | FileCheck --check-prefix=VFPV3-UNALIGNED %s +# VFPV3-UNALIGNED: arm-none-eabi/armv7r_hard_vfpv3_d16_unaligned{{$}} +# VFPV3-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -marm -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -fno-exceptions -fno-rtti -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3 %s +# VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16{{$}} # VFPV3-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3 %s -# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI-UNALIGNED %s +# SOFT-VFPV3-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti_unaligned{{$}} +# SOFT-VFPV3-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3-EXN-RTTI %s +# SOFT-VFPV3-EXN-RTTI: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti{{$}} +# SOFT-VFPV3-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -fno-exceptions -fno-rtti | FileCheck --check-prefix=SOFT-VFPV3-UNALIGNED %s +# SOFT-VFPV3-UNALIGNED: arm-none-eabi/armv7r_soft_vfpv3xd_unaligned{{$}} +# SOFT-VFPV3-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -marm -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3-d16 -mthumb -mfloat-abi=softfp -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=SOFT-VFPV3 %s +# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd{{$}} # SOFT-VFPV3-EMPTY: -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3XD %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3XD %s -# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3XD %s -# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd | FileCheck --check-prefix=VFPV3XD-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm | FileCheck --check-prefix=VFPV3XD-EXN-RTTI-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb | FileCheck --check-prefix=VFPV3XD-EXN-RTTI-UNALIGNED %s +# VFPV3XD-EXN-RTTI-UNALIGNED: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti_unaligned{{$}} +# VFPV3XD-EXN-RTTI-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -marm -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD-EXN-RTTI %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD-EXN-RTTI %s +# VFPV3XD-EXN-RTTI: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# VFPV3XD-EXN-RTTI-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti | FileCheck --check-prefix=VFPV3XD-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -marm | FileCheck --check-prefix=VFPV3XD-UNALIGNED %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -mthumb | FileCheck --check-prefix=VFPV3XD-UNALIGNED %s +# VFPV3XD-UNALIGNED: arm-none-eabi/armv7r_hard_vfpv3xd_unaligned{{$}} +# VFPV3XD-UNALIGNED-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -marm -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD %s +# RUN: %clang -print-multi-directory --target=armv7r-none-eabihf -mfpu=vfpv3xd -fno-exceptions -fno-rtti -mthumb -mno-unaligned-access | FileCheck --check-prefix=VFPV3XD %s +# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd{{$}} # VFPV3XD-EMPTY: diff --git a/test/multilib/armv8a.test b/test/multilib/armv8a.test index 6f1ec43d..c4b8b1e3 100644 --- a/test/multilib/armv8a.test +++ b/test/multilib/armv8a.test @@ -4,7 +4,7 @@ # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv9.5-a | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv8.2-a+fp16 | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabi -mfpu=none -march=armv8.5-a+nodotprod | FileCheck %s -# CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti{{$}} +# CHECK: arm-none-eabi/armv7a_soft_nofp_exn_rtti_unaligned{{$}} # CHECK-EMPTY: # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s @@ -21,5 +21,5 @@ # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv9.5-a | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv8.2-a+fp16 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=armv8a-none-eabihf -mfpu=fp-armv8 -march=armv8.5-a+nodotprod | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3: arm-none-eabi/armv7a_hard_vfpv3_d16_exn_rtti_unaligned{{$}} # VFPV3-EMPTY: diff --git a/test/multilib/armv8m.main.test b/test/multilib/armv8m.main.test index 053c86c4..682570b3 100644 --- a/test/multilib/armv8m.main.test +++ b/test/multilib/armv8m.main.test @@ -8,5 +8,5 @@ # Fallback to armv7m # RUN: %clang -print-multi-directory --target=armv8m.main-none-eabi -mfpu=fpv5-sp-d16 | FileCheck --check-prefix=SOFTFP %s -# SOFTFP: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti{{$}} +# SOFTFP: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti_unaligned{{$}} # SOFTFP-EMPTY: diff --git a/test/multilib/armv8r.test b/test/multilib/armv8r.test index 0fefb486..17ed4e7c 100644 --- a/test/multilib/armv8r.test +++ b/test/multilib/armv8r.test @@ -3,7 +3,7 @@ # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -mthumb | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -march=armv8-r+ras | FileCheck %s # RUN: %clang -print-multi-directory --target=armv8r-none-eabi -mfpu=none -mcpu=cortex-r52 | FileCheck %s -# CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti{{$}} +# CHECK: arm-none-eabi/armv7r_soft_nofp_exn_rtti_unaligned{{$}} # CHECK-EMPTY: # RUN: %clang -print-multi-directory --target=armv8r-none-eabi | FileCheck --check-prefix=SOFT-VFPV3 %s @@ -13,7 +13,7 @@ # RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -marm | FileCheck --check-prefix=SOFT-VFPV3 %s # RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -mthumb | FileCheck --check-prefix=SOFT-VFPV3 %s # RUN: %clang -print-multi-directory --target=arm-none-eabi -march=armv8-r -mfpu=fpv5-d16 | FileCheck --check-prefix=SOFT-VFPV3 %s -# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti{{$}} +# SOFT-VFPV3: arm-none-eabi/armv7r_soft_vfpv3xd_exn_rtti_unaligned{{$}} # SOFT-VFPV3-EMPTY: # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mfpu=vfpv3-d16 | FileCheck --check-prefix=VFPV3 %s @@ -30,7 +30,7 @@ # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf -mcpu=cortex-r52 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv5-d16 | FileCheck --check-prefix=VFPV3 %s # RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fp-armv8 | FileCheck --check-prefix=VFPV3 %s -# VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti{{$}} +# VFPV3: arm-none-eabi/armv7r_hard_vfpv3_d16_exn_rtti_unaligned{{$}} # VFPV3-EMPTY: # RUN: %clang -print-multi-directory --target=armv8r-none-eabihf | FileCheck --check-prefix=VFPV3XD %s @@ -39,5 +39,5 @@ # RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mthumb | FileCheck --check-prefix=VFPV3XD %s # RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=VFPV3XD %s # RUN: %clang -print-multi-directory --target=arm-none-eabihf -march=armv8-r -mfpu=fpv5-sp-d16 | FileCheck --check-prefix=VFPV3XD %s -# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti{{$}} +# VFPV3XD: arm-none-eabi/armv7r_hard_vfpv3xd_exn_rtti_unaligned{{$}} # VFPV3XD-EMPTY: From 7db6e1020d8f5ab29155795f38a4fe9248570c1a Mon Sep 17 00:00:00 2001 From: Nashe Mncube Date: Thu, 9 Jan 2025 13:36:07 +0000 Subject: [PATCH 126/138] Extend OmaxLTO options (#623) This patch extends OmaxLTO with extra flags --- OmaxLTO.cfg | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OmaxLTO.cfg b/OmaxLTO.cfg index 9d7b5208..57c7b031 100644 --- a/OmaxLTO.cfg +++ b/OmaxLTO.cfg @@ -1,5 +1,12 @@ -flto=full \ +-fuse-linker-plugin \ -fvirtual-function-elimination \ -fwhole-program-vtables \ --Wl,-plugin-opt=-extra-LTO-loop-unroll=true +-Wl,-plugin-opt=-extra-LTO-loop-unroll=true \ +-Wl,-plugin-opt=-inline-threshold=500 \ +-Wl,-plugin-opt=-unroll-threshold=450 \ +-Wl,-plugin-opt=-unroll-partial-threshold=450 \ +-Wl,-plugin-opt=-unroll-max-iteration-count-to-analyze=20 \ +-Wl,-plugin-opt=-lsr-complexity-limit=1073741823 \ +-Wl,-plugin-opt=-force-attribute=main:norecurse \ From dc7dd64b849172058952612dbc82d271ecb44ed9 Mon Sep 17 00:00:00 2001 From: simpal01 Date: Thu, 9 Jan 2025 16:16:28 +0000 Subject: [PATCH 127/138] Undefine the macro _HAVE_INIT_FINI which is defined in newlib. (#624) Newlib overlay package has calls to init and fini. When building newlib, referencing of _init and _fini has been suppressed by undefining the corresponding macro HAVE_INIT_FINI and relys on the more modern .init_array and .fini_array. But the name of this macro in newlib has changed from HAVE_INIT_FINI to _HAVE_INIT_FINI, so undefine this macro in the cmake file.. --- arm-runtimes/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index b7929dfa..f9ab9c68 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -468,8 +468,8 @@ if(C_LIBRARY STREQUAL newlib) "RANLIB_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-ranlib" "READELF_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-readelf" "STRIP_FOR_TARGET=${LLVM_BINARY_DIR}/bin/llvm-strip" - "CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" - "CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -UHAVE_INIT_FINI__ -U_HAVE_INIT_FINI__ -UHAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" + "CFLAGS_FOR_TARGET=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" + "CCASFLAGS=${flags} -Wno-error=implicit-function-declaration -D__USES_INITFINI__ -U_HAVE_INIT_FINI --sysroot ${TEMP_LIB_DIR}" ) include(ProcessorCount) From 447a633c50b7538bc19a9ca80ee68d79aa3aa00e Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Fri, 10 Jan 2025 10:44:17 +0000 Subject: [PATCH 128/138] Fix issues with lit-exec-fvp.py (#625) This patch gives execution permissions to this Python script and fixes one wrong variable name. Since this script is used as an executable in our lit tests, it ought to have execution rights. --- arm-runtimes/test-support/lit-exec-fvp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 arm-runtimes/test-support/lit-exec-fvp.py diff --git a/arm-runtimes/test-support/lit-exec-fvp.py b/arm-runtimes/test-support/lit-exec-fvp.py old mode 100644 new mode 100755 index 1481c9ff..ef62c9c0 --- a/arm-runtimes/test-support/lit-exec-fvp.py +++ b/arm-runtimes/test-support/lit-exec-fvp.py @@ -26,7 +26,7 @@ def main(): help="Directory containing FVP config files", required=True, ) - main_arg_group.add_argument( + parser.add_argument( "--fvp-model", help="model name for FVP", required=True, From 6ccc4b6097e5fd82e63bb7398b39ebf3f8f9ae78 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 13 Jan 2025 13:51:18 +0000 Subject: [PATCH 129/138] Add armebv6m_soft_nofp variants (#626) --- arm-multilib/json/multilib.json | 10 +++++ .../json/variants/armebv6m_soft_nofp.json | 40 +++++++++++++++++++ .../variants/armebv6m_soft_nofp_exn_rtti.json | 40 +++++++++++++++++++ fvp/config/m-big-endian.cfg | 2 + test/multilib/armv6m.test | 10 +++++ 5 files changed, 102 insertions(+) create mode 100644 arm-multilib/json/variants/armebv6m_soft_nofp.json create mode 100644 arm-multilib/json/variants/armebv6m_soft_nofp_exn_rtti.json create mode 100644 fvp/config/m-big-endian.cfg diff --git a/arm-multilib/json/multilib.json b/arm-multilib/json/multilib.json index 95ef58d6..06d36616 100644 --- a/arm-multilib/json/multilib.json +++ b/arm-multilib/json/multilib.json @@ -94,6 +94,16 @@ "json": "armv6m_soft_nofp.json", "flags": "--target=thumbv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access" }, + { + "variant": "armebv6m_soft_nofp_exn_rtti", + "json": "armebv6m_soft_nofp_exn_rtti.json", + "flags": "--target=thumbebv6m-unknown-none-eabi -mfpu=none" + }, + { + "variant": "armebv6m_soft_nofp", + "json": "armebv6m_soft_nofp.json", + "flags": "--target=thumbebv6m-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti" + }, { "variant": "armv7a_soft_nofp_exn_rtti_unaligned", "json": "armv7a_soft_nofp_exn_rtti_unaligned.json", diff --git a/arm-multilib/json/variants/armebv6m_soft_nofp.json b/arm-multilib/json/variants/armebv6m_soft_nofp.json new file mode 100644 index 00000000..c7277cb7 --- /dev/null +++ b/arm-multilib/json/variants/armebv6m_soft_nofp.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armebv6m_soft_nofp", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mbig-endian -mfpu=none -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "OFF", + "ENABLE_RTTI": "OFF", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-big-endian m-nofp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/arm-multilib/json/variants/armebv6m_soft_nofp_exn_rtti.json b/arm-multilib/json/variants/armebv6m_soft_nofp_exn_rtti.json new file mode 100644 index 00000000..bea48b3d --- /dev/null +++ b/arm-multilib/json/variants/armebv6m_soft_nofp_exn_rtti.json @@ -0,0 +1,40 @@ +{ + "args": { + "common": { + "TARGET_ARCH": "armv6m", + "VARIANT": "armebv6m_soft_nofp_exn_rtti", + "COMPILE_FLAGS": "-mfloat-abi=soft -march=armv6m -mbig-endian -mfpu=none -mno-unaligned-access", + "ENABLE_EXCEPTIONS": "ON", + "ENABLE_RTTI": "ON", + "TEST_EXECUTOR": "fvp", + "FVP_MODEL": "corstone-310", + "FVP_CONFIG": "cortex-m85 m-big-endian m-nofp mve-none", + "BOOT_FLASH_ADDRESS": "0x01000000", + "BOOT_FLASH_SIZE": "2M", + "FLASH_ADDRESS": "0x60000000", + "FLASH_SIZE": "0x1000000", + "RAM_ADDRESS": "0x61000000", + "RAM_SIZE": "0x1000000", + "STACK_SIZE": "4K" + }, + "picolibc": { + "PICOLIBC_BUILD_TYPE": "minsize", + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "ON", + "ENABLE_COMPILER_RT_TESTS": "ON", + "ENABLE_LIBCXX_TESTS": "ON" + }, + "newlib": { + "ENABLE_CXX_LIBS": "ON", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + }, + "llvmlibc": { + "ENABLE_CXX_LIBS": "OFF", + "ENABLE_LIBC_TESTS": "OFF", + "ENABLE_COMPILER_RT_TESTS": "OFF", + "ENABLE_LIBCXX_TESTS": "OFF" + } + } +} diff --git a/fvp/config/m-big-endian.cfg b/fvp/config/m-big-endian.cfg new file mode 100644 index 00000000..9a8fc07e --- /dev/null +++ b/fvp/config/m-big-endian.cfg @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates +cpu0.CFGBIGEND=1 diff --git a/test/multilib/armv6m.test b/test/multilib/armv6m.test index d9cb3c9a..ab50931c 100644 --- a/test/multilib/armv6m.test +++ b/test/multilib/armv6m.test @@ -13,3 +13,13 @@ # RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-NOFP # CHECK-NOFP: arm-none-eabi/armv6m_soft_nofp{{$}} # CHECK-NOFP-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none -fno-exceptions -fno-rtti | FileCheck %s --check-prefix=CHECK-BE-NOFP +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none -fno-exceptions -fno-rtti -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-BE-NOFP +# CHECK-BE-NOFP: arm-none-eabi/armebv6m_soft_nofp{{$}} +# CHECK-BE-NOFP-EMPTY: + +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none | FileCheck %s --check-prefix=CHECK-BE-NOFP-EXN-RTTI +# RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-BE-NOFP-EXN-RTTI +# CHECK-BE-NOFP-EXN-RTTI: arm-none-eabi/armebv6m_soft_nofp_exn_rtti{{$}} +# CHECK-BE-NOFP-EXN-RTTI-EMPTY: \ No newline at end of file From 4c3a6ddb021fe521d02111c25fe14dda40ec960a Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Tue, 14 Jan 2025 16:17:26 +0000 Subject: [PATCH 130/138] Add newline at the end of file to fix test failure (#627) The lit tests under test/multilib must have a newline at the end of the file so that FileCheck checks with "-EMPTY" work correctly. --- test/multilib/armv6m.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multilib/armv6m.test b/test/multilib/armv6m.test index ab50931c..12cc03f0 100644 --- a/test/multilib/armv6m.test +++ b/test/multilib/armv6m.test @@ -22,4 +22,4 @@ # RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none | FileCheck %s --check-prefix=CHECK-BE-NOFP-EXN-RTTI # RUN: %clang -print-multi-directory --target=armv6m-none-eabi -mbig-endian -mfpu=none -mno-unaligned-access | FileCheck %s --check-prefix=CHECK-BE-NOFP-EXN-RTTI # CHECK-BE-NOFP-EXN-RTTI: arm-none-eabi/armebv6m_soft_nofp_exn_rtti{{$}} -# CHECK-BE-NOFP-EXN-RTTI-EMPTY: \ No newline at end of file +# CHECK-BE-NOFP-EXN-RTTI-EMPTY: From 49bfb9d02dfa15c1c856b95dafe2663058652966 Mon Sep 17 00:00:00 2001 From: dcandler Date: Thu, 23 Jan 2025 14:09:56 +0000 Subject: [PATCH 131/138] Improve build efficiency by building library subprojects in parallel (#630) Each library variant build consists of three subprojects, which require sequential configuring and building. While the build steps can be parallelized by using multiple processes to compile the sources, the configuration step is largely single threaded. The multilib project has to build many variants now, and so a significant amount of time is spent waiting for the configuration of various projects to finish. This patch attempts to make the build process more efficient by running all the configuration steps for every variant subproject in parallel. The configuration/build steps in the underlying runtimes project are exposed, so that the higher level multilib project can invoke them as a single target. So instead of building each variant in turn, all the versions of compiler-rt are configured, then all versions are built, then all the C libraries are configured, and so on. This maximizes the amount of work that can be done at any given time. The build steps already benefit from parallelization: although built in series, each has the full number of available processes to use. However, at higher CPU counts there is an observable limit on how many processes each build can effectively use. So it may also be more efficient to instead run the build steps in parallel with a smaller number of proceses available to each. The option to control it (ENABLE_PARALLEL_LIB_BUILD) is OFF by default as which strategy is faster may come down to your available hardware, whereas ENABLE_PARALLEL_LIB_CONFIG should always be beneficial, so I've defaulted that to ON. --- CMakeLists.txt | 20 +++++++- arm-multilib/CMakeLists.txt | 96 ++++++++++++++++++++++++++++++++++++- arm-runtimes/CMakeLists.txt | 33 +++++++------ 3 files changed, 132 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 416ce5dc..ee4a140e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,20 @@ option( "During checkout, apply optional downstream patches to llvm-project to improve performance." ) +option( + ENABLE_PARALLEL_LIB_CONFIG + "Run the library variant configuration steps in parallel." + ON +) +option( + ENABLE_PARALLEL_LIB_BUILD + "Run the library variant build steps in parallel." + OFF +) +set(PARALLEL_LIB_BUILD_LEVELS + "1" CACHE STRING + "If ENABLE_PARALLEL_LIB_BUILD is ON, this number of processes will be assigned to each variant built." +) option( ENABLE_QEMU_TESTING "Enable tests that use QEMU. This option is ON by default." @@ -599,6 +613,9 @@ if(NOT PREBUILT_TARGET_LIBRARIES) -DLLVM_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/llvm -DMULTILIB_JSON=${LLVM_TOOLCHAIN_MULTILIB_JSON} -DENABLE_VARIANTS=${ENABLE_VARIANTS_PASSTHROUGH} + -DENABLE_PARALLEL_LIB_CONFIG=${ENABLE_PARALLEL_LIB_CONFIG} + -DENABLE_PARALLEL_LIB_BUILD=${ENABLE_PARALLEL_LIB_BUILD} + -DPARALLEL_LIB_BUILD_LEVELS=${PARALLEL_LIB_BUILD_LEVELS} -DLIBC_HDRGEN=${LIBC_HDRGEN} -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} -DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING} @@ -608,9 +625,8 @@ if(NOT PREBUILT_TARGET_LIBRARIES) -DFETCHCONTENT_SOURCE_DIR_PICOLIBC=${FETCHCONTENT_SOURCE_DIR_PICOLIBC} -DFETCHCONTENT_SOURCE_DIR_NEWLIB=${FETCHCONTENT_SOURCE_DIR_NEWLIB} -DCMAKE_INSTALL_PREFIX= - USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE - USES_TERMINAL_TEST TRUE LIST_SEPARATOR , CONFIGURE_HANDLED_BY_BUILD TRUE TEST_EXCLUDE_FROM_MAIN TRUE diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 0b371ad2..84e31b05 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -50,6 +50,25 @@ set( fvp/get_fvps.sh" ) set(FVP_CONFIG_DIR "${TOOLCHAIN_SOURCE_DIR}/fvp/config" CACHE STRING "The directory in which the FVP models are installed.") +option( + ENABLE_PARALLEL_LIB_CONFIG + "Run the library variant configuration steps in parallel." + ON +) +option( + ENABLE_PARALLEL_LIB_BUILD + "Run the library variant build steps in parallel." + OFF +) +set(PARALLEL_LIB_BUILD_LEVELS + "1" CACHE STRING + "If ENABLE_PARALLEL_LIB_BUILD is ON, this number of processes will be assigned to each variant built." +) +if(NOT CMAKE_GENERATOR MATCHES "Ninja") + if (ENABLE_PARALLEL_LIB_CONFIG OR ENABLE_PARALLEL_LIB_BUILD) + message(WARNING "Library build parallelization should only be enabled with the Ninja generator.") + endif() +endif() # If a compiler launcher such as ccache has been set, it should be # passed down to each subproject build. @@ -131,6 +150,34 @@ add_dependencies( check-unwind ) +if(ENABLE_PARALLEL_LIB_CONFIG OR ENABLE_PARALLEL_LIB_BUILD) + # Additional targets to build the variant subprojects in parallel. + # The build steps can use multible jobs to compile in parallel, but + # the configuration steps are largely single threaded. This creates a + # bottleneck if each variant is built in series. + # It is significantly faster to run all the subproject configuration + # steps in parallel, run the build steps, then run the next set of + # configuration steps in parallel, etc. + set( + subtargets + compiler_rt-configure + compiler_rt-build + clib-configure + clib-build + cxxlibs-configure + cxxlibs-build + ) + set(subtarget_deps none ${subtargets}) + list(REMOVE_AT subtarget_deps 6) + + foreach(subtarget subtarget_dep IN ZIP_LISTS subtargets subtarget_deps) + add_custom_target(${subtarget}-all) + if(NOT subtarget_dep STREQUAL "none") + add_dependencies(${subtarget}-all ${subtarget_dep}-all) + endif() + endforeach() +endif() + # Read the JSON file to load a multilib configuration. file(READ ${MULTILIB_JSON} multilib_json_str) string(JSON multilib_defs GET ${multilib_json_str} "libs") @@ -218,11 +265,58 @@ foreach(lib_idx RANGE ${lib_count_dec}) STEP_TARGETS build install USES_TERMINAL_CONFIGURE FALSE USES_TERMINAL_BUILD TRUE - USES_TERMINAL_TEST TRUE LIST_SEPARATOR , CONFIGURE_HANDLED_BY_BUILD TRUE TEST_EXCLUDE_FROM_MAIN TRUE ) + + if(ENABLE_PARALLEL_LIB_CONFIG OR ENABLE_PARALLEL_LIB_BUILD) + # Create additional steps to configure/build the subprojects. + # These are collected to be run together, so that all the + # configuration steps can be run in parallel. + # Each step should depend on the previous, with the first depending on the pre-defined + # 'configure' step, and the pre-defined 'build' step depending on the last. + set(subtarget_deps configure ${subtargets} build) + list(SUBLIST subtarget_deps 0 6 subtarget_dependees) + list(SUBLIST subtarget_deps 2 6 subtarget_dependers) + + # First loop to add the steps and targets. + foreach(subtarget subtarget_dependee IN ZIP_LISTS subtargets subtarget_dependees) + # Enabling USES_TERMINAL puts the step in Ninja's "console" job pool, which + # prevents the steps from being run in parallel since each must be given + # exclusive access to the terminal. When disabled, the console won't be updated + # with any output from the step until it completes. + set(step_uses_terminal ON) + set(step_extra_env "") + if(${subtarget} MATCHES "-configure$" AND ENABLE_PARALLEL_LIB_CONFIG) + set(step_uses_terminal OFF) + elseif(${subtarget} MATCHES "-build$" AND ENABLE_PARALLEL_LIB_BUILD) + set(step_uses_terminal OFF) + set(step_extra_env ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=${PARALLEL_LIB_BUILD_LEVELS}) + endif() + ExternalProject_Add_Step( + runtimes-${variant} + ${subtarget} + COMMAND ${step_extra_env} ${CMAKE_COMMAND} --build --target ${subtarget} + DEPENDEES ${subtarget_dependee} + DEPENDERS build + USES_TERMINAL ${step_uses_terminal} + ) + ExternalProject_Add_StepTargets(runtimes-${variant} ${subtarget}) + add_dependencies(${subtarget}-all runtimes-${variant}-${subtarget}) + endforeach() + + # Second loop to set the steps that will depend on the new targets. + foreach(subtarget subtarget_depender IN ZIP_LISTS subtargets subtarget_dependers) + ExternalProject_Add_StepDependencies( + runtimes-${variant} + ${subtarget_depender} + ${subtarget}-all + ) + endforeach() + endif() + + # Add custom check targets. set(check_targets "") if(read_ENABLE_LIBC_TESTS) list(APPEND check_targets check-${C_LIBRARY}) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index f9ab9c68..a79bd638 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -210,7 +210,10 @@ set(compile_arch_flags "--target=${target_triple} ${COMPILE_FLAGS}") # flags, and requires a sysroot. set(lib_compile_flags "${compile_arch_flags} -ffunction-sections -fdata-sections -fno-ident --sysroot ${TEMP_LIB_DIR}") -# Declare this target now, since compiler-rt requires the dependency. +# Generic target names for the C library. +# Declare these now, since compiler-rt requires the 'install' dependency. +add_custom_target(clib-configure) +add_custom_target(clib-build) add_custom_target(clib-install) ############################################################################### @@ -288,8 +291,8 @@ ExternalProject_Add( -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR} -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON ${compiler_rt_test_cmake_args} - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE + STEP_TARGETS configure build install + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE USES_TERMINAL_INSTALL TRUE LIST_SEPARATOR , @@ -399,12 +402,13 @@ if(C_LIBRARY STREQUAL picolibc) BUILD_COMMAND ${MESON_EXECUTABLE} compile INSTALL_COMMAND ${MESON_EXECUTABLE} install ${MESON_INSTALL_QUIET} - USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE LIST_SEPARATOR , CONFIGURE_HANDLED_BY_BUILD TRUE TEST_EXCLUDE_FROM_MAIN TRUE - STEP_TARGETS build install + STEP_TARGETS configure build install ) add_custom_target(check-picolibc) @@ -523,12 +527,13 @@ if(C_LIBRARY STREQUAL newlib) /${target_triple}/libgloss/${cpu_family}/libcrt0-nosys.a ${TEMP_LIB_DIR}/lib # FIXME: TEST_COMMAND? - USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE + USES_TERMINAL_INSTALL TRUE # Always run the build command so that incremental builds are correct. CONFIGURE_HANDLED_BY_BUILD TRUE TEST_EXCLUDE_FROM_MAIN TRUE - STEP_TARGETS install # FIXME: test? + STEP_TARGETS configure build install # FIXME: test? ) endif() @@ -620,11 +625,10 @@ if(C_LIBRARY STREQUAL llvmlibc) -DLLVM_ENABLE_RUNTIMES=libc -DLLVM_INCLUDE_TESTS=OFF # llvmlibc's tests require C++, so can't be built until llvmlibc can support libc++ -DLLVM_LIBC_FULL_BUILD=ON - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE + STEP_TARGETS configure build install + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE LIST_SEPARATOR , CONFIGURE_HANDLED_BY_BUILD TRUE INSTALL_COMMAND ${CMAKE_COMMAND} --install . @@ -652,7 +656,7 @@ if(C_LIBRARY STREQUAL llvmlibc) ${compiler_launcher_cmake_args} ${common_llvmlibc_cmake_args} STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE USES_TERMINAL_INSTALL TRUE USES_TERMINAL_TEST TRUE @@ -661,6 +665,8 @@ if(C_LIBRARY STREQUAL llvmlibc) ) endif() +add_dependencies(clib-configure ${C_LIBRARY}-configure) +add_dependencies(clib-build ${C_LIBRARY}-build) add_dependencies(clib-install ${C_LIBRARY}-install) ############################################################################### @@ -758,11 +764,10 @@ if(ENABLE_CXX_LIBS) -DRUNTIME_VARIANT_NAME=${VARIANT} ${cxxlibs_extra_cmake_options} ${cxxlibs_test_cmake_options} - STEP_TARGETS build install - USES_TERMINAL_CONFIGURE FALSE + STEP_TARGETS configure build install + USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE USES_TERMINAL_INSTALL TRUE - USES_TERMINAL_TEST TRUE LIST_SEPARATOR , CONFIGURE_HANDLED_BY_BUILD TRUE ) From 13ad84a18b06a885eafe7b6003d44ac1c23e04a7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 27 Jan 2025 16:52:03 +0000 Subject: [PATCH 132/138] llvm-libc build: remove all references to libc-hdrgen. (#629) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'newhdrgen' tool replaced it some time ago, and that's written in Python, so it doesn't need to be built separately with host tools at all. As of upstream commit e0ae7793fca0c78, the migration is complete, and the old C++ libc-hdrgen doesn't exist at all any more. So we need to stop trying to build it – it will break our builds when no such build target exists. --- CMakeLists.txt | 20 -------------------- arm-multilib/CMakeLists.txt | 27 --------------------------- arm-runtimes/CMakeLists.txt | 26 -------------------------- 3 files changed, 73 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee4a140e..ba926a70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -350,25 +350,6 @@ if(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL llvmlibc) COMPONENT llvm-toolchain-llvmlibc-configs ) - # We need to build libc-hdrgen - ExternalProject_Add( - libc_hdrgen - SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm - DEPENDS ${lib_tool_dependencies} - CMAKE_ARGS - -DLLVM_ENABLE_RUNTIMES=libc - -DLLVM_LIBC_FULL_BUILD=ON - -DCMAKE_BUILD_TYPE=Debug - STEP_TARGETS build install - BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen - INSTALL_COMMAND ${CMAKE_COMMAND} -E true - # Always run the build command so that incremental builds are correct. - BUILD_ALWAYS TRUE - CONFIGURE_HANDLED_BY_BUILD TRUE - ) - ExternalProject_Get_property(libc_hdrgen BINARY_DIR) - set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - # LLVM libc lacks a configuration for AArch64, but the AArch32 one works # fine. However, setting the configuration for both architectures to the # arm config directory means the baremetal config.json is never loaded, @@ -616,7 +597,6 @@ if(NOT PREBUILT_TARGET_LIBRARIES) -DENABLE_PARALLEL_LIB_CONFIG=${ENABLE_PARALLEL_LIB_CONFIG} -DENABLE_PARALLEL_LIB_BUILD=${ENABLE_PARALLEL_LIB_BUILD} -DPARALLEL_LIB_BUILD_LEVELS=${PARALLEL_LIB_BUILD_LEVELS} - -DLIBC_HDRGEN=${LIBC_HDRGEN} -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} -DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING} -DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING} diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 84e31b05..e1568714 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -32,7 +32,6 @@ set(ENABLE_VARIANTS "all" CACHE STRING "Semicolon separated list of variants to set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.") -set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") option( ENABLE_QEMU_TESTING "Enable tests that use QEMU. This option is ON by default." @@ -83,7 +82,6 @@ endif() # Arguments to pass down to the library projects. foreach(arg LLVM_BINARY_DIR - LIBC_HDRGEN FVP_INSTALL_DIR FVP_CONFIG_DIR ) @@ -108,31 +106,6 @@ endif() # Target for any dependencies to build the runtimes project. add_custom_target(runtimes-depends) -# If building llvm-libc, ensure libc-hdrgen is available. -if(C_LIBRARY STREQUAL llvmlibc) - if(NOT LIBC_HDRGEN) - if(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - else() - ExternalProject_Add( - libc_hdrgen - SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm - CMAKE_ARGS - -DLLVM_ENABLE_RUNTIMES=libc - -DLLVM_LIBC_FULL_BUILD=ON - -DCMAKE_BUILD_TYPE=Debug - BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen - INSTALL_COMMAND ${CMAKE_COMMAND} -E true - CONFIGURE_HANDLED_BY_BUILD TRUE - ) - ExternalProject_Get_property(libc_hdrgen BINARY_DIR) - set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - add_dependencies(runtimes-depends libc_hdrgen) - endif() - endif() - list(APPEND passthrough_dirs "-DLIBC_HDRGEN=${LIBC_HDRGEN}") -endif() - # Create one target to run all the tests. add_custom_target(check-${C_LIBRARY}) add_custom_target(check-compiler-rt) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index a79bd638..2d3514da 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -96,7 +96,6 @@ set(ENABLE_LIBC_TESTS ${ENABLE_LIBC_TESTS_def} CACHE BOOL "Enable libc tests (pi set(ENABLE_COMPILER_RT_TESTS ${ENABLE_COMPILER_RT_TESTS_def} CACHE BOOL "Enable compiler-rt tests.") set(ENABLE_LIBCXX_TESTS ${ENABLE_LIBCXX_TESTS_def} CACHE BOOL "Enable libcxx tests.") set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain root to build libraries with") -set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") # Temporary location to collect the libraries as they are built. set(TEMP_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp_install") @@ -585,39 +584,14 @@ if(C_LIBRARY STREQUAL llvmlibc) -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY ) - if(LIBC_HDRGEN) - # If libc-hdrgen is provided, there is no need to build it, - # but a target is still needed to satisfy the dependency. - add_custom_target(libc_hdrgen) - elseif(EXISTS ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - set(LIBC_HDRGEN ${LLVM_BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - add_custom_target(libc_hdrgen) - else() - ExternalProject_Add( - libc_hdrgen - SOURCE_DIR ${llvmproject_SOURCE_DIR}/llvm - CMAKE_ARGS - -DLLVM_ENABLE_RUNTIMES=libc - -DLLVM_LIBC_FULL_BUILD=ON - -DCMAKE_BUILD_TYPE=Debug - BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libc-hdrgen - INSTALL_COMMAND ${CMAKE_COMMAND} -E true - CONFIGURE_HANDLED_BY_BUILD TRUE - ) - ExternalProject_Get_property(libc_hdrgen BINARY_DIR) - set(LIBC_HDRGEN ${BINARY_DIR}/bin/libc-hdrgen${CMAKE_EXECUTABLE_SUFFIX}) - endif() - ExternalProject_Add( llvmlibc SOURCE_DIR ${llvmproject_SOURCE_DIR}/runtimes INSTALL_DIR llvmlibc/install - DEPENDS libc_hdrgen CMAKE_ARGS ${compiler_launcher_cmake_args} ${common_llvmlibc_cmake_args} -DLIBC_TARGET_TRIPLE=${target_triple} - -DLIBC_HDRGEN_EXE=${LIBC_HDRGEN} -DLIBC_CONFIG_PATH=${LIBC_CFG_DIR} -DLIBC_CONF_TIME_64BIT=ON -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm From 5c35c32cffcc43f2b5e1336c617c19e3554b28f2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 27 Jan 2025 17:00:05 +0000 Subject: [PATCH 133/138] llvm-libc build: fix build failure with C++ libs disabled (#632) Testing the llvm-libc build after the previous commit, I found that the arm-multilib cmake script unconditionally tries to invoke build targets like `cxxlibs-configure` or `cxxlibs-build` in the individual library variant builds. Those targets don't exist in an llvm-libc build, because those set `"ENABLE_CXX_LIBS": "OFF"` in their per-variant JSON files. This commit applies the simplest possible fix: _make_ targets of those names in `arm-runtimes`, even if nothing is actually in them. Then invoking them from the higher-level build script is a NOP instead of a failure. --- arm-runtimes/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 2d3514da..9b07de2e 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -771,6 +771,14 @@ if(ENABLE_CXX_LIBS) endforeach() endif() +else() # if not ENABLE_CXX_LIBS + + # The parent arm-multilib cmake script will still want to invoke + # build targets like 'cxxlibs-configure', whether we actually have + # C++ libraries or not. So we should define them, even if they + # don't do anything. + add_custom_target(cxxlibs-configure) + add_custom_target(cxxlibs-build) endif() install( From e82398d60e46dc705d1d2b58145e2729adb0ffc0 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Mon, 17 Feb 2025 09:25:28 +0000 Subject: [PATCH 134/138] Add repository deprecation warning (#635) LLVM Embedded Toolchain for Arm is now Arm Toolchain for Embedded hosted at https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 062d55c7..f05f1419 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +> [!WARNING] +> This repository is deprecated! +> +> LLVM Embedded Toolchain for Arm is now +> [Arm Toolchain for Embedded](https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded) +> maintained in the unified Arm Toolchain [repository](https://github.com/arm/arm-toolchain) +> hosting embedded and Linux toolchains. +> +> 19.1.5 is the last release of the LLVM Embedded Toolchain for Arm. +> Use Arm Toolchain for Embedded [releases](https://github.com/arm/arm-toolchain/releases) for LLVM 20 and later. + # LLVM Embedded Toolchain for Arm This repository contains build scripts and auxiliary material for building a From 0f14f43aa0f45d12ff41f369a590bd7b70a407e9 Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Mon, 17 Feb 2025 16:34:46 +0000 Subject: [PATCH 135/138] Fix performance patch no longer applying due to upstream change Change in question: #126168 --- .../llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch b/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch index 88c68109..43d1e0b2 100644 --- a/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch +++ b/patches/llvm-project-perf/0001-LTOpasses-add-loop-unroll.patch @@ -31,8 +31,8 @@ index 1184123c7710..6dc45d85927a 100644 void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level) { for (auto &C : PeepholeEPCallbacks) -@@ -1940,6 +1944,18 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, - MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass())); +@@ -2018,6 +2022,18 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, + MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(std::move(CGPM))); FunctionPassManager FPM; + From c5d005e8ebff92c9a06dbbc1763aa65541b72210 Mon Sep 17 00:00:00 2001 From: Ties Stuij Date: Tue, 18 Feb 2025 11:12:58 +0000 Subject: [PATCH 136/138] Pin picolibc to specific known to work commit As this repo is getting depreciated, pinning picolibc to a specific commit, as we don't want to keep fixing merge conflicts and other unforeseen issues. --- versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions.json b/versions.json index c3ebe78b..341b38d6 100644 --- a/versions.json +++ b/versions.json @@ -12,8 +12,8 @@ "tag": "main" }, "picolibc": { - "tagType": "branch", - "tag": "main" + "tagType": "commithash", + "tag": "be1b69f5f5910d216c16f9fca927c1bdb4d38a51" }, "newlib": { "tagType": "tag", From f6f879ed45ff5727d821f6cd29571ee2baf31779 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Wed, 26 Feb 2025 09:06:38 +0000 Subject: [PATCH 137/138] Disable debug symbols in picolibc builds (#639) --- arm-runtimes/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/arm-runtimes/CMakeLists.txt b/arm-runtimes/CMakeLists.txt index 9b07de2e..c2aff003 100644 --- a/arm-runtimes/CMakeLists.txt +++ b/arm-runtimes/CMakeLists.txt @@ -390,6 +390,7 @@ if(C_LIBRARY STREQUAL picolibc) -Dlibdir=lib -Dspecsdir=none -Dmultilib=false + -Ddebug=false -Dtests-enable-stack-protector=false -Dtest-long-double=${enable_picolibc_long_double_test} -Dtest-machine=${TEST_EXECUTOR} From c9dff0ac5ab961cf393b6189f27cadbde77dc02e Mon Sep 17 00:00:00 2001 From: Sergei Barannikov Date: Mon, 12 May 2025 16:46:44 +0300 Subject: [PATCH 138/138] Remove unused copies of `meson-cross-build.txt.in`/`to_meson_list.cmake` (#642) The used copies are in `arm-runtimes` directory. --- cmake/meson-cross-build.txt.in | 31 ------------------------------- cmake/to_meson_list.cmake | 9 --------- 2 files changed, 40 deletions(-) delete mode 100644 cmake/meson-cross-build.txt.in delete mode 100644 cmake/to_meson_list.cmake diff --git a/cmake/meson-cross-build.txt.in b/cmake/meson-cross-build.txt.in deleted file mode 100644 index c619118a..00000000 --- a/cmake/meson-cross-build.txt.in +++ /dev/null @@ -1,31 +0,0 @@ -[binaries] -c = [@meson_c_args@, '-nostdlib'] -ar = '@LLVM_BINARY_DIR@/bin/llvm-ar@CMAKE_EXECUTABLE_SUFFIX@' -strip = '@LLVM_BINARY_DIR@/bin/llvm-strip@CMAKE_EXECUTABLE_SUFFIX@' -# only needed to run tests -# setting stdin to /dev/null prevents qemu from fiddling with the echo bit of -# the parent terminal -exe_wrapper = [ - 'sh', - '-c', - 'test -z "$PICOLIBC_TEST" || @test_executor_bin@ "$@" < /dev/null', - '@test_executor_bin@', - @test_executor_params@] - -[host_machine] -system = 'none' -cpu_family = '@cpu_family@' -cpu = '@cpu_family@' -endian = 'little' - -[properties] -skip_sanity_check = true -libgcc ='-lclang_rt.builtins' -separate_boot_flash = true -default_boot_flash_addr = '@default_boot_flash_addr@' -default_boot_flash_size = '@default_boot_flash_size@' -default_flash_addr = '@default_flash_addr@' -default_flash_size = '@default_flash_size@' -default_ram_addr = '@default_ram_addr@' -default_ram_size = '@default_ram_size@' -default_stack_size = '@default_stack_size@' diff --git a/cmake/to_meson_list.cmake b/cmake/to_meson_list.cmake deleted file mode 100644 index 8a42db85..00000000 --- a/cmake/to_meson_list.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Converts a cmake list to a string, which can be interpreted as list content in -# meson configuration file. -# The delimiting brackets are not included. -# Example output: "'foo', 'bar', 'baz'" - -function(to_meson_list input_list out_var) - list(JOIN input_list "', '" input_list) - set(${out_var} "'${input_list}'" PARENT_SCOPE) -endfunction()