diff --git a/.github/workflows/pr-description-checker.yml b/.github/workflows/pr-description-checker.yml index 4d83532df55..ff87178b3ff 100644 --- a/.github/workflows/pr-description-checker.yml +++ b/.github/workflows/pr-description-checker.yml @@ -1,12 +1,13 @@ name: 'PR description checker' on: - pull_request_target: + pull_request: types: - opened - edited - reopened - labeled - unlabeled + workflow_dispatch: permissions: contents: read pull-requests: write diff --git a/CMakeLists.txt b/CMakeLists.txt index 50b21e943f8..aca082cf78b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,9 @@ if(WIN32) add_compile_options(/guard:cf) add_link_options(/guard:cf) else() - add_compile_options(-fcf-protection) + if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") + add_compile_options(-fcf-protection) + endif() endif() endif(WIN32) @@ -595,7 +597,7 @@ if (APPLE) set(CMAKE_INSTALL_NAME_DIR "@rpath") set(CMAKE_INSTALL_RPATH "@executable_path/../lib") endif(NOT DEFINED CMAKE_INSTALL_RPATH) -else(UNIX) +elseif(UNIX) if(NOT DEFINED CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}") if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 8fdff83e3f4..32242bed660 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -237,7 +237,13 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) if (LLVM_BUILD_STATIC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + if(MINGW) + # We want to mimic MSVC standalone build here + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") + else() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() endif() if( XCODE ) @@ -430,12 +436,19 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE ) append("-Wno-unknown-pragmas" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) if (MINGW) + append("-Wno-cast-function-type-mismatch" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-implicit-fallthrough" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append("-Wno-inconsistent-dllimport" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-missing-exception-spec" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-reorder-ctor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-sign-compare" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-unused-const-variable" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-unused-function" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append("-Wno-unused-private-field" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + append("-Wno-gnu-zero-variadic-macro-arguments" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + endif() endif() add_flag_if_supported("-Wno-unused-but-set-variable" UNUSED_BUT_SET_VARIABLE) diff --git a/tools/clang/tools/dxc/CMakeLists.txt b/tools/clang/tools/dxc/CMakeLists.txt index 9df8da34638..5f730dfaf12 100644 --- a/tools/clang/tools/dxc/CMakeLists.txt +++ b/tools/clang/tools/dxc/CMakeLists.txt @@ -27,6 +27,10 @@ target_link_libraries(dxc dxclib ) +if (MINGW) + target_link_options(dxc PRIVATE -mconsole -municode) +endif() + if(ENABLE_SPIRV_CODEGEN) target_link_libraries(dxc SPIRV-Tools) endif() diff --git a/tools/clang/tools/dxclib/CMakeLists.txt b/tools/clang/tools/dxclib/CMakeLists.txt index 74927fd4038..19bb1b3b3af 100644 --- a/tools/clang/tools/dxclib/CMakeLists.txt +++ b/tools/clang/tools/dxclib/CMakeLists.txt @@ -21,7 +21,6 @@ add_clang_library(dxclib ) if (MINGW) - target_link_options(dxclib PUBLIC -mconsole -municode) target_link_libraries(dxclib PRIVATE version) endif() diff --git a/tools/clang/tools/dxcvalidator/CMakeLists.txt b/tools/clang/tools/dxcvalidator/CMakeLists.txt index 28e56ab7ac8..3a51214b0bf 100644 --- a/tools/clang/tools/dxcvalidator/CMakeLists.txt +++ b/tools/clang/tools/dxcvalidator/CMakeLists.txt @@ -19,10 +19,5 @@ add_clang_library(dxcvalidator dxcvalidator.cpp ) -if (MINGW) - target_link_options(dxcvalidator PUBLIC -mconsole -municode) - target_link_libraries(dxcvalidator PRIVATE version) -endif() - target_compile_definitions(dxcvalidator PRIVATE VERSION_STRING_SUFFIX=" for ${CMAKE_SYSTEM_NAME}") diff --git a/tools/clang/tools/dxildll/CMakeLists.txt b/tools/clang/tools/dxildll/CMakeLists.txt index 67a24d11074..2861d258cd3 100644 --- a/tools/clang/tools/dxildll/CMakeLists.txt +++ b/tools/clang/tools/dxildll/CMakeLists.txt @@ -41,7 +41,7 @@ set(sources dxcvalidator.cpp ) -if (WIN32) +if (MSVC) add_clang_library(dxildll SHARED ${sources}) list(APPEND DXCLibs kernel32.lib @@ -77,7 +77,7 @@ if (WIN32) set_target_properties(${target_name} PROPERTIES SOURCES "${sources}") set_property(SOURCE dxildll.rc PROPERTY COMPILE_DEFINITIONS "INCLUDE_HLSL_VERSION_FILE=1") - set_property(SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "/I" "${HLSL_VERSION_LOCATION}" "/I" "${LLVM_MAIN_SRC_DIR}") + set_property(SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "-I" "${HLSL_VERSION_LOCATION}" "-I" "${LLVM_MAIN_SRC_DIR}") endif() set_target_properties(dxildll diff --git a/tools/clang/tools/dxl/CMakeLists.txt b/tools/clang/tools/dxl/CMakeLists.txt index d3f123aad3c..8305e06047a 100644 --- a/tools/clang/tools/dxl/CMakeLists.txt +++ b/tools/clang/tools/dxl/CMakeLists.txt @@ -24,6 +24,10 @@ target_link_libraries(dxl dxcompiler ) +if (MINGW) + target_link_options(dxl PRIVATE -mconsole -municode) +endif() + set_target_properties(dxl PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) if (MSVC) diff --git a/tools/clang/tools/dxr/CMakeLists.txt b/tools/clang/tools/dxr/CMakeLists.txt index f0d22283347..2d7e9ed6ec2 100644 --- a/tools/clang/tools/dxr/CMakeLists.txt +++ b/tools/clang/tools/dxr/CMakeLists.txt @@ -19,6 +19,10 @@ target_link_libraries(dxr dxcompiler ) +if (MINGW) + target_link_options(dxr PRIVATE -mconsole -municode) +endif() + set_target_properties(dxr PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) # set_target_properties(dxr PROPERTIES ENABLE_EXPORTS 1)