[OE-core] glibc: Inconsistencies in pre-processing of option-groups.h

Juro Bystricky jurobystricky at hotmail.com
Sat Nov 22 20:25:56 UTC 2014


There are some inconsistencies when processing eglibc options.
"option-groups.h" is generated automatically, and to quote:

"It defines macros that indicate which EGLIBC option groups were
   configured in 'option-groups.config' when this C library was
   built.  For each option group named OPTION_foo, it #defines
   __OPTION_foo to be 1 if the group is enabled, or leaves that
   symbol undefined if the group is disabled."

So for example, one of the following may be generared:

#define __OPTION_XXX  1

or 

/* undef __OPTION_XXX */

However, the glibc headers are preprocessed inconsistently, sometimes using:

#ifdef __OPTION_XXX
...

and sometimes

#if __OPTION_XXX
...

The latter case will result in many compiler warning for options that are not defined.
This is quite evident when building poky-tiny, where many options are disabled.
(This warning will be treated as errors in future releases of glibc.)

To fix these inconsistencies, there are two solutions:

One solution would be to generate

#define __OPTION_XXX 0

instead of 

/* undef __OPTION_XXX */

In this case all preprocessing tests can use/should use 

#if __OPTION_XXX
...

Second solution would be to leave generation of option-groups.h as it is, 
but in this case all occurrences of 

#if __OPTION_XXX

should be consistently replaced everywhere by 

#ifdef __OPTION_XXX

Juro
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20141122/00a1cee0/attachment-0002.html>


More information about the Openembedded-core mailing list