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 __BEGIN_DECLS and __END_DECLS for C++


On 05/19/2017 01:57 PM, H.J. Lu wrote:
> On Thu, May 11, 2017 at 8:33 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, May 11, 2017 at 8:20 AM, Zack Weinberg <zackw@panix.com> wrote:
>>> On Thu, May 11, 2017 at 11:10 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Thu, May 11, 2017 at 7:57 AM, Zack Weinberg <zackw@panix.com> wrote:
>>>>> On Thu, May 11, 2017 at 10:45 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>>> On Thu, May 11, 2017 at 7:43 AM, Zack Weinberg <zackw@panix.com> wrote:
>>>>>>>
>>>>>>> This program does not appear to need ifunc-impl-list.h.  Please elaborate.
>>>>>>
>>>>>> Please see hjl/x86/optimize branch in glibc git repo.
>>>>>
>>>>> I don't especially appreciate being made to dig through a bunch of
>>>>> code I'm unfamiliar with.  It would have been easy for you to write
>>>>> "The existing benchtests framework uses ifunc-impl-list.h to iterate
>>>>> over all ifunc implementations of a particular string function.  This
>>>>> works as long as the test program is C, but I want to integrate a
>>>>> third-party benchmark <url> written in C++, so I need to make
>>>>> ifunc-impl-list.h C++-safe".  If that had accompanied the original
>>>>> patch it would have been better all around.
>>>>>
>>>>> It looks to me as if IFUNC_IMPL_ADD is not C++-safe and cannot easily
>>>>
>>>> IFUNC_IMPL_ADD is only used in ifunc-impl-list.c, which is the
>>>> part of libc and in C.
>>>
>>> Can IFUNC_IMPL_ADD be removed from ifunc-impl-list.h then?  I would be
>>> okay with adding __BEGIN_DECLS/__END_DECLS to the header as long as
>>> all of the code within it -- including macros -- was safe for use from
>>> C++ programs, and with a comment explaining that the header may get
>>> used from C++ benchmarks.
>>
>> IFUNC_IMPL_ADD is used in
>>
>> sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
>> sysdeps/i386/i686/multiarch/ifunc-impl-list.c
>> sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
>> sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
>> sysdeps/s390/multiarch/ifunc-impl-list.c
>> sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
>> sysdeps/x86_64/multiarch/ifunc-impl-list.c
>>
>> Removing it from include/ifunc-impl-list.h isn't appropriate.  Here is
>> the updated patch with comments.
>>
> 
> Ping.

I am going to look into compiling the benchmarks under _ISOMAC.  Please
wait.

zw


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