Skip to content

Error compiling src/core/lib/gpr/log_linux.cc against glibc 2.30 (gettid issues) #19964

@nanonyme

Description

@nanonyme

What version of gRPC and what language are you using?

Python, grpcio 1.21.1

What operating system (Linux, Windows,...) and version?

Linux 5.2.1

What runtime / compiler are you using (e.g. python version or version of gcc)

glibc 2.30, GCC 9.2

What did you do?

Tried to pip install grpcio through source code compilation.

What did you expect to see?

Build success

What did you see instead?

    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 src/core/lib/gpr/log_linux.cc:41:
    /usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: old declaration ‘__pid_t gettid()’
       34 | extern __pid_t gettid (void) __THROW;
          |                ^~~~~~
    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); }
          |             ^~~~~~
    creating tmp
    creating tmp/tmpik7uu1ki
    x86_64-unknown-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I/usr/include/python3.7m -I/usr/include/x86_64-linux-gnu/python3.7m -c /tmp/tmpik7uu1ki/a.c -o tmp/tmpik7uu1ki/a.o
    Traceback (most recent call last):
      File "/usr/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/tmp/pip-req-build-h5jxc7hm/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
        _classic_spawn(self, command)
      File "/usr/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'x86_64-unknown-linux-gnu-gcc' failed with exit status 1

Anything else we should know about your project / environment?

gettid is available through sys/types.h with glibc 2.30 and higher http://man7.org/linux/man-pages/man2/gettid.2.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions