Skip to content

Commit 5651042

Browse files
committed
llvm: Add patches for clang
1 parent 18911fb commit 5651042

File tree

3 files changed

+654
-26
lines changed

3 files changed

+654
-26
lines changed

bootstrap.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,22 @@ tools:
212212
- 'cmake'
213213
- '-GNinja'
214214
- '-DCMAKE_INSTALL_PREFIX=@PREFIX@'
215+
216+
# LLVM configuration options.
215217
# We really have to build LLVM in Release mode.
216218
# Building it in debug mode produces tens of GiB of debugging info.
217219
- '-DCMAKE_BUILD_TYPE=Release'
218220
- '-DLLVM_TARGETS_TO_BUILD=X86'
219221
- '-DLLVM_ENABLE_PROJECTS=clang'
222+
223+
# clang configuration options.
224+
- '-DDEFAULT_SYSROOT=@SYSROOT_DIR@'
220225
- '@THIS_SOURCE_DIR@/llvm'
221226
compile:
222227
- args: ['ninja']
223228
install:
224229
- args: ['ninja', 'install']
230+
quiet: true
225231

226232
# We could run an external pkg-config; however, we need the aclocal files.
227233
# The easiest way to ensure that they are available is to just install pkg-config.
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 15aac642a07214f4ddc8b9c8b304184cbfdc8ca1 Mon Sep 17 00:00:00 2001
1+
From 79b719e6b44c4b820e67ac1967286ff6b704b921 Mon Sep 17 00:00:00 2001
22
From: Alexander van der Grinten <[email protected]>
33
Date: Thu, 6 Jun 2019 17:55:59 +0200
4-
Subject: [PATCH] Managarm-specific changes
4+
Subject: [PATCH 1/2] Managarm-specific changes
55

66
---
77
llvm/cmake/modules/CrossCompile.cmake | 4 ++--
@@ -13,7 +13,7 @@ Subject: [PATCH] Managarm-specific changes
1313
6 files changed, 9 insertions(+), 6 deletions(-)
1414

1515
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
16-
index 0ec76ead5..d03c1fd7b 100644
16+
index bc3b210f0..568aeddc8 100644
1717
--- a/llvm/cmake/modules/CrossCompile.cmake
1818
+++ b/llvm/cmake/modules/CrossCompile.cmake
1919
@@ -11,8 +11,8 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)
@@ -28,7 +28,7 @@ index 0ec76ead5..d03c1fd7b 100644
2828
endif()
2929
set(CROSS_TOOLCHAIN_FLAGS_${target_name} ${CROSS_TOOLCHAIN_FLAGS_INIT}
3030
diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h
31-
index a4b0a340c..0f6650baf 100644
31+
index 57c79c0b9..d0eb55f30 100644
3232
--- a/llvm/include/llvm/Support/Host.h
3333
+++ b/llvm/include/llvm/Support/Host.h
3434
@@ -16,7 +16,7 @@
@@ -41,19 +41,19 @@ index a4b0a340c..0f6650baf 100644
4141
#elif defined(_AIX)
4242
#include <sys/machine.h>
4343
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
44-
index 2ecb97316..b04065718 100644
44+
index d7cc0d627..86bce3979 100644
4545
--- a/llvm/lib/Support/Unix/Path.inc
4646
+++ b/llvm/lib/Support/Unix/Path.inc
47-
@@ -68,7 +68,7 @@
47+
@@ -56,7 +56,7 @@
4848

4949
#include <sys/types.h>
5050
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
51-
- !defined(__linux__)
52-
+ !defined(__linux__) && !defined(__managarm__)
51+
- !defined(__linux__) && !defined(__FreeBSD_kernel__)
52+
+ !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__managarm__)
5353
#include <sys/statvfs.h>
5454
#define STATVFS statvfs
5555
#define FSTATVFS fstatvfs
56-
@@ -77,7 +77,7 @@
56+
@@ -65,7 +65,7 @@
5757
#if defined(__OpenBSD__) || defined(__FreeBSD__)
5858
#include <sys/mount.h>
5959
#include <sys/param.h>
@@ -62,20 +62,20 @@ index 2ecb97316..b04065718 100644
6262
#if defined(HAVE_LINUX_MAGIC_H)
6363
#include <linux/magic.h>
6464
#else
65-
@@ -359,7 +359,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) {
65+
@@ -370,7 +370,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) {
6666
}
6767

6868
static bool is_local_impl(struct STATVFS &Vfs) {
69-
-#if defined(__linux__)
70-
+#if defined(__linux__) || defined(__managarm__)
69+
-#if defined(__linux__) || defined(__GNU__)
70+
+#if defined(__linux__) || defined(__GNU__) || defined(__managarm__)
7171
#ifndef NFS_SUPER_MAGIC
7272
#define NFS_SUPER_MAGIC 0x6969
7373
#endif
7474
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
75-
index 4f791991f..d4245be6b 100644
75+
index d0abc3763..a5910651b 100644
7676
--- a/llvm/lib/Support/Unix/Program.inc
7777
+++ b/llvm/lib/Support/Unix/Program.inc
78-
@@ -39,6 +39,7 @@
78+
@@ -40,6 +40,7 @@
7979
#if HAVE_UNISTD_H
8080
#include <unistd.h>
8181
#endif
@@ -84,26 +84,26 @@ index 4f791991f..d4245be6b 100644
8484
#include <spawn.h>
8585

8686
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp
87-
index 9a7454a52..1d076b58b 100644
87+
index 5fe7e8b46..d670cc1d6 100644
8888
--- a/llvm/tools/llvm-dwarfdump/Statistics.cpp
8989
+++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp
9090
@@ -1,3 +1,4 @@
9191
+#include <cmath>
9292
#include "llvm/ADT/DenseMap.h"
93-
#include "llvm/DebugInfo/DIContext.h"
94-
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
93+
#include "llvm/ADT/StringExtras.h"
94+
#include "llvm/ADT/StringSet.h"
9595
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
96-
index b2109c875..0e1d739ad 100644
96+
index 187066e5d..ef369e6e8 100644
9797
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
9898
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
99-
@@ -40,6 +40,7 @@ list(REMOVE_DUPLICATES LIB_NAMES)
100-
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
101-
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
102-
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
103-
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "managarm")
104-
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
105-
configure_file(
106-
${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
99+
@@ -45,6 +45,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
100+
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
101+
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
102+
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
103+
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "managarm")
104+
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
105+
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
106+
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
107107
--
108108
2.11.0
109109

0 commit comments

Comments
 (0)