aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-framework/tensorflow/files/0001-grpc-Define-gettid-only-for-glibc-2.30.patch
blob: 89dff126fb85ef94c5ccaa0fef936ec294e2c6e4 (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
87
88
89
From 7bf3f05197bb6d71beba9dcd0ac83ddfcf7f1919 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 23 Aug 2019 13:54:52 +0000
Subject: [PATCH] grpc: Define gettid() only for glibc < 2.30

glibc 2.30 has added this API, so let us use that when possible

Upstream-Status: Pending

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 tensorflow/workspace.bzl                      |  1 +
 ...01-Define-gettid-only-for-glibc-2.30.patch | 52 +++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 third_party/systemlibs/0001-Define-gettid-only-for-glibc-2.30.patch

diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 788eca2f67..8a37fe5643 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -475,6 +475,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
         sha256 = "1aa84387232dda273ea8fdfe722622084f72c16f7b84bfc519ac7759b71cdc91",
         strip_prefix = "grpc-69b6c047bc767b4d80e7af4d00ccb7c45b683dae",
         system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"),
+        patch_file = clean_dep("//third_party/systemlibs:0001-Define-gettid-only-for-glibc-2.30.patch"),
         urls = [
             "https://mirror.bazel.build/github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz",
             "https://github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz",
diff --git a/third_party/systemlibs/0001-Define-gettid-only-for-glibc-2.30.patch b/third_party/systemlibs/0001-Define-gettid-only-for-glibc-2.30.patch
new file mode 100644
index 0000000000..30f1d7b252
--- /dev/null
+++ b/third_party/systemlibs/0001-Define-gettid-only-for-glibc-2.30.patch
@@ -0,0 +1,52 @@
+From 1d630079c3d1013baebd19060f4e6050112cb66d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 23 Aug 2019 13:52:01 +0000
+Subject: [PATCH] Define gettid() only for glibc < 2.30
+
+glibc 2.30 has added this API, so let us use that when possible
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/core/lib/gpr/log_linux.cc          | 4 ++++
+ src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
+index 561276f..25a7486 100644
+--- a/src/core/lib/gpr/log_linux.cc
++++ b/src/core/lib/gpr/log_linux.cc
+@@ -40,7 +40,11 @@
+ #include <time.h>
+ #include <unistd.h>
+ 
++#if defined(__GLIBC__) && (__GLIBC_MINOR__ >= 29)
++#include <unistd.h>
++#else
+ static long gettid(void) { return syscall(__NR_gettid); }
++#endif
+ 
+ void gpr_log(const char* file, int line, gpr_log_severity severity,
+              const char* format, ...) {
+diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
+index 06a382c..ec321f2 100644
+--- a/src/core/lib/iomgr/ev_epollex_linux.cc
++++ b/src/core/lib/iomgr/ev_epollex_linux.cc
+@@ -1150,8 +1150,12 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
+ }
+ 
+ #ifndef NDEBUG
++#if defined(__GLIBC__) && (__GLIBC_MINOR__ >= 29)
++#include <unistd.h>
++#else
+ static long gettid(void) { return syscall(__NR_gettid); }
+ #endif
++#endif
+ 
+ /* pollset->mu lock must be held by the caller before calling this.
+    The function pollset_work() may temporarily release the lock (pollset->po.mu)
+-- 
+2.17.1
+
-- 
2.17.1