public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Problem with conformance test and header files inclusion for ./include/sys/poll.h
@ 2019-10-31 23:08 Lukasz Majewski
  2019-10-31 23:13 ` Joseph Myers
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2019-10-31 23:08 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library, libc-help

[-- Attachment #1: Type: text/plain, Size: 2932 bytes --]

Dear All,

I'm trying to convert ppoll to support 64 bit time ABI.

The syscall seems to be converted correctly, however I do encounter the
issues when running:

'glibc-many-build glibcs x86_64-linux-gnu'

FAIL: glibcs-x86_64-linux-gnu check

By inspecting:
logs/glibcs/x86_64-linux-gnu/007-glibcs-x86_64-linux-gnu-check-log.txt
and: XOPEN2K/poll.h/conform.out

I do see following violations for poll.h:

	Namespace violation: "CLOCKS_PER_SEC"
	Namespace violation: "CLOCK_BOOTTIME"

This seems to be caused by adding 

# include <time.h>     (or even #include <include/time.h>)   [*]
# include <signal.h>   (or even #include <include/signal.h>) [*]

needed by following code (definitions of struct __timespec64 and
sigset_t):

# if __TIMESIZE == 64
#  define __ppoll64 __ppoll
# else
extern int __ppoll64 (struct pollfd *fds, nfds_t nfds,
	              const struct __timespec64 *timeout,
		      const sigset_t *sigmask)
libc_hidden_proto (__ppoll64)
# endif

to include/sys/poll.h [**] [***]

Why the above code for e.g. clock_settime put into ./include/time.h
doesn't causes the "conformance" errors?

Please correct me if I'm wrong, but the ./include/ directory seems to
be the "local" one and not being exported to user programs (as e.g.
bits, io content).

Hence, why I do see this error? I've checked and there is no extra code
in installed poll.h headers on target system (with QEMU) -
/usr/include/sys/poll.h,  /usr/include/poll.h



Last but not least -> the list of header symbols (declarations,
members, etc) is generated with ./conform/list-headers-symbols.py,
which in turn uses gcc CFLAGS -aux-info foo.aux
The python script (glibcconform.py) generates on fly the content of
test.c file (with proper #include <header-to-test.h>), compiles it and
examines the *.aux file.
However, I do have an issue with finding (in Makefiles?) what is the
default search path for includes in this test.


Note:

[*] - the "'include/' shall be a clear indication to use "local" glibc's
includes.

[**] - this location (include/sys/poll.h) seems to be better for ppoll
conversion code than e.g. include/time.h

[***] - I'm also a bit puzzled why in the include/sys/poll.h there is an
"incomplete" declaration of __poll:
extern int __poll (struct pollfd *__fds, unsigned long int __nfds,
int __timeout)

The nfds shall be nfds_t not 'unsigned long int' (but this would require
header include, which may trigger the "conformance" test error).

[****] - A bit off topic: What is the purpose of -D_ISOMAC define? It
can be found in glibc's sources in several places (e.g. # ifndef
_ISOMAC). 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with conformance test and header files inclusion for ./include/sys/poll.h
  2019-10-31 23:08 Problem with conformance test and header files inclusion for ./include/sys/poll.h Lukasz Majewski
@ 2019-10-31 23:13 ` Joseph Myers
  2019-10-31 23:53   ` Lukasz Majewski
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2019-10-31 23:13 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: GNU C Library, libc-help

On Fri, 1 Nov 2019, Lukasz Majewski wrote:

> This seems to be caused by adding 
> 
> # include <time.h>     (or even #include <include/time.h>)   [*]
> # include <signal.h>   (or even #include <include/signal.h>) [*]

Everything in an include/ header other than the include of the 
corresponding public header needs to be inside "#ifndef _ISOMAC".

> [****] - A bit off topic: What is the purpose of -D_ISOMAC define? It
> can be found in glibc's sources in several places (e.g. # ifndef
> _ISOMAC). 

The purpose is to cause the include/ header wrappers to define only what 
the installed headers would define, not anything internal to glibc.  This 
is used by most tests (all except those in tests-internal), including the 
header conformance ones.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with conformance test and header files inclusion for ./include/sys/poll.h
  2019-10-31 23:13 ` Joseph Myers
@ 2019-10-31 23:53   ` Lukasz Majewski
  2019-11-01  0:18     ` Joseph Myers
  2019-11-01 10:12     ` Andreas Schwab
  0 siblings, 2 replies; 5+ messages in thread
From: Lukasz Majewski @ 2019-10-31 23:53 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library, libc-help

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

Hi Joseph,

Thanks for your very prompt reply.

> On Fri, 1 Nov 2019, Lukasz Majewski wrote:
> 
> > This seems to be caused by adding 
> > 
> > # include <time.h>     (or even #include <include/time.h>)   [*]
> > # include <signal.h>   (or even #include <include/signal.h>) [*]  
> 
> Everything in an include/ header other than the include of the 
> corresponding public header needs to be inside "#ifndef _ISOMAC".

And now the penny dropped ... Yes, those #includes were not "protected"
with #ifndef _ISOMAC. After moving them in the proper place the
conformance tests pass.

> 
> > [****] - A bit off topic: What is the purpose of -D_ISOMAC define?
> > It can be found in glibc's sources in several places (e.g. # ifndef
> > _ISOMAC).   
> 
> The purpose is to cause the include/ header wrappers to define only
> what the installed headers would define, not anything internal to
> glibc.  This is used by most tests (all except those in
> tests-internal), including the header conformance ones.
> 

I must admit that I've spent some time on understanding _ISOMAC, but I
did not found much about it in the manual.

Why it is called _ISOMAC? (My first thought was about some MAC specific
stuff ... )

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with conformance test and header files inclusion for ./include/sys/poll.h
  2019-10-31 23:53   ` Lukasz Majewski
@ 2019-11-01  0:18     ` Joseph Myers
  2019-11-01 10:12     ` Andreas Schwab
  1 sibling, 0 replies; 5+ messages in thread
From: Joseph Myers @ 2019-11-01  0:18 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: GNU C Library, libc-help

On Fri, 1 Nov 2019, Lukasz Majewski wrote:

> Why it is called _ISOMAC? (My first thought was about some MAC specific
> stuff ... )

My guess would be it stands for something like "define only macros 
permitted by ISO C".

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with conformance test and header files inclusion for ./include/sys/poll.h
  2019-10-31 23:53   ` Lukasz Majewski
  2019-11-01  0:18     ` Joseph Myers
@ 2019-11-01 10:12     ` Andreas Schwab
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2019-11-01 10:12 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: Joseph Myers, GNU C Library, libc-help

On Nov 01 2019, Lukasz Majewski wrote:

> Why it is called _ISOMAC?

Because of stdlib/isomac.c

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-01 10:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 23:08 Problem with conformance test and header files inclusion for ./include/sys/poll.h Lukasz Majewski
2019-10-31 23:13 ` Joseph Myers
2019-10-31 23:53   ` Lukasz Majewski
2019-11-01  0:18     ` Joseph Myers
2019-11-01 10:12     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).