Bug 1765931 [wpt PR 33748] - Fix line cache for simplified layout, a=testonly
[gecko.git] / build / build-clang / revert-llvmorg-14-init-14141-gd6d3000a2f6d.patch
blob5a8fb5e70186b35d39a9604c263ea0fd79a82b97
1 From e602ffe1785cef7f5502223e81345e6b9395fae1 Mon Sep 17 00:00:00 2001
2 From: Mike Hommey <mh@glandium.org>
3 Date: Fri, 11 Mar 2022 10:38:51 +0900
4 Subject: [PATCH] Revert "[CMake][WinMsvc] Fix user passed compiler/linker
5 flags"
7 This reverts commit d6d3000a2f6d88ac73e5d4da4005ceadec788a9a
8 because of bustage building 32-bits compiler-rt for Windows.
9 See https://reviews.llvm.org/D116709#3374131
10 ---
11 llvm/cmake/platforms/WinMsvc.cmake | 30 ++++++++++++++++++++++--------
12 1 file changed, 22 insertions(+), 8 deletions(-)
14 diff --git a/llvm/cmake/platforms/WinMsvc.cmake b/llvm/cmake/platforms/WinMsvc.cmake
15 index d30701a31858..9a5078894182 100644
16 --- a/llvm/cmake/platforms/WinMsvc.cmake
17 +++ b/llvm/cmake/platforms/WinMsvc.cmake
18 @@ -84,7 +84,6 @@
19 # up a VFS overlay for the SDK headers and case-correcting symlinks for the
20 # libraries when running on a case-sensitive filesystem.
22 -include_guard(GLOBAL)
24 # When configuring CMake with a toolchain file against a top-level CMakeLists.txt,
25 # it will actually run CMake many times, once for each small test program used to
26 @@ -252,8 +251,6 @@ list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_ASM_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/b
27 list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_C_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/bin/clang")
28 list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_CXX_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/bin/clang++")
30 -# These flags are used during build time. So if CFLAGS/CXXFLAGS/LDFLAGS is set
31 -# for the target, makes sure these are unset during build time.
32 set(CROSS_TOOLCHAIN_FLAGS_NATIVE "${_CTF_NATIVE_DEFAULT}" CACHE STRING "")
34 set(COMPILE_FLAGS
35 @@ -280,8 +277,18 @@ if(case_sensitive_filesystem)
36 endif()
38 string(REPLACE ";" " " COMPILE_FLAGS "${COMPILE_FLAGS}")
39 -string(APPEND CMAKE_C_FLAGS_INIT " ${COMPILE_FLAGS}")
40 -string(APPEND CMAKE_CXX_FLAGS_INIT " ${COMPILE_FLAGS}")
42 +# We need to preserve any flags that were passed in by the user. However, we
43 +# can't append to CMAKE_C_FLAGS and friends directly, because toolchain files
44 +# will be re-invoked on each reconfigure and therefore need to be idempotent.
45 +# The assignments to the _INITIAL cache variables don't use FORCE, so they'll
46 +# only be populated on the initial configure, and their values won't change
47 +# afterward.
48 +set(_CMAKE_C_FLAGS_INITIAL "${CMAKE_C_FLAGS}" CACHE STRING "")
49 +set(CMAKE_C_FLAGS "${_CMAKE_C_FLAGS_INITIAL} ${COMPILE_FLAGS}" CACHE STRING "" FORCE)
51 +set(_CMAKE_CXX_FLAGS_INITIAL "${CMAKE_CXX_FLAGS}" CACHE STRING "")
52 +set(CMAKE_CXX_FLAGS "${_CMAKE_CXX_FLAGS_INITIAL} ${COMPILE_FLAGS}" CACHE STRING "" FORCE)
54 set(LINK_FLAGS
55 # Prevent CMake from attempting to invoke mt.exe. It only recognizes the slashed form and not the dashed form.
56 @@ -305,9 +312,16 @@ if(case_sensitive_filesystem)
57 endif()
59 string(REPLACE ";" " " LINK_FLAGS "${LINK_FLAGS}")
60 -string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${LINK_FLAGS}")
61 -string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " ${LINK_FLAGS}")
62 -string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${LINK_FLAGS}")
64 +# See explanation for compiler flags above for the _INITIAL variables.
65 +set(_CMAKE_EXE_LINKER_FLAGS_INITIAL "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "")
66 +set(CMAKE_EXE_LINKER_FLAGS "${_CMAKE_EXE_LINKER_FLAGS_INITIAL} ${LINK_FLAGS}" CACHE STRING "" FORCE)
68 +set(_CMAKE_MODULE_LINKER_FLAGS_INITIAL "${CMAKE_MODULE_LINKER_FLAGS}" CACHE STRING "")
69 +set(CMAKE_MODULE_LINKER_FLAGS "${_CMAKE_MODULE_LINKER_FLAGS_INITIAL} ${LINK_FLAGS}" CACHE STRING "" FORCE)
71 +set(_CMAKE_SHARED_LINKER_FLAGS_INITIAL "${CMAKE_SHARED_LINKER_FLAGS}" CACHE STRING "")
72 +set(CMAKE_SHARED_LINKER_FLAGS "${_CMAKE_SHARED_LINKER_FLAGS_INITIAL} ${LINK_FLAGS}" CACHE STRING "" FORCE)
74 # CMake populates these with a bunch of unnecessary libraries, which requires
75 # extra case-correcting symlinks and what not. Instead, let projects explicitly
76 --
77 2.35.0.1.g829a698654