This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] byteswap.h: fix gcc ver test for __builtin_bswap{32,64}
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: Mike Frysinger <vapier at gentoo dot org>, libc-alpha at sourceware dot org, David Miller <davem at davemloft dot net>
- Date: Sun, 2 Dec 2012 14:23:16 -0800
- Subject: Re: [PATCH v2] byteswap.h: fix gcc ver test for __builtin_bswap{32,64}
- References: <1354162043-16829-1-git-send-email-vapier@gentoo.org><1354162220-16981-1-git-send-email-vapier@gentoo.org><201211301523.24699.vapier@gentoo.org><CAE2sS1jcTCQuPP5z+Q5qnykP4etqQrCiq_uxdutEiRNWXT6yBw@mail.gmail.com>
On Sun, Dec 2, 2012 at 2:10 PM, Carlos O'Donell <carlos@systemhalted.org> wrote:
> On Fri, Nov 30, 2012 at 3:23 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> On Wednesday 28 November 2012 23:10:20 Mike Frysinger wrote:
>>> The __builtin_bswap* functions were introduced in gcc-4.3, not gcc-4.2.
>>> Fix the __GNUC_PREREQ tests to reflect this.
>>>
>>> Otherwise trying to compile code with gcc-4.2 falls down:
>>> In file included from /usr/include/endian.h:60,
>>> from /usr/include/ctype.h:40,
>>> /usr/include/bits/byteswap.h: In function 'unsigned int __bswap_32(unsigned
>>> int)': /usr/include/bits/byteswap.h:46: error: '__builtin_bswap32' was not
>>> declared in this scope /usr/include/bits/byteswap.h: In function 'long
>>> long unsigned int __bswap_64(long long unsigned int)':
>>> /usr/include/bits/byteswap.h:110: error: '__builtin_bswap64' was not
>>> declared in this scope
>>
>> btw, i think this should go into 2.17 (and perhaps the 2.16 branch) since this
>> is a regression from 2.15.
>
> How did you confirm this? Exactly what GCC 4.2 did you use? I'm
> without access to my machines right now, or I'd test this.
>
> I think that H.J. should comment on this since he added the checks for GCC 4.2.
>
I was wrong. __builtin_bswap32 was added in GCC 4.3.
--
H.J.