This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] crypt: Use internal names for the SHA-2 block functions


On Fri, 28 Oct 2016, Adhemerval Zanella wrote:

> > It's true that linknamespace considerations apply even for _DEFAULT_SOURCE 
> > and _GNU_SOURCE - using a function declared under one of those conditions 
> > should not bring in a reference to a function not so declared.  The 
> > difficulty in testing this is that it really needs a list of all installed 
> > headers to be visible in one place (and there's the question of whether we 
> > consider _DEFAULT_SOURCE to include all headers or not).
> 
> Right, but how hard would to add a rule in conform to tests for glibc specific
> headers (conformtest-headers-GLIBC or conformtest-headers-GNU) and at
> first add the crypt.h plus _GNU_SOURCE?

You'd need the set of headers for linknamespace tests to be bigger than 
the set for conformtest tests (which makes sense anyway - there are 
several standard variants without conformtest expectations, setting up 
such expectations is a lot of work, but listing headers in a standard is 
easy and listing headers plus specifying compilation options is all that's 
needed for linknamespace tests).

But you'd have to hope that the set of headers you specify for _GNU_SOURCE 
is internally consistent.  It's perfectly valid under our namespace rules 
for a <crypt.h> function to call a function in some Linux-specific header, 
for example (and the Linux-specific headers can't be listed in 
conform/Makefile, only sysdeps/unix/sysv/linux/Makefile knows about them).

I wonder about arranging the makefiles so they record each subdirectory's 
list of installed headers as part of the build, the toplevel collects that 
information together, so when the testsuite runs such a list is available.  
Running tests in each subdirectory works for e.g. Zack's tests, where 
testing for each header is independent, but not for things that need to 
see a complete list of all installed headers at once.  That way, conform/ 
could access that list saved during the build, and filter out bits/ 
headers (and any other headers that just give errors, like Zack's tests 
filter out some such headers) to get a list of headers for GNU / DEFAULT 
linknamespace tests.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]