[PATCH] Add wcharP.h to hide internal wchar functions [BZ #18822]

Florian Weimer fweimer@redhat.com
Tue Dec 12 14:37:00 GMT 2017


On 12/12/2017 01:23 PM, H.J. Lu wrote:
> I don't believe GCC can do it on its own without attribute.  Even with
> attribute, GCC can't do it properly for builtin functions:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220
> 
> Since we need to support more than one architecture and each architecture
> has different requirements, we can't avoid multiple header files.   At minimum,
> for each architecture, a public header file, foo.h, may need
> 
> 1. foo.h.  Public header file.
> 2. include/foo.h.  Common internal header file.
> 3. foo-hidden.h.   Architecture specific header file to hide more
> internal functions.
> 
> Of course, we can just use the public foo.h and pay the price.

You mean the common internal header file?  The public header file does 
not contain the internal declarations, so its use would result in 
namespace issues.

There are better ways than separate header files.  We could add a lookup 
table based on the function name, to see which optimizations to apply, 
and make sure that if an IFUNC resolver is defined, the function name 
has compatible attributes.

(This ties into the idea to auto-generate header files, e.g. deriving 
the internal header files from the public ones.)

My suggestion is to wait with these optimizations until such a mechanism 
is available.

Thanks,
Florian



More information about the Libc-alpha mailing list