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

Re: How to tell the compiler NOT to assume cpu provides atomic instructions



On Mon, Mar 07, 2011 at 06:27:22PM -0500, RR wrote:
> astobj2.o: In function `ast_atomic_fetchadd_int':
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> astobj2.o:/usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: more
> undefined references to `__sync_fetch_and_add_4' follow
> utils.o: In function `ast_atomic_dec_and_test':
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:635: undefined reference to
> `__sync_sub_and_fetch_4'
> utils.o: In function `ast_atomic_fetchadd_int':
> /usr/src/asterisk-1.8.3/include/asterisk/lock.h:589: undefined reference to
> `__sync_fetch_and_add_4'
> collect2: ld returned 1 exit status
> make[1]: *** [asterisk] Error 1
> make: *** [main] Error 2
> 
> Credible people in the Asterisk list believe that it's because the configure
> script is somehow determining that my CPU provides atomic instructions but
> it fails to find it when it tries to link. Does anyone know what options can
> be provided to the "configure" script via CFLAGS or CXXFLAGS etc to tell
> make/compiler about this or to fix this?

Please provide the output of the compilation command line and the
linking command line.  Also, please provide the output of gcc -v.  I
have some conjectures as to what might be going on, but I'll need to do
some tests to see.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


Reply to: