Re: Difference between --target=i386 and i686

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2020 at 9:38 AM J.W. Jagersma <jwjagersma@xxxxxxxxx> wrote:
> > Besides the performance loss, i386 doesn't have cmpxchg which means
> > atomic support will be a problem.  Otherwise, it will probably work.
>
> I did notice that using i386, my program doesn't link at -O0 due to
> undefined references to __atomic_* builtins. Somehow it works at -O1
> and above. It seems the only atomic operations I use are compiled to
> 'lock add/sub' instructions.

Atomics are probably inline expanded with optimization.  There is a
libatomic library you can link with, -latomic, that should implement
all atomics that aren't inline expanded.  But I'm not sure exactly how
this works with a i386 toolchain given that cmpxchg is missing.

Jim



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux