Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

error: conflicting types for 'gettid' - in third_party/grpc/src/src/core/lib/support/log_linux.c:42:13 #2040

Open
sedimentation-fault opened this issue Sep 18, 2020 · 6 comments

Comments

@sedimentation-fault
Copy link

Problem

I have followed the instructions at

build mod_pagespeed from source

to build pagespeed from source in a Gentoo Linux system. During execution of

make BUILDTYPE=Release mod_pagespeed_test pagespeed_automatic_test

I got the error:

  CC(target) out/Release/obj.target/gpr/third_party/grpc/src/src/core/lib/support/log_linux.o
third_party/grpc/src/src/core/lib/support/log_linux.c:42:13: error: conflicting types for 'gettid'
   42 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from third_party/grpc/src/src/core/lib/support/log_linux.c:40:
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
make: *** [third_party/grpc/gpr.target.mk:345: out/Release/obj.target/gpr/third_party/grpc/src/src/core/lib/support/log_linux.o] Error 1

Reason

It seems that the error is related to the version of the compiler used (gcc 9.3.0), as the following patch shows: #18950

Solution

Either incorporate the changes of the mentioned patch, or insert some suggestion about the upper bound of gcc version that can compile your grpc version without errors. It would also be helpful if you could provide some configure script that will search the system for existing libraries and build the Makefiles. For example, grpc IS already installed on my system (version 1.26.0).

@sedimentation-fault
Copy link
Author

Tried with gcc 7.3.0, 7.5.0 and 8.3.0 (in addition to 9.3.0 above) but the error persisted...

@Lofesa
Copy link
Contributor

Lofesa commented Sep 20, 2020

Hi
Last time I have compiled the module was 7/1/2020 with gcc 9.3 in a Centos 7 and have no issues.
Maybe the problem come for using files from your local copy of grpc?

@oschaaf
Copy link
Member

oschaaf commented Sep 21, 2020

This sounds like tensorflow/tensorflow#33758

@BigeYoung
Copy link

same problem when I run pecl install grpc-1.6.0 on ubuntu 20.04

@arunvc
Copy link

arunvc commented Jan 4, 2022

Pagespeed build failed on httpd-2.4.51-bullseye docker image and above, due to above error,
httpd-2.4.50-buster is the last working docker version

@beobungbu
Copy link

beobungbu commented Sep 15, 2022

Any solution to fix this issue ?
aws ec2 running ubuntu 20.04, checkout source code from the master branch, build with --devel --psol-from-source
third_party/grpc/src/src/core/lib/support/log_linux.c:42:13: error: conflicting types for ‘gettid’ 42 | static long gettid(void) { return syscall(__NR_gettid); } | ^~~~~~ In file included from /usr/include/unistd.h:1170, from third_party/grpc/src/src/core/lib/support/log_linux.c:40: /usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here 34 | extern __pid_t gettid (void) __THROW; | ^~~~~~ make[1]: *** [third_party/grpc/gpr.target.mk:345: out/Debug/obj.target/gpr/third_party/grpc/src/src/core/lib/support/log_linux.o] Error 1 make: *** [Makefile:314: apache_debug] Error 2 Error: Failure running 'make apache_debug_psol', exiting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants