[PATCH] ARM: Don't define _SYS_AUXV_H in sysdep.h
Joseph S. Myers
joseph@codesourcery.com
Wed Sep 17 14:32:00 GMT 2014
On Wed, 17 Sep 2014, Siddhesh Poyarekar wrote:
> On Tue, Sep 16, 2014 at 09:47:49PM +0000, Joseph S. Myers wrote:
> > Why does sysdep.h get included from these testcases anyway? As well as
> > moving away from defining _LIBC (and other internal defines) for tests
> > unless needed for a particular test, it would also be good to move away
> > from tests using the internal includes (if such an include is responsible
> > here), instead making them use the versions of headers that actually get
> > installed before looking for any other headers in the source tree or
> > sysdeps directories.
>
> I wonder if it would make sense to 'install' headers into a known
> location in the build directory during build and use only that for the
> tests. That would make the tests completely isolated from the
> internal headers. There are some tests that explicitly do white box
> testing; those can be treated as special cases.
Yes, headers should come from an installed staging directory for testing,
but that's only part of the solution.
* Tests can quite reasonably have wrapper files for a given architecture
in sysdeps, so you can't avoid the sysdeps search for everything. (Most
tests include at least one file that's not an installed header -
test-skeleton.c.) The installed headers should be searched before the
sysdeps / other source tree headers, however.
* Tests should not include libc-symbols.h, or config.h, or get any of the
defines from libc-symbols.h except _GNU_SOURCE (in particular, should not
define _LIBC) unless there is a reason for them to do so.
* Such reasons may not be obvious simply from "test fails to build / work
in a particular configuration". E.g. tst-fanotify.c has a good reason to
include config.h - it uses a configure test for whether linux/fanotify.h
is available. While it includes config.h explicitly, some tests might be
relying on implicit includes. So you need some way to search tests for
references to config.h / libc-symbols.h symbols in #if conditions.
* Tests should also not get internal symbols defined in other ways. The
problem reported in the present case appears to be because of an
_IO_MTSAFE_IO definition that resulted in various internal headers getting
included. That comes via CPPFLAGS += $(libio-mtsafe) in
stdio-common/Makefile.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list