Re: building i386 world on amd64 host: failed _at_svn

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 16 Aug 2013 17:41:50 +0200
On Aug 16, 2013, at 17:02, Konstantin Belousov <kostikbel_at_gmail.com> wrote:
> On Fri, Aug 16, 2013 at 02:33:29PM +0200, Dimitry Andric wrote:
...
>> In contrast, gcc's rules (in contrib/gcc/config/i386/i386.c) are pretty
>> straightforward:
>> 
>>  /* Compare and exchange was added for 80486.  */
>>  const int x86_cmpxchg = ~m_386;
>>  /* Compare and exchange 8 bytes was added for pentium.  */
>>  const int x86_cmpxchg8b = ~(m_386 | m_486);
>> 
>> So maybe the following is a safe enough solution for now:
>> 
>> Index: usr.bin/svn/svn_private_config.h
>> ===================================================================
>> --- usr.bin/svn/svn_private_config.h    (revision 254300)
>> +++ usr.bin/svn/svn_private_config.h    (working copy)
>> _at__at_ -153,7 +153,9 _at__at_
>> #define SVN_FS_WANT_DB_PATCH 14
>> 
>> /* Define if compiler provides atomic builtins */
>> +#if !defined(__i386__) || !defined(__i486__)
>> #define SVN_HAS_ATOMIC_BUILTINS 1
>> +#endif
> I do not understand this.  Isn't __i386__ defined always when compiling
> for 32bit x86 ?  
> 
> The !defined(__i486__) part assumes that any other cpu variation supported
> by compiler has cmpxchg8b.


Yes, that was the intention.  So if it is i386 arch, but the CPU isn't
i486, the builtins can be enabled.  This is the same logic that gcc
itself uses.

It only breaks down when compiling with -mcpu=i386 though, but I don't
think we support that anymore?

The ifdef was just the negation of:

#if defined(__i386__) && defined(__i486__)
#undef SVN_HAS_ATOMIC_BUILTINS
#endif

-Dimitry
Received on Fri Aug 16 2013 - 13:41:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:40 UTC