aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2020-04-03 10:35:15 +0800
committerHongxu Jia <hongxu.jia@windriver.com>2020-04-08 10:01:31 +0800
commit8176533262a2e92b7c5c255de40912601ff85218 (patch)
tree87d72cf4a55be9d7fe6be39c947903cdf9796445 /recipes-devtools
parent4d072cf878006238c5000257bd7dc433a721abd8 (diff)
downloadmeta-tensorflow-8176533262a2e92b7c5c255de40912601ff85218.tar.gz
meta-tensorflow-8176533262a2e92b7c5c255de40912601ff85218.tar.bz2
meta-tensorflow-8176533262a2e92b7c5c255de40912601ff85218.zip
bazel-native: fix compile failure on ubuntu1904_64
glibc 2.30 (ubuntu1904_64) will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/bazel/bazel-native_0.21.0.bb1
-rw-r--r--recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch65
2 files changed, 66 insertions, 0 deletions
diff --git a/recipes-devtools/bazel/bazel-native_0.21.0.bb b/recipes-devtools/bazel/bazel-native_0.21.0.bb
index 03c3e8d..d9ad1ea 100644
--- a/recipes-devtools/bazel/bazel-native_0.21.0.bb
+++ b/recipes-devtools/bazel/bazel-native_0.21.0.bb
@@ -7,6 +7,7 @@ SRC_URI[sha256sum] = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83
SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${PV}-dist.zip \
file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
+ file://0001-Rename-gettid-functions.patch \
"
inherit native pythonnative
diff --git a/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch b/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
new file mode 100644
index 0000000..ca37531
--- /dev/null
+++ b/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
@@ -0,0 +1,65 @@
+From a0b885aeb95a7ae9e93aea303a1edde74f71edac Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 3 Apr 2020 10:25:49 +0800
+Subject: [PATCH] Rename gettid() functions.
+
+glibc 2.30 will declare its own gettid; see
+https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92.
+Rename the grpc versions to avoid naming conflicts.
+
+Signed-off-by: Benjamin Peterson <benjamin@dropbox.com>
+Upstream-Status: Backport [https://github.com/grpc/grpc/commit/57586a1ca7f17b1916aed3dea4ff8de872dbf853]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ third_party/grpc/src/core/support/log_linux.c | 4 ++--
+ third_party/grpc/src/core/support/log_posix.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/grpc/src/core/support/log_linux.c b/third_party/grpc/src/core/support/log_linux.c
+index 93a0c1b..367c921 100755
+--- a/third_party/grpc/src/core/support/log_linux.c
++++ b/third_party/grpc/src/core/support/log_linux.c
+@@ -54,7 +54,7 @@
+ #include <sys/syscall.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, ...) {
+@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
+
+ 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, "%-60s %s\n", prefix, args->message);
+ gpr_free(prefix);
+diff --git a/third_party/grpc/src/core/support/log_posix.c b/third_party/grpc/src/core/support/log_posix.c
+index 3ff171f..f0420a7 100755
+--- a/third_party/grpc/src/core/support/log_posix.c
++++ b/third_party/grpc/src/core/support/log_posix.c
+@@ -45,7 +45,7 @@
+ #include <time.h>
+ #include <pthread.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, ...) {
+@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
+
+ fprintf(stderr, "%s%s.%09d %7tu %s:%d] %s\n",
+ 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,
+ args->message);
+ }
+
+--
+2.17.1
+