incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

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

Open sedimentation-fault opened this issue 5 years ago • 6 comments

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 avatar Sep 18 '20 16:09 sedimentation-fault

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

sedimentation-fault avatar Sep 18 '20 22:09 sedimentation-fault

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?

Lofesa avatar Sep 20 '20 10:09 Lofesa

This sounds like https://github.com/tensorflow/tensorflow/issues/33758

oschaaf avatar Sep 21 '20 06:09 oschaaf

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

BigeYoung avatar Nov 27 '20 09:11 BigeYoung

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

arunvc avatar Jan 04 '22 05:01 arunvc

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.

beobungbu avatar Sep 15 '22 14:09 beobungbu