Re: Atomic builtins always defined -- bug or feature?

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

 



Joseph Garvin wrote:
> On Fri, Jun 5, 2009 at 11:47 AM, Andrew Haley<aph@xxxxxxxxxx> wrote:
>> It'll call out to a library function if there isn't a builtin instruction.
>> If you want to do a configure check, try running or linking the program.
> 
> If I compile with -march=i386, and do ./a.out, it runs without errors.
> Here's my .cpp file:
> 
> int main()
> {
> 	int x;
> 	__sync_add_and_fetch(&x, 1);
> 
> 	return 0;
> }
> 
> Since I have a main, if __sync_add_and_fetch were undefined, wouldn't
> it already be trying to link and give an error?

i386 has lock incl, surely, so __sync_add_and_fetch isn't a problem.
It's stuff like __sync_val_compare_and_swap you don't have.

Andrew.


[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