-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add packages for bootstrapping Clang subsystem
- Loading branch information
Showing
24 changed files
with
2,111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From b47a00af69f3c662e54dc54e482fc9b0d4ba6480 Mon Sep 17 00:00:00 2001 | ||
From: Martell Malone <martellmalone@gmail.com> | ||
Date: Sun, 28 Jun 2015 20:14:51 +0100 | ||
Subject: [PATCH 2/5] Fix GetHostTriple for mingw-w64 in msys | ||
|
||
--- | ||
cmake/modules/GetHostTriple.cmake | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/cmake/modules/GetHostTriple.cmake b/cmake/modules/GetHostTriple.cmake | ||
index 0cad1db4eff..47e9f986e15 100644 | ||
--- a/cmake/modules/GetHostTriple.cmake | ||
+++ b/cmake/modules/GetHostTriple.cmake | ||
@@ -8,11 +8,11 @@ | ||
else() | ||
set( value "i686-pc-windows-msvc" ) | ||
endif() | ||
- elseif( MINGW AND NOT MSYS ) | ||
+ elseif( MINGW ) | ||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | ||
set( value "x86_64-w64-windows-gnu" ) | ||
else() | ||
- set( value "i686-pc-windows-gnu" ) | ||
+ set( value "i686-w64-windows-gnu" ) | ||
endif() | ||
else( MSVC ) | ||
set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess) | ||
2.13.3 | ||
|
37 changes: 37 additions & 0 deletions
37
clang/0004-llvm-config-look-for-unversioned-shared-lib-on-win32.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From 56c0371a3cbc98ef5dc039324ad43c153ff601c4 Mon Sep 17 00:00:00 2001 | ||
From: Mateusz Mikula <mati865@gmail.com> | ||
Date: Thu, 2 Feb 2017 11:48:25 +0100 | ||
Subject: [PATCH 4/5] llvm-config: look for unversioned shared lib on win32 | ||
|
||
--- | ||
tools/llvm-config/llvm-config.cpp | 8 +++++--- | ||
1 file changed, 5 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp | ||
index 08b096afb05..e388d9e5d3f 100644 | ||
--- a/tools/llvm-config/llvm-config.cpp | ||
+++ b/tools/llvm-config/llvm-config.cpp | ||
@@ -353,10 +353,11 @@ int main(int argc, char **argv) { | ||
const Triple HostTriple(Triple::normalize(LLVM_HOST_TRIPLE)); | ||
if (HostTriple.isOSWindows()) { | ||
SharedExt = "dll"; | ||
- SharedVersionedExt = LLVM_DYLIB_VERSION ".dll"; | ||
+ SharedVersionedExt = ".dll"; | ||
if (HostTriple.isOSCygMing()) { | ||
StaticExt = "a"; | ||
StaticPrefix = "lib"; | ||
+ SharedPrefix = "lib"; | ||
} else { | ||
StaticExt = "lib"; | ||
DirSep = "\\"; | ||
@@ -393,7 +393,7 @@ | ||
|
||
bool DyLibExists = false; | ||
const std::string DyLibName = | ||
- (SharedPrefix + "LLVM-" + SharedVersionedExt).str(); | ||
+ (SharedPrefix + (HostTriple.isOSWindows() ? "LLVM" : "LLVM-") + SharedVersionedExt).str(); | ||
|
||
// If LLVM_LINK_DYLIB is ON, the single shared library will be returned | ||
// for "--libs", etc, if they exist. This behaviour can be overridden with | ||
-- | ||
2.13.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Index: lib/Object/COFFObjectFile.cpp | ||
=================================================================== | ||
--- a/lib/Object/COFFObjectFile.cpp (Revision 274558) | ||
+++ b/lib/Object/COFFObjectFile.cpp (Arbeitskopie) | ||
@@ -217,6 +217,9 @@ | ||
if (Symb.isExternal() || Symb.isWeakExternal()) | ||
Result |= SymbolRef::SF_Global; | ||
|
||
+ if (Symb.isExternal()) | ||
+ Result |= SymbolRef::SF_Exported; | ||
+ | ||
if (const coff_aux_weak_external *AWE = Symb.getWeakExternal()) { | ||
Result |= SymbolRef::SF_Weak; | ||
if (AWE->Characteristics != COFF::IMAGE_WEAK_EXTERN_SEARCH_ALIAS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h | ||
=================================================================== | ||
--- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h (revision 283036) | ||
+++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h (working copy) | ||
@@ -142,8 +142,7 @@ | ||
uint64_t Result = | ||
RE.Sections.SectionA == static_cast<uint32_t>(-1) | ||
? Value | ||
- : Sections[RE.Sections.SectionA].getLoadAddressWithOffset( | ||
- RE.Addend); | ||
+ : Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend; | ||
assert(Result <= UINT32_MAX && "relocation overflow"); | ||
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset | ||
<< " RelType: IMAGE_REL_I386_DIR32" | ||
@@ -159,7 +158,7 @@ | ||
// The target's 32-bit RVA. | ||
// NOTE: use Section[0].getLoadAddress() as an approximation of ImageBase | ||
uint64_t Result = | ||
- Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend) - | ||
+ Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend - | ||
Sections[0].getLoadAddress(); | ||
assert(static_cast<int32_t>(Result) <= INT32_MAX && | ||
"relocation overflow"); | ||
Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h | ||
=================================================================== | ||
--- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h (revision 283036) | ||
+++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h (working copy) | ||
@@ -184,7 +184,7 @@ | ||
uint64_t Result = | ||
RE.Sections.SectionA == static_cast<uint32_t>(-1) | ||
? Value | ||
- : Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend); | ||
+ : Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend; | ||
Result |= ISASelectionBit; | ||
assert(Result <= UINT32_MAX && "relocation overflow"); | ||
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset | ||
@@ -229,7 +229,7 @@ | ||
case COFF::IMAGE_REL_ARM_MOV32T: { | ||
// 32-bit VA of the target applied to a contiguous MOVW+MOVT pair. | ||
uint64_t Result = | ||
- Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend); | ||
+ Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend; | ||
assert(Result <= UINT32_MAX && "relocation overflow"); | ||
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset | ||
<< " RelType: IMAGE_REL_ARM_MOV32T" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- llvm-6.0.0.src/cmake/modules/AddLLVM.cmake.orig 2018-06-01 17:52:24.905810400 +0300 | ||
+++ llvm-6.0.0.src/cmake/modules/AddLLVM.cmake 2018-06-01 17:54:31.858071700 +0300 | ||
@@ -473,7 +473,7 @@ | ||
endif() | ||
|
||
if(ARG_SHARED) | ||
- if(WIN32) | ||
+ if(MSVC) | ||
set_target_properties(${name} PROPERTIES | ||
PREFIX "" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- llvm-6.0.0.src/cmake/modules/HandleLLVMOptions.cmake.orig 2018-06-06 14:33:51.928460200 +0300 | ||
+++ llvm-6.0.0.src/cmake/modules/HandleLLVMOptions.cmake 2018-06-06 14:33:59.840471400 +0300 | ||
@@ -312,9 +312,7 @@ | ||
# Pass -mbig-obj to mingw gas on Win64. COFF has a 2**16 section limit, and | ||
# on Win64, every COMDAT function creates at least 3 sections: .text, .pdata, | ||
# and .xdata. | ||
- if (CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
- append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) | ||
- endif() | ||
+ append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) | ||
endif() | ||
|
||
if( MSVC ) |
Oops, something went wrong.