summarylogtreecommitdiffstats
path: root/gcc1.diff
blob: 3c06a0103b19b7b95792338117ab8ff4fe9a6413 (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
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 44a95d6bad..0fb9e9fd29 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -461,6 +461,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
       ],
       sha256 = "895b31310e718a61f7335759a778c068a6edde1c089883598a0830cbb7075673",
       strip_prefix = "grpc-d184fa229d75d336aedea0041bd59cb93e7e267f",
+      patch_file = clean_dep("//third_party/grpc:gcc9.patch"),
   )
 
 
diff --git a/third_party/grpc/gcc9.patch b/third_party/grpc/gcc9.patch
new file mode 100644
index 0000000000..9a3d737ab0
--- /dev/null
+++ b/third_party/grpc/gcc9.patch
@@ -0,0 +1,63 @@
+diff -ruN a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
+--- a/src/core/lib/gpr/log_linux.cc	2018-04-13 17:28:21.000000000 +0200
++++ b/src/core/lib/gpr/log_linux.cc	2019-10-23 21:32:10.956028386 +0200
+@@ -40,7 +40,7 @@
+ #include <time.h>
+ #include <unistd.h>
+ 
+-static long gettid(void) { return syscall(__NR_gettid); }
++static long sys_gettid(void) { return syscall(__NR_gettid); }
+ 
+ void gpr_log(const char* file, int line, gpr_log_severity severity,
+              const char* format, ...) {
+@@ -70,7 +70,7 @@
+   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
+   struct tm tm;
+   static __thread long tid = 0;
+-  if (tid == 0) tid = gettid();
++  if (tid == 0) tid = sys_gettid();
+ 
+   timer = static_cast<time_t>(now.tv_sec);
+   final_slash = strrchr(args->file, '/');
+diff -ruN a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
+--- a/src/core/lib/gpr/log_posix.cc	2018-04-13 17:28:21.000000000 +0200
++++ b/src/core/lib/gpr/log_posix.cc	2019-10-23 21:30:10.491136918 +0200
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ #include <time.h>
+ 
+-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
++static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
+ 
+ void gpr_log(const char* file, int line, gpr_log_severity severity,
+              const char* format, ...) {
+@@ -85,7 +85,7 @@
+   char* prefix;
+   gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
+                gpr_log_severity_string(args->severity), time_buffer,
+-               (int)(now.tv_nsec), gettid(), display_file, args->line);
++               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
+ 
+   fprintf(stderr, "%-70s %s\n", prefix, args->message);
+   gpr_free(prefix);
+diff -ruN a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
+--- a/src/core/lib/iomgr/ev_epollex_linux.cc	2018-04-13 17:28:21.000000000 +0200
++++ b/src/core/lib/iomgr/ev_epollex_linux.cc	2019-10-23 21:31:24.020053353 +0200
+@@ -986,7 +986,7 @@
+ }
+ 
+ #ifndef NDEBUG
+-static long gettid(void) { return syscall(__NR_gettid); }
++static long sys_gettid(void) { return syscall(__NR_gettid); }
+ #endif
+ 
+ /* pollset->mu lock must be held by the caller before calling this.
+@@ -1006,7 +1006,7 @@
+ #define WORKER_PTR (&worker)
+ #endif
+ #ifndef NDEBUG
+-  WORKER_PTR->originator = gettid();
++  WORKER_PTR->originator = sys_gettid();
+ #endif
+   if (grpc_polling_trace.enabled()) {
+     gpr_log(GPR_DEBUG,