Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 701716

Summary: dev-util/bazel-0.24.1 with net-libs/grpc-version? and sys-libs/glibc-2.30 - third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
Product: Gentoo Linux Reporter: Harris Landgarten <harrisl>
Component: Current packagesAssignee: Zac Medico <zmedico>
Status: RESOLVED DUPLICATE    
Severity: normal CC: axl, perfinion
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/bazelbuild/bazel/issues/10285
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to fix glibc-2.30 failures with all bazel versions in tree.

Description Harris Landgarten 2019-12-02 05:06:52 UTC
The issue is referenced in: https://github.com/davido/bazel/commit/f10cd50f2e7f58c6acf1fb1b2ee970281e937446

which fixes the issue and was committed 10 days ago.

building of bazel-0.24.1 fails with:third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'

because of this issue.

This does not allow sci-libs/tensorflow-2.0.0 to be built.
Comment 1 Harris Landgarten 2019-12-03 04:47:05 UTC
note: This bug prevents all version of bazel and all versions of tensorflow to fail to build with any version of grpc on my system. Failures started after upgrade to glibc-2.30
Comment 2 Alexandru N. Barloiu 2019-12-05 03:08:37 UTC
ERROR: /ramfs/portage/dev-util/bazel-0.27.2/work/third_party/grpc/BUILD:386:1: C++ compilation of rule '//third_party/grpc:gpr_base' failed (Exit 1): gcc failed: error executing command 
  (cd /ramfs/portage/dev-util/bazel-0.27.2/temp/bazel_KWhVSMm6/out/execroot/io_bazel && \
  exec env - \
    LD_LIBRARY_PATH=/opt/icedtea-bin-3.13.0/jre/lib/amd64/:/opt/icedtea-bin-3.13.0/jre/lib/amd64/server/ \
    PATH=/opt/icedtea-bin-3.13.0/bin:/usr/lib/portage/python3.6/ebuild-helpers/xattr:/usr/lib/portage/python3.6/ebuild-helpers:/usr/lib/llvm/9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/opt/cuda/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.d '-frandom-seed=bazel-out/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.o' '-DGRPC_ARES=0' -iquote . -iquote bazel-out/k8-opt/bin -isystem third_party/grpc -isystem bazel-out/k8-opt/bin/third_party/grpc -isystem third_party/grpc/include -isystem bazel-out/k8-opt/bin/third_party/grpc/include '-mtune=skylake-avx512' '-march=skylake-avx512' -O2 -pipe '-mtune=skylake-avx512' '-march=skylake-avx512' -O2 -pipe -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c third_party/grpc/src/core/lib/gpr/log_linux.cc -o bazel-out/k8-opt/bin/third_party/grpc/_objs/gpr_base/log_linux.o)
Execution platform: //:default_host_platform
third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from third_party/grpc/src/core/lib/gpr/log_linux.cc:41:
/usr/include/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
third_party/grpc/src/core/lib/gpr/log_linux.cc:43:13: warning: 'long int gettid()' defined but not used [-Wunused-function]
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 38.248s, Critical Path: 33.29s
INFO: 1223 processes: 1223 local.


It's not error per say. It is cause by the argument -Wunused-but-set-parameter since gettid is unused. You can comment the line out or remove -Wunused-but-set-parameter. after that the package will merge just fine.
Comment 3 Harris Landgarten 2019-12-07 05:13:50 UTC
this bug is actually in all versions of bazel and should be renamed to dev-util/bazel will not build with glibc-2.30


the files in third_party/grpc/src have not been patched for glibc-2.30

applying the patch in dev-python/grpcio/files/grpc-1.22.1-glibc-2.30-compat.patch

to work/third_party in the bazel work directory allows bazel to build.
Comment 4 Harris Landgarten 2019-12-08 03:59:51 UTC
Created attachment 598870 [details, diff]
patch to fix glibc-2.30 failures with all bazel versions in tree.

this patch or equiv should be added to all bazel version in the tree
Comment 5 Zac Medico gentoo-dev 2019-12-09 06:19:29 UTC

*** This bug has been marked as a duplicate of bug 693986 ***