diff --git a/build-llvm.sh b/build-llvm.sh index 3eb9e3d5..215bf8c3 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -117,6 +117,9 @@ if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then ;; esac fi + git config --global user.name "GitHub Actions" + git config --global user.email martin@martin.st + git am -3 ../patches/llvm-project/*.patch cd .. fi diff --git a/patches/llvm-project/0001-changes-to-main-this-commit-is-based-on.patch b/patches/llvm-project/0001-changes-to-main-this-commit-is-based-on.patch new file mode 100644 index 00000000..47120be4 --- /dev/null +++ b/patches/llvm-project/0001-changes-to-main-this-commit-is-based-on.patch @@ -0,0 +1,91 @@ +From 14f4191866f078836135d8722cb2c007be24d9df Mon Sep 17 00:00:00 2001 +From: Alex Richardson +Date: Mon, 8 Apr 2024 17:41:02 -0700 +Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?= + =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Created using spr 1.3.6-beta.1 + +[skip ci] +--- + compiler-rt/lib/memprof/tests/CMakeLists.txt | 54 ++++++++++++-------- + 1 file changed, 34 insertions(+), 20 deletions(-) + +diff --git a/compiler-rt/lib/memprof/tests/CMakeLists.txt b/compiler-rt/lib/memprof/tests/CMakeLists.txt +index f812bd1f86ff..733e7dda72c6 100644 +--- a/compiler-rt/lib/memprof/tests/CMakeLists.txt ++++ b/compiler-rt/lib/memprof/tests/CMakeLists.txt +@@ -41,33 +41,47 @@ if(NOT WIN32) + list(APPEND MEMPROF_UNITTEST_LINK_FLAGS -pthread) + endif() + ++set(MEMPROF_UNITTEST_DEPS) ++if (TARGET cxx-headers OR HAVE_LIBCXX) ++ list(APPEND MEMPROF_UNITTEST_DEPS cxx-headers) ++endif() ++ + set(MEMPROF_UNITTEST_LINK_LIBRARIES + ${COMPILER_RT_UNWINDER_LINK_LIBS} + ${SANITIZER_TEST_CXX_LIBRARIES}) +-list(APPEND MEMPROF_UNITTEST_LINK_LIBRARIES "dl") +- +-if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST MEMPROF_SUPPORTED_ARCH) +- # MemProf unit tests are only run on the host machine. +- set(arch ${COMPILER_RT_DEFAULT_TARGET_ARCH}) ++append_list_if(COMPILER_RT_HAS_LIBDL -ldl MEMPROF_UNITTEST_LINK_LIBRARIES) + +- add_executable(MemProfUnitTests +- ${MEMPROF_UNITTESTS} +- ${COMPILER_RT_GTEST_SOURCE} +- ${COMPILER_RT_GMOCK_SOURCE} +- ${MEMPROF_SOURCES} ++# Adds memprof tests for each architecture. ++macro(add_memprof_tests_for_arch arch) ++ set(MEMPROF_TEST_RUNTIME_OBJECTS + $ + $ + $ + $ +- $) +- set_target_compile_flags(MemProfUnitTests ${MEMPROF_UNITTEST_CFLAGS}) +- set_target_link_flags(MemProfUnitTests ${MEMPROF_UNITTEST_LINK_FLAGS}) +- target_link_libraries(MemProfUnitTests ${MEMPROF_UNITTEST_LINK_LIBRARIES}) +- +- if (TARGET cxx-headers OR HAVE_LIBCXX) +- add_dependencies(MemProfUnitTests cxx-headers) +- endif() ++ $ ++ ) ++ set(MEMPROF_TEST_RUNTIME RTMemProfTest.${arch}) ++ add_library(${MEMPROF_TEST_RUNTIME} STATIC ${MEMPROF_TEST_RUNTIME_OBJECTS}) ++ set_target_properties(${MEMPROF_TEST_RUNTIME} PROPERTIES ++ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ++ FOLDER "Compiler-RT Runtime tests") ++ set(MEMPROF_TEST_OBJECTS) ++ generate_compiler_rt_tests(MEMPROF_TEST_OBJECTS ++ MemProfUnitTests "MemProf-${arch}-UnitTest" ${arch} ++ RUNTIME ${MEMPROF_TEST_RUNTIME} ++ DEPS ${MEMPROF_UNITTEST_DEPS} ++ SOURCES ${MEMPROF_UNITTESTS} ${MEMPROF_SOURCES} ${COMPILER_RT_GTEST_SOURCE} ++ COMPILE_DEPS ${MEMPROF_UNIT_TEST_HEADERS} ++ CFLAGS ${MEMPROF_UNITTEST_CFLAGS} ++ LINK_FLAGS ${MEMPROF_UNITTEST_LINK_FLAGS} ${MEMPROF_UNITTEST_LINK_LIBRARIES}) ++endmacro() + +- set_target_properties(MemProfUnitTests PROPERTIES +- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) ++# Interception unit tests testsuite. ++add_custom_target(MemProfUnitTests) ++set_target_properties(MemProfUnitTests PROPERTIES FOLDER "Compiler-RT Tests") ++if(COMPILER_RT_CAN_EXECUTE_TESTS AND COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST MEMPROF_SUPPORTED_ARCH) ++ # MemProf unit tests are only run on the host machine. ++ foreach(arch ${COMPILER_RT_DEFAULT_TARGET_ARCH}) ++ add_memprof_tests_for_arch(${arch}) ++ endforeach() + endif() +-- +2.25.1 +