This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Define _STRING_ARCH_unaligned unconditionally
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 28 Mar 2014 10:46:23 -0300
- Subject: Re: Define _STRING_ARCH_unaligned unconditionally
- Authentication-results: sourceware.org; auth=none
- References: <53331005 dot 1080804 at linux dot vnet dot ibm dot com> <Pine dot LNX dot 4 dot 64 dot 1403261740440 dot 27627 at digraph dot polyomino dot org dot uk> <5334355D dot 5000300 at linux dot vnet dot ibm dot com> <5334FBC4 dot 60707 at redhat dot com>
On 28-03-2014 01:34, Carlos O'Donell wrote:
> On 03/27/2014 10:27 AM, Adhemerval Zanella wrote:
>> On 26-03-2014 14:42, Joseph S. Myers wrote:
>>> On Wed, 26 Mar 2014, Adhemerval Zanella wrote:
>>>
>>>> This is a respin on my initial try to remove the undefined _STRING_ARCH_unaligned
>>>> from PPC64 builds, but now extended to all arch that do not define it. This patch
>>>> defines _STRING_ARCH_unaligned to 0, mimicking old undefined behavior.
>>>>
>>>> --
>>>>
>>>> * bits/string.h (_STRING_ARCH_unaligned): Define it to 0.
>>> I see various files in the source tree with #ifdef / #ifndef / "defined"
>>> conditionals on _STRING_ARCH_unaligned. I don't think those are correct
>>> with it defined to 0, so I think you need to change all of those are part
>>> of the patch introducing the possibility that it might be defined to 0.
>>>
>>> crypt/sha256.c
>>> iconv/gconv_simple.c
>>> iconv/loop.c
>>> iconv/skeleton.c
>>> nscd/nscd_gethst_r.c
>>> nscd/nscd_getserv_r.c
>>> nscd/nscd_helper.c
>>> resolv/res_send.c
>>>
> I verified this list and found no other uses with #ifdef or #ifndef
> or #if define.
>
>> Indeed and fixed:
>>
>> --
>>
>> * bits/string.h (_STRING_ARCH_unaligned): Define it to 0.
>> * crypt/sha256.c (_STRING_ARCH_unaligned): Check its value instead of its
>> definition.
>> * iconv/gconv_simple.c (_STRING_ARCH_unaligned): Likewise.
>> * iconv/loop.c (_STRING_ARCH_unaligned): Likewise.
>> * iconv/skeleton.c (_STRING_ARCH_unaligned): Likewise.
>> * nscd/nscd_gethst_r.c (_STRING_ARCH_unaligned): Likewise.
>> * nscd/nscd_getserv_r.c (_STRING_ARCH_unaligned): Likewise.
>> * nscd/nscd_helper.c (_STRING_ARCH_unaligned): Likewise.
>> * resolv/res_send.c (_STRING_ARCH_unaligned): Likewise.
> This looks good to me as long as you verify the binaries
> are identical before and after.
I just checked on both PPC64 (default _STRING_ARCH_unaligned) and x86_64 (_STRING_ARCH_unaligned
set to 1) and objdump -d are similar between builds.
>
> Cheers,
> Carlos.
>