Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm] update to 11.0.0 #13998

Merged
merged 23 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3070841
[vcpkg] allow to use semicolons in COMMAND argument
yurybura Oct 12, 2020
b5c6e54
[llvm] update to 11.0.0
yurybura Oct 12, 2020
80209b5
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Oct 14, 2020
3b8885e
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Oct 15, 2020
5c9b03a
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Oct 26, 2020
5ea490a
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Nov 3, 2020
4fef3c8
[vcpkg] use latest version
yurybura Nov 3, 2020
9bd86e5
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Nov 13, 2020
a6ef450
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Nov 18, 2020
3a477f7
[vcpkg] allow to use semicolons in OPTIONS
yurybura Nov 18, 2020
bb44adb
fix vcpkg_fixup_cmake_targets
strega-nil Nov 19, 2020
c8f0609
[llvm] fix more install paths, add /bigobj option, fix up CMake targets
yurybura Nov 20, 2020
0ad9fec
Apply suggestions from code review
strega-nil Nov 20, 2020
9ac70a5
[llvm] fix clang, flang, lld, mlir and polly CMake targets
yurybura Nov 21, 2020
267ab39
[llvm] remove empty include directory /include/flang/Config
yurybura Nov 21, 2020
d857bf5
[llvm] Flang requires C++17
yurybura Nov 21, 2020
a0f0ccc
[llvm] add /Zc:__cplusplus
yurybura Nov 22, 2020
f802b33
[llvm] remove empty include directory include/clang-tidy/plugin
yurybura Nov 22, 2020
a65a22b
Merge branch 'master' of https://github.com/microsoft/vcpkg into llvm
yurybura Nov 24, 2020
814cb41
[llvm] try to fix ClangConfig.cmake, LLVMConfig.cmake, LLDConfig.cmak…
yurybura Nov 24, 2020
b908e46
[llvm] set tools install dir to tools/llvm
yurybura Nov 26, 2020
5e6c675
[aws-sdk-cpp] fix build after changes in vcpkg_configure_cmake.cmake
yurybura Nov 27, 2020
9d8a48f
[llvm] disable Flang and OpenMP on Windows
yurybura Nov 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/aws-sdk-cpp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: aws-sdk-cpp
Version: 1.8.83
Port-Version: 1
Port-Version: 2
Homepage: https://github.com/aws/aws-sdk-cpp
Description: AWS SDK for C++
Build-Depends: openssl (!uwp&!windows), curl (!uwp&!windows), aws-c-event-stream
Expand Down
4 changes: 1 addition & 3 deletions ports/aws-sdk-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ set(BUILD_ONLY core)

include(${CMAKE_CURRENT_LIST_DIR}/compute_build_only.cmake)

string(REPLACE ";" "\\\\\\\\\\;" BUILD_ONLY "${BUILD_ONLY}")

if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
set(rpath "@loader_path")
else()
Expand All @@ -31,7 +29,7 @@ vcpkg_configure_cmake(
-DENABLE_TESTING=OFF
-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT}
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
-DBUILD_ONLY=${BUILD_ONLY}
"-DBUILD_ONLY=${BUILD_ONLY}"
-DBUILD_DEPS=OFF
-DCMAKE_INSTALL_RPATH=${rpath}
)
Expand Down
31 changes: 31 additions & 0 deletions ports/llvm/0001-add-msvc-options.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
llvm/cmake/modules/HandleLLVMOptions.cmake | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 5ef22eb493ba..3e2f372e80c9 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -426,6 +426,12 @@ if( MSVC )

append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

+ # Some projects use the __cplusplus preprocessor macro to check support for
+ # a particular version of the C++ standard. When this option is not specified
+ # explicitly, macro's value is "199711L" that implies C++98 Standard.
+ # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+ append("/Zc:__cplusplus" CMAKE_CXX_FLAGS)
+
# Allow users to request PDBs in release mode. CMake offeres the
# RelWithDebInfo configuration, but it uses different optimization settings
# (/Ob1 vs /Ob2 or -O2 vs -O3). LLVM provides this flag so that users can get
@@ -478,6 +484,10 @@ if( MSVC )
endif()
endif()
endif()
+ # By default MSVC has a 2^16 limit on the number of sections in an object file,
+ # but in many objects files need more than that. This flag is to increase the
+ # number of sections.
+ append("/bigobj" CMAKE_CXX_FLAGS)
endif( MSVC )

# Warnings-as-errors handling for GCC-compatible compilers:
30 changes: 0 additions & 30 deletions ports/llvm/0001-allow-to-use-commas.patch

This file was deleted.

70 changes: 70 additions & 0 deletions ports/llvm/0002-fix-install-paths.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,58 @@ index d233f552f01..26f502ad2d2 100644
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")

get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt
index d233f552f01..26f502ad2d2 100644
--- a/flang/cmake/modules/CMakeLists.txt
+++ b/flang/cmake/modules/CMakeLists.txt
@@ -1,11 +1,11 @@
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
-set(FLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/flang)
+set(FLANG_INSTALL_PACKAGE_DIR share/flang)
set(flang_cmake_builddir "${CMAKE_BINARY_DIR}/${FLANG_INSTALL_PACKAGE_DIR}")

# Keep this in sync with llvm/cmake/CMakeLists.txt!
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")

get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS)
diff --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt
index d233f552f01..26f502ad2d2 100644
--- a/lld/cmake/modules/CMakeLists.txt
+++ b/lld/cmake/modules/CMakeLists.txt
@@ -1,11 +1,11 @@
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
-set(LLD_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/lld)
+set(LLD_INSTALL_PACKAGE_DIR share/lld)
set(lld_cmake_builddir "${CMAKE_BINARY_DIR}/${LLD_INSTALL_PACKAGE_DIR}")

# Keep this in sync with llvm/cmake/CMakeLists.txt!
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")

get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 211f9551271..2abe3803f91 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -973,10 +973,10 @@
if(ARG_GEN_CONFIG)

## Part 1: Extension header to be included whenever we need extension
# processing.
- set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+ set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
file(WRITE
"${llvm_cmake_builddir}/LLVMConfigExtensions.cmake"
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
install(FILES
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 9cf22b436fa..8eeb27d1794 100644
--- a/llvm/cmake/modules/CMakeLists.txt
Expand All @@ -26,6 +78,24 @@ index 9cf22b436fa..8eeb27d1794 100644
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")

# First for users who use an installed LLVM, create the LLVMExports.cmake file.
diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index d233f552f01..26f502ad2d2 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -1,11 +1,11 @@
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
-set(MLIR_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir)
+set(MLIR_INSTALL_PACKAGE_DIR share/mlir)
set(mlir_cmake_builddir "${CMAKE_BINARY_DIR}/${MLIR_INSTALL_PACKAGE_DIR}")

# Keep this in sync with llvm/cmake/CMakeLists.txt!
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")

get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt
index 211f9551271..2abe3803f91 100644
--- a/polly/cmake/CMakeLists.txt
Expand Down
22 changes: 22 additions & 0 deletions ports/llvm/0003-fix-openmp-debug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 81275c0483d..61468e048ec 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -136,7 +136,7 @@ libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS)
add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})

set_target_properties(omp PROPERTIES
- PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}"
+ PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}" DEBUG_POSTFIX ""
LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}"
LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
)
@@ -215,7 +215,7 @@ if(WIN32)
# Create new import library that is just the previously created one + kmp_import.cpp
add_library(ompimp STATIC ${LIBOMP_GENERATED_IMP_LIB} kmp_import.cpp)
set_target_properties(ompimp PROPERTIES
- PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}"
+ PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" DEBUG_POSTFIX ""
LINKER_LANGUAGE C
)
add_dependencies(ompimp omp) # ensure generated import library is created first
15 changes: 0 additions & 15 deletions ports/llvm/0003-fix-vs2019-v16.6.patch

This file was deleted.

39 changes: 39 additions & 0 deletions ports/llvm/0006-workaround-msvc-bug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
--- a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
@@ -10,6 +10,17 @@
//
//===----------------------------------------------------------------------===//

+// Disable optimizations to work around MSVC debug mode bug in 32-bit:
+// https://developercommunity.visualstudio.com/content/problem/1179643/msvc-copies-overaligned-non-trivially-copyable-par.html
+// FIXME: Remove this when the issue is closed.
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86)
+// We have to disable runtime checks in order to enable optimizations. This is
+// done for the entire file because the problem is actually observed in STL
+// template functions.
+#pragma runtime_checks("", off)
+#pragma optimize("gs", on)
+#endif
+
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"

using namespace llvm;
diff --git a/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp b/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
--- a/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
@@ -406,3 +406,13 @@
32, 8, AtomicOrdering::NotAtomic }));
}
}
+
+// This code sequence doesn't do anything, but it covers a previously uncovered
+// codepath that used to crash in MSVC x86_32 debug mode.
+TEST(LegalizerInfoTest, MSVCDebugMiscompile) {
+ const LLT S1 = LLT::scalar(1);
+ const LLT P0 = LLT::pointer(0, 32);
+ LegalizerInfo LI;
+ auto Builder = LI.getActionDefinitionsBuilder(TargetOpcode::G_PTRTOINT);
+ (void)Builder.legalForCartesianProduct({S1}, {P0});
+}

23 changes: 17 additions & 6 deletions ports/llvm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Source: llvm
Version: 10.0.0
Port-Version: 7
Version: 11.0.0
Homepage: https://llvm.org/
Description: The LLVM Compiler Infrastructure
Supports: !uwp
Expand All @@ -18,7 +17,7 @@ Build-Depends: llvm[core,target-x86] (x86|x64), llvm[core,target-arm] (arm&!arm6

Feature: target-all
Description: Build with all backends.
Build-Depends: llvm[core,target-aarch64,target-amdgpu,target-arm,target-bpf,target-hexagon,target-lanai,target-mips,target-msp430,target-nvptx,target-powerpc,target-riscv,target-sparc,target-systemz,target-webassembly,target-x86,target-xcore]
Build-Depends: llvm[core,target-aarch64,target-amdgpu,target-arm,target-avr,target-bpf,target-hexagon,target-lanai,target-mips,target-msp430,target-nvptx,target-powerpc,target-riscv,target-sparc,target-systemz,target-webassembly,target-x86,target-xcore]

Feature: target-aarch64
Description: Build with AArch64 backend.
Expand All @@ -29,6 +28,9 @@ Description: Build with AMDGPU backend.
Feature: target-arm
Description: Build with ARM backend.

Feature: target-avr
Description: Build with AVR backend.

Feature: target-bpf
Description: Build with BPF backend.

Expand Down Expand Up @@ -95,14 +97,23 @@ Description: Build Clang tools.
Feature: compiler-rt
Description: Build compiler's runtime libraries.

Feature: flang
Description: Build Fortran front end.
Build-Depends: llvm[core,mlir]

Feature: lld
Description: Build LLVM linker.

Feature: openmp
Description: Build LLVM OpenMP libraries.

Feature: lldb
Description: Build LLDB debugger.

Feature: mlir
Description: Build Multi-Level IR Compiler Framework.

Feature: openmp
Description: Build LLVM OpenMP libraries.
Build-Depends: llvm[core,utils]

Feature: polly
Description: Build polyhedral optimizations for LLVM.
Build-Depends: llvm[core,utils]
Loading