Avoid attempt for runtime checks if all environments are defined
commitd7e64365fea8d9223a233487de1e1d6e3d21c553
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 23 Jun 2016 20:28:44 +0000 (24 01:58 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 23 Jun 2016 20:30:12 +0000 (24 02:00 +0530)
tree89d9c80d11b8bf0c240b6aa3a1439e49123f6f6f
parentdb3476aff19b75c4fdefbe65fcd5f0a90588ba51
Avoid attempt for runtime checks if all environments are defined

getconf has the capability to do a runtime check for environment
support in cases where there is optional support for an environment
(_POSIX_V7_ILP32_OFF32 on x86_64 for example) and this is indicated by
not defining the _POSIX_V7_ILP32_OFF32 macro, which results in getconf
doing an additional execve of _POSIX_V7_ILP32_OFF32 in the
$GETCONF_DIR.

The default bits/environments.h however does not leave any environment
macros undefined, which means that no such additional execve is
needed.  gcc trunk catches this as a build failure since it finds that
the code block inside switch(specs[i].num) is not reachable.  Avoid
this error by not bothering about the additional exec (and looking in
specific environments) when all environments are defined.

Tested on aarch64.

* posix/getconf.c: Define ALL_ENVIRONMENTS_DEFINED if all
environment macros are defined.
(main): Avoid execve if ALL_ENVIRONMENTS_DEFINED is defined.
ChangeLog
posix/getconf.c