aboutsummaryrefslogtreecommitdiffstats
path: root/testing/llvm/llvm-uclibc-errno-fsckery.patch
blob: a7335f2684c3c46db8915b8e9eb3ec494b41ffeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
--- llvm-2.8/lib/Support/CommandLine.cpp
+++ llvm-2.8.mod/lib/Support/CommandLine.cpp
@@ -31,7 +31,10 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Config/config.h"
-#include <cerrno>
+
+#include <asm-generic/errno-base.h>
+extern __thread int errno;
+
 #include <cstdlib>
 using namespace llvm;
 using namespace cl;
--- llvm-2.8/lib/Support/raw_ostream.cpp
+++ llvm-2.8.mod/lib/Support/raw_ostream.cpp
@@ -22,7 +22,10 @@
 #include "llvm/System/Signals.h"
 #include "llvm/ADT/STLExtras.h"
 #include <cctype>
-#include <cerrno>
+
+#include <asm-generic/errno-base.h>
+extern __thread int errno;
+
 #include <sys/stat.h>
 #include <sys/types.h>
 
--- llvm-2.8/lib/System/Errno.cpp
+++ llvm-2.8.mod/lib/System/Errno.cpp
@@ -14,13 +14,11 @@
 #include "llvm/System/Errno.h"
 #include "llvm/Config/config.h"     // Get autoconf configuration settings
 
+extern __thread int errno;
+
 #if HAVE_STRING_H
 #include <string.h>
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
 //===----------------------------------------------------------------------===//
 //=== WARNING: Implementation here must contain only TRULY operating system
 //===          independent code.
@@ -29,11 +27,9 @@
 namespace llvm {
 namespace sys {
 
-#if HAVE_ERRNO_H
 std::string StrError() {
   return StrError(errno);
 }
-#endif  // HAVE_ERRNO_H
 
 std::string StrError(int errnum) {
   const int MaxErrStrLen = 2000;
--- llvm-2.8/lib/System/Unix/Unix.h
+++ llvm-2.8.mod/lib/System/Unix/Unix.h
@@ -24,7 +24,10 @@
 #include <cstdlib>
 #include <cstdio>
 #include <cstring>
-#include <cerrno>
+
+#include <asm-generic/errno-base.h>
+extern __thread int errno;
+
 #include <string>
 #include <algorithm>
 
--- llvm-2.8/utils/TableGen/TGLexer.cpp
+++ llvm-2.8.mod/utils/TableGen/TGLexer.cpp
@@ -19,7 +19,10 @@
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
-#include <cerrno>
+
+#include <asm-generic/errno-base.h>
+extern __thread int errno;
+
 using namespace llvm;
 
 TGLexer::TGLexer(SourceMgr &SM) : SrcMgr(SM) {