[asterisk-users] asterisk rpm build problem

Barry Miller asterisk-users at notanet.net
Fri Jul 22 12:57:29 CDT 2011


On Fri, Jul 22, 2011 at 10:10:01AM +0200, marek cervenka wrote:
> hi,
> 
> i'm trying build asterisk rpm
> normal compilation is ok but rpm building always fail
> 
> centos6/asterisk 1.8.5.0
> 
> any ideas?
> 
> 
> gcc -o recno/rec_utils.o -c recno/rec_utils.c -MD -MT recno/rec_utils.o 
> -MF .recno_rec_utils.o.d -MP -pthread -Wall -D__DBINTERFACE_PRIVATE -I. 
> -I.. -Iinclude -Ihash -Ibtree -Irecno 
> -I/root/rpmbuild/BUILD/asterisk-1.8.5.0/include -O2 -g -march=i386 
 [snip]
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'
> ccss.o: In function `ast_atomic_fetchadd_int':
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'
> cdr.o:/root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> more undefined references to `__sync_fetch_and_add_4' follow
> utils.o: In function `ast_atomic_dec_and_test':
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:646: 
> undefined reference to `__sync_sub_and_fetch_4'
> utils.o: In function `ast_atomic_fetchadd_int':
> /root/rpmbuild/BUILD/asterisk-1.8.5.0/include/asterisk/lock.h:600: 
> undefined reference to `__sync_fetch_and_add_4'

I do not use centos (or build rpms, for that matter), but at least on
OpenBSD the "-march=i386" causes the same undefineds you are seeing.

I have to force i686 when configuring asterisk:
	./configure --prefix=/usr/local CFLAGS=-march=i686 
for the build to succeed.

I'm not sure if this applies in your case, but maybe it will help.

-- 
Barry



More information about the asterisk-users mailing list