This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sync_add_and_fetch problem


Thank you. I had already found your reference.

Which file contains the definition of this built-in function?

I suppose that I could write a main() that called an increment function
and that function could call this function.

What would you need? If I supply just source it would seem that wouldn't
be worth much.

My co-workers are using v. 4.2.4, though one just built the entire
system with 4.3.2 and it did not have this problem. However, I would
kind of like to isolate the problem before I upgrade, which is why I
asked about the file it is defined in. I greped -inr
"__sync_add_and_fetch" /usr/include/*.h and didn't find it. Since that
module compiles without a warning, that suggests that the compiler found
it.

Chuck

On Wed, 2008-12-03 at 16:13 -0800, David Daney wrote:
> Charles Crisler wrote:
> > Hello GCC! I am trying to compile/link/run some code that uses
> > sync_add_and_fetch().
> 
> The real name of this function is __sync_add_and_fetch().
> 
> See: http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Atomic-Builtins.html
> 
> > The dynamic linker is failing to load one of my
> > libraries because this function cannot be resolved. I thought that this
> > function was included with GCC 4.1 and later. I have Fedora 9 32-bit on
> > an x86 system with GCC version 4.3.0 20080428. Where should I look to
> > fix or go around this problem? Thank you! Chuck Crisler
> 
> If you are compiling all the code in your program, including the 'one of 
> my libraries', *and* you use the proper function names, then it should work.
> 
> You need to post a small, complete, and runnable testcase for us to be 
> able to help much more.
> 
> David Daney


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]