Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Graham Leggett
On 07 Jul 2020, at 15:40, [hidden email] wrote:

Author: jorton
Date: Tue Jul  7 13:40:15 2020
New Revision: 1879591

URL: http://svn.apache.org/viewvc?rev=1879591&view=rev
Log:
Check for and use gettid() directly if available; glibc 2.30 and later
provides a wrapper for the system call:

* configure.in: Check for gettid() and define HAVE_SYS_GETTID if
 gettid() is only usable via syscall().

* server/log.c (log_tid): Use gettid() directly if available.

This is not working for me on CentOS8.

./configure says this:

checking for gettid()... yes

but the build fails like this:

log.c: In function 'log_tid':
log.c:544:21: warning: implicit declaration of function 'gettid'; did you mean getgid'? [-Wimplicit-function-declaration]
         pid_t tid = gettid();
                     ^~~~~~
                     getgid

Is there maybe a missing header file needed somewhere?

MacOS says this and works:

checking for gettid()... no

Regards,
Graham


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Joe Orton
On Wed, Jul 15, 2020 at 02:58:43PM +0200, Graham Leggett wrote:

> On 07 Jul 2020, at 15:40, [hidden email] wrote:
> > Author: jorton
> > Date: Tue Jul  7 13:40:15 2020
> > New Revision: 1879591
> >
> > URL: http://svn.apache.org/viewvc?rev=1879591&view=rev
> > Log:
> > Check for and use gettid() directly if available; glibc 2.30 and later
> > provides a wrapper for the system call:
> >
> > * configure.in: Check for gettid() and define HAVE_SYS_GETTID if
> >  gettid() is only usable via syscall().
> >
> > * server/log.c (log_tid): Use gettid() directly if available.
>
> This is not working for me on CentOS8.
>
> ./configure says this:
>
> checking for gettid()... yes

Interesting, can you provide the config.log and "rpm -q glibc"?  With a
RHEL8 vm here it does not detect gettid (as I'd expect for glibc 2.28)
and builds fine.

Regards, Joe

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Ruediger Pluem
In reply to this post by Graham Leggett


On 7/15/20 2:58 PM, Graham Leggett wrote:

> On 07 Jul 2020, at 15:40, [hidden email] <mailto:[hidden email]> wrote:
>
>> Author: jorton
>> Date: Tue Jul  7 13:40:15 2020
>> New Revision: 1879591
>>
>> URL: http://svn.apache.org/viewvc?rev=1879591&view=rev
>> Log:
>> Check for and use gettid() directly if available; glibc 2.30 and later
>> provides a wrapper for the system call:
>>
>> * configure.in: Check for gettid() and define HAVE_SYS_GETTID if
>>  gettid() is only usable via syscall().
>>
>> * server/log.c (log_tid): Use gettid() directly if available.
>
> This is not working for me on CentOS8.
>
> ./configure says this:
>
> checking for gettid()... yes
>
> but the build fails like this:
>
> log.c: In function 'log_tid':
> log.c:544:21: warning: implicit declaration of function 'gettid'; did you mean getgid'? [-Wimplicit-function-declaration]
>          pid_t tid = gettid();
>                      ^~~~~~
>                      getgid
>
> Is there maybe a missing header file needed somewhere?

I guess we need to include either

linux/unistd.h

or keep including

sys/syscall.h


Regards

Rüdiger
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Ruediger Pluem


On 7/15/20 3:52 PM, Ruediger Pluem wrote:

>
>
> On 7/15/20 2:58 PM, Graham Leggett wrote:
>> On 07 Jul 2020, at 15:40, [hidden email] <mailto:[hidden email]> wrote:
>>
>>> Author: jorton
>>> Date: Tue Jul  7 13:40:15 2020
>>> New Revision: 1879591
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1879591&view=rev
>>> Log:
>>> Check for and use gettid() directly if available; glibc 2.30 and later
>>> provides a wrapper for the system call:
>>>
>>> * configure.in: Check for gettid() and define HAVE_SYS_GETTID if
>>>  gettid() is only usable via syscall().
>>>
>>> * server/log.c (log_tid): Use gettid() directly if available.
>>
>> This is not working for me on CentOS8.
>>
>> ./configure says this:
>>
>> checking for gettid()... yes
>>
>> but the build fails like this:
>>
>> log.c: In function 'log_tid':
>> log.c:544:21: warning: implicit declaration of function 'gettid'; did you mean getgid'? [-Wimplicit-function-declaration]
>>          pid_t tid = gettid();
>>                      ^~~~~~
>>                      getgid
>>
>> Is there maybe a missing header file needed somewhere?
>
> I guess we need to include either
>
> linux/unistd.h
>
> or keep including
>
> sys/syscall.h

Scratch that. Both cause the syscall stuff to be included not a glibc function.

Regards

Rüdiger


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Graham Leggett
In reply to this post by Joe Orton
On 15 Jul 2020, at 15:35, Joe Orton <[hidden email]> wrote:

checking for gettid()... yes

Interesting, can you provide the config.log and "rpm -q glibc"?  With a 
RHEL8 vm here it does not detect gettid (as I'd expect for glibc 2.28) 
and builds fine.

A quick and dirty search across config.log shows this:

[minfrin@bob httpd-trunk]$ cat config.log | grep gettid
configure:8059: checking for gettid
conftest.c:(.text+0xa): undefined reference to `gettid'
| /* Define gettid to an innocuous variant, in case <limits.h> declares gettid.
| #define gettid innocuous_gettid
|     which can conflict with char gettid (); below.
| #undef gettid
| char gettid ();
| #if defined __stub_gettid || defined __stub___gettid
| return gettid ();
configure:8107: checking for gettid() via syscall
ac_cv_func_gettid=no
ap_cv_gettid=yes

Looks like ac_cv_func_gettid is no but ap_cv_gettid is yes.

[minfrin@bob httpd-trunk]$ rpm -q glibc
glibc-2.28-72.el8_1.1.x86_64

A search for what ends up in the ap_config_auto.h shows this:

[minfrin@bob httpd-trunk]$ grep -r GETTID include/
include/ap_config_auto.h:#define HAVE_GETTID 1
include/ap_config_auto.h.in:#undef HAVE_GETTID
include/ap_config_auto.h.in:#undef HAVE_SYS_GETTID

Regards,
Graham

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Ruediger Pluem


On 7/15/20 4:03 PM, Graham Leggett wrote:

> On 15 Jul 2020, at 15:35, Joe Orton <[hidden email] <mailto:[hidden email]>> wrote:
>
>>> checking for gettid()... yes
>>
>> Interesting, can you provide the config.log and "rpm -q glibc"?  With a 
>> RHEL8 vm here it does not detect gettid (as I'd expect for glibc 2.28) 
>> and builds fine.
>
> A quick and dirty search across config.log shows this:
>
> [minfrin@bob httpd-trunk]$ cat config.log | grep gettid
> configure:8059: checking for gettid
> conftest.c:(.text+0xa): undefined reference to `gettid'
> | /* Define gettidto an innocuous variant, in case <limits.h> declares gettid.
> | #define gettidinnocuous_gettid
> |     which can conflict with char gettid(); below.
> | #undef gettid
> | char gettid();
> | #if defined __stub_gettid|| defined __stub___gettid
> | return gettid();
> configure:8107: checking for gettid() via syscall
> ac_cv_func_gettid=no
> ap_cv_gettid=yes
>
> Looks like ac_cv_func_gettid is no but ap_cv_gettid is yes.
>
> [minfrin@bob httpd-trunk]$ rpm -q glibc
> glibc-2.28-72.el8_1.1.x86_64
>
> A search for what ends up in the ap_config_auto.h shows this:
>
> [minfrin@bob httpd-trunk]$ grep -r GETTID include/
> include/ap_config_auto.h:#define HAVE_GETTID1
> include/ap_config_auto.h.in:#undef HAVE_GETTID
> include/ap_config_auto.h.in:#undef HAVE_SYS_GETTID
>

Stupid question: Did you try a make extraclean; ./buildconf before doing your build that fails?

Regards

Rüdiger

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Joe Orton
In reply to this post by Graham Leggett
On Wed, Jul 15, 2020 at 04:03:41PM +0200, Graham Leggett wrote:

> On 15 Jul 2020, at 15:35, Joe Orton <[hidden email]> wrote:
>
> >> checking for gettid()... yes
> >
> > Interesting, can you provide the config.log and "rpm -q glibc"?  With a
> > RHEL8 vm here it does not detect gettid (as I'd expect for glibc 2.28)
> > and builds fine.
>
> A quick and dirty search across config.log shows this:
>
> [minfrin@bob httpd-trunk]$ cat config.log | grep gettid
> configure:8059: checking for gettid
> conftest.c:(.text+0xa): undefined reference to `gettid'
> | /* Define gettid to an innocuous variant, in case <limits.h> declares gettid.
> | #define gettid innocuous_gettid
> |     which can conflict with char gettid (); below.
> | #undef gettid
> | char gettid ();
> | #if defined __stub_gettid || defined __stub___gettid
> | return gettid ();
> configure:8107: checking for gettid() via syscall
> ac_cv_func_gettid=no
> ap_cv_gettid=yes
>
> Looks like ac_cv_func_gettid is no but ap_cv_gettid is yes.

This is not consistent with what you posted before.  Looking again, the
old configure output you posted has:

checking for gettid()... yes

note the (), which is only possible if you haven't re-run buildconf.  
Re-run buildconf and configure, and if the build still fails please
provide the full config.log somewhere so I can try to understand what's
going on.

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1879591 - in /httpd/httpd/trunk: configure.in server/log.c

Graham Leggett
On 15 Jul 2020, at 16:27, Joe Orton <[hidden email]> wrote:

Looks like ac_cv_func_gettid is no but ap_cv_gettid is yes.

This is not consistent with what you posted before.  Looking again, the 
old configure output you posted has:

checking for gettid()... yes

note the (), which is only possible if you haven't re-run buildconf.  
Re-run buildconf and configure, and if the build still fails please 
provide the full config.log somewhere so I can try to understand what's 
going on.

Double checked the terminal history, and I had indeed run buildconf - this wasn't enough though.

As rpluem suggested "make extraclean” was the secret, this is needed over and above the buildconf. The build is now clean.

Regards,
Graham