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

Bug 693986

Summary: dev-util/bazel-0.28.1 : [1Athird_party/.../ error: ambiguating new declaration of long int gettid()
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Zac Medico <zmedico>
Severity: normal CC: harrisl, hazelnusse, marien.zwart, paul, perfinion
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 691846    
Attachments: emerge-info.txt
patches for gcc-9

Description Toralf Förster gentoo-dev 2019-09-10 17:05:13 UTC
[364 / 631] checking cached actions

[1Athird_party/grpc/src/core/lib/gpr/ 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,


  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no-multilib_hardened-libressl-20190905-001552


  Please see the tracker bug for details.

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7 (fallback)
  [3]   pypy (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
Available Rust versions:
  [1]   rust-1.37.0 *
The following VMs are available for generation-2:
*)	IcedTea JDK 3.13.0 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

repository timestamp:

==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Tue, 10 Sep 2019 00:45:48 +0000

emerge -qpvO dev-util/bazel
[ebuild  N    ] dev-util/bazel-0.28.1  USE="-examples -tools"
Comment 1 Toralf Förster gentoo-dev 2019-09-10 17:05:16 UTC
Created attachment 589622 [details]
Comment 2 Toralf Förster gentoo-dev 2019-09-10 17:05:19 UTC
Created attachment 589624 [details]
Comment 3 Toralf Förster gentoo-dev 2019-09-10 17:05:21 UTC
Created attachment 589626 [details]
Comment 4 Toralf Förster gentoo-dev 2019-09-10 17:05:24 UTC
Created attachment 589628 [details]
Comment 5 Toralf Förster gentoo-dev 2019-09-10 17:05:27 UTC
Created attachment 589630 [details]
Comment 6 Toralf Förster gentoo-dev 2019-09-10 17:05:29 UTC
Created attachment 589632 [details]
Comment 7 Helmut Jarausch 2019-09-17 12:05:30 UTC
Created attachment 590068 [details, diff]
patches for gcc-9
Comment 8 Marien Zwart 2019-11-23 05:53:14 UTC
Note that gettid() is only provided by glibc as of 2.30 (see glibc's NEWS file), so I think the attached patch will not work correctly on stable glibc.
Comment 9 Bernd Feige 2019-11-23 10:29:59 UTC
(In reply to Helmut Jarausch from comment #7)
> Created attachment 590068 [details, diff] [details, diff]
> patches for gcc-9

The problem persists with current dev-util/bazel-1.2.0 and the patch still applies, as soon as is changed to in the patch header... Thanks!
Comment 10 Bernd Feige 2019-11-23 10:33:30 UTC
Note that 1.2.0-r1 should fix this as it carries a patch renaming gpr's local gettid() function:
Comment 11 David Klempner 2019-11-25 23:06:07 UTC
This was already fixed in grpc upstream, I believe around 1.24.0 timeframe:

Sadly this is a vendored version and so doesn't automatically get such fixes.
Comment 12 Paul Bors 2019-12-08 01:42:31 UTC
How do we get 1.2.0-r1?

I don't see it released in the default gentoo profile and not listed at:
Comment 13 Paul Bors 2019-12-08 01:46:00 UTC
ClearLinux has patched it this way:
Comment 14 Zac Medico gentoo-dev 2019-12-09 06:19:29 UTC
*** Bug 701716 has been marked as a duplicate of this bug. ***
Comment 15 Zac Medico gentoo-dev 2019-12-09 06:21:13 UTC
The bug has been closed via the following commit(s):

commit 27d3e4549dfcbc89442c54b4e5c602b274284203
Author:     Julius Putra Tanu Setiaji <>
AuthorDate: 2019-12-05 10:28:36 +0000
Commit:     Zac Medico <>
CommitDate: 2019-12-09 05:55:47 +0000

    dev-util/bazel: Add gRPC patch for glibc 2.30
    Package-Manager: Portage-2.3.80, Repoman-2.3.19
    Signed-off-by: Julius Putra Tanu Setiaji <>
    Signed-off-by: Zac Medico <>

 dev-util/bazel/bazel-1.2.0-r1.ebuild         | 113 +++++++++++++++++++++++++++
 dev-util/bazel/files/1.2.0-grpc-gettid.patch |  78 ++++++++++++++++++
 2 files changed, 191 insertions(+)
Comment 16 Zac Medico gentoo-dev 2019-12-09 06:21:48 UTC
*** Bug 701398 has been marked as a duplicate of this bug. ***
Comment 17 Paul Bors 2019-12-16 05:07:39 UTC
For a back-port to Bazel-0.29.1 for those who want to install Tensorflow2 with latest stable build (as of today):
Comment 18 Benda Xu gentoo-dev 2020-03-26 01:50:59 UTC
(In reply to Paul Bors from comment #17)
> For a back-port to Bazel-0.29.1 for those who want to install Tensorflow2
> with latest stable build (as of today):

Thank you Paul!  The patch has been backported to bazel-0.29.1.
Comment 19 Paul Bors 2020-03-26 02:57:49 UTC
Thanks Benda,

Promise for next contribution I make to raise a pull request myself. I just need time to go through the setup for Gentoo development in a Docker container so I don't mess up my workstation :)