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] Add wcharP.h to hide internal wchar functions [BZ #18822]


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


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