# Trunk can't be compiled atm

**URL:** <https://www.ruby-forum.com/t/trunk-cant-be-compiled-atm/218098>\
**Category:** NGINX\
**Created:** [March 21, 2012, 7:16am UTC](https://www.ruby-forum.com/t/trunk-cant-be-compiled-atm/218098 "2012-03-21T07:16:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 21, 2012, 7:16am UTC](https://www.ruby-forum.com/t/trunk-cant-be-compiled-atm/218098/1 "2012-03-21T07:16:56Z")

</div>

Unable to compile nginx trunk…

gcc-4.6.1-9 (Ubuntu)  
./configure --with-openssl=/root/openssl/openssl-dev/openssl  
–with-cpu-opt=pentium4 --with-http\_gzip\_static\_module  
–with-http\_ssl\_module --with-ipv6 --without-mail\_pop3\_module  
–without-mail\_imap\_module --without-mail\_smtp\_module  
–without-http\_charset\_module --without-http\_ssi\_module  
–without-http\_userid\_module --without-http\_autoindex\_module  
–without-http\_rewrite\_module --with-pcre --with-cc-opt=’-O2 -g  
-march=i386 -mtune=i686’

gcc -o objs/nginx   
objs/src/core/nginx.o   
objs/src/core/ngx\_log.o   
objs/src/core/ngx\_palloc.o   
objs/src/core/ngx\_array.o   
objs/src/core/ngx\_list.o   
objs/src/core/ngx\_hash.o   
objs/src/core/ngx\_buf.o   
objs/src/core/ngx\_queue.o   
objs/src/core/ngx\_output\_chain.o   
objs/src/core/ngx\_string.o   
objs/src/core/ngx\_parse.o   
objs/src/core/ngx\_inet.o   
objs/src/core/ngx\_file.o   
objs/src/core/ngx\_crc32.o   
objs/src/core/ngx\_murmurhash.o   
objs/src/core/ngx\_md5.o   
objs/src/core/ngx\_rbtree.o   
objs/src/core/ngx\_radix\_tree.o   
objs/src/core/ngx\_slab.o   
objs/src/core/ngx\_times.o   
objs/src/core/ngx\_shmtx.o   
objs/src/core/ngx\_connection.o   
objs/src/core/ngx\_cycle.o   
objs/src/core/ngx\_spinlock.o   
objs/src/core/ngx\_cpuinfo.o   
objs/src/core/ngx\_conf\_file.o   
objs/src/core/ngx\_resolver.o   
objs/src/core/ngx\_open\_file\_cache.o   
objs/src/core/ngx\_crypt.o   
objs/src/event/ngx\_event.o   
objs/src/event/ngx\_event\_timer.o   
objs/src/event/ngx\_event\_posted.o   
objs/src/event/ngx\_event\_busy\_lock.o   
objs/src/event/ngx\_event\_accept.o   
objs/src/event/ngx\_event\_connect.o   
objs/src/event/ngx\_event\_pipe.o   
objs/src/os/unix/ngx\_time.o   
objs/src/os/unix/ngx\_errno.o   
objs/src/os/unix/ngx\_alloc.o   
objs/src/os/unix/ngx\_files.o   
objs/src/os/unix/ngx\_socket.o   
objs/src/os/unix/ngx\_recv.o   
objs/src/os/unix/ngx\_readv\_chain.o   
objs/src/os/unix/ngx\_udp\_recv.o   
objs/src/os/unix/ngx\_send.o   
objs/src/os/unix/ngx\_writev\_chain.o   
objs/src/os/unix/ngx\_channel.o   
objs/src/os/unix/ngx\_shmem.o   
objs/src/os/unix/ngx\_process.o   
objs/src/os/unix/ngx\_daemon.o   
objs/src/os/unix/ngx\_setproctitle.o   
objs/src/os/unix/ngx\_posix\_init.o   
objs/src/os/unix/ngx\_user.o   
objs/src/os/unix/ngx\_process\_cycle.o   
objs/src/os/unix/ngx\_linux\_init.o   
objs/src/event/modules/ngx\_epoll\_module.o   
objs/src/os/unix/ngx\_linux\_sendfile\_chain.o   
objs/src/event/ngx\_event\_openssl.o   
objs/src/core/ngx\_regex.o   
objs/src/http/ngx\_http.o   
objs/src/http/ngx\_http\_core\_module.o   
objs/src/http/ngx\_http\_special\_response.o   
objs/src/http/ngx\_http\_request.o   
objs/src/http/ngx\_http\_parse.o   
objs/src/http/ngx\_http\_header\_filter\_module.o   
objs/src/http/ngx\_http\_write\_filter\_module.o   
objs/src/http/ngx\_http\_copy\_filter\_module.o   
objs/src/http/modules/ngx\_http\_log\_module.o   
objs/src/http/ngx\_http\_request\_body.o   
objs/src/http/ngx\_http\_variables.o   
objs/src/http/ngx\_http\_script.o   
objs/src/http/ngx\_http\_upstream.o   
objs/src/http/ngx\_http\_upstream\_round\_robin.o   
objs/src/http/ngx\_http\_parse\_time.o   
objs/src/http/modules/ngx\_http\_static\_module.o   
objs/src/http/modules/ngx\_http\_index\_module.o   
objs/src/http/modules/ngx\_http\_chunked\_filter\_module.o   
objs/src/http/modules/ngx\_http\_range\_filter\_module.o   
objs/src/http/modules/ngx\_http\_headers\_filter\_module.o   
objs/src/http/modules/ngx\_http\_not\_modified\_filter\_module.o   
objs/src/http/ngx\_http\_busy\_lock.o   
objs/src/http/ngx\_http\_file\_cache.o   
objs/src/http/modules/ngx\_http\_gzip\_filter\_module.o   
objs/src/http/modules/ngx\_http\_gzip\_static\_module.o   
objs/src/http/modules/ngx\_http\_auth\_basic\_module.o   
objs/src/http/modules/ngx\_http\_access\_module.o   
objs/src/http/modules/ngx\_http\_limit\_conn\_module.o   
objs/src/http/modules/ngx\_http\_limit\_req\_module.o   
objs/src/http/modules/ngx\_http\_geo\_module.o   
objs/src/http/modules/ngx\_http\_map\_module.o   
objs/src/http/modules/ngx\_http\_split\_clients\_module.o   
objs/src/http/modules/ngx\_http\_referer\_module.o   
objs/src/http/modules/ngx\_http\_ssl\_module.o   
objs/src/http/modules/ngx\_http\_proxy\_module.o   
objs/src/http/modules/ngx\_http\_fastcgi\_module.o   
objs/src/http/modules/ngx\_http\_uwsgi\_module.o   
objs/src/http/modules/ngx\_http\_scgi\_module.o   
objs/src/http/modules/ngx\_http\_memcached\_module.o   
objs/src/http/modules/ngx\_http\_empty\_gif\_module.o   
objs/src/http/modules/ngx\_http\_browser\_module.o   
objs/src/http/modules/ngx\_http\_upstream\_ip\_hash\_module.o   
objs/src/http/modules/ngx\_http\_upstream\_keepalive\_module.o   
objs/ngx\_modules.o   
-lpthread -lcrypt -lpcre  
/root/openssl/openssl-dev/openssl/.openssl/lib/libssl.a  
/root/openssl/openssl-dev/openssl/.openssl/lib/libcrypto.a -ldl -lz  
objs/src/core/ngx\_resolver.o: In function `ngx_udp_connect': /root/trunk/src/core/ngx_resolver.c:2214: undefined reference to`\_\_sync\_fetch\_and\_add\_4’  
objs/src/core/ngx\_file.o: In function `ngx_next_temp_number': /root/trunk/src/core/ngx_file.c:232: undefined reference to`\_\_sync\_fetch\_and\_add\_4’  
objs/src/core/ngx\_times.o: In function `ngx_time_sigsafe_update': /root/trunk/src/core/ngx_times.c:193: undefined reference to`\_\_sync\_bool\_compare\_and\_swap\_4’  
objs/src/core/ngx\_times.o: In function `ngx_time_update': /root/trunk/src/core/ngx_times.c:83: undefined reference to`\_\_sync\_bool\_compare\_and\_swap\_4’  
objs/src/core/ngx\_shmtx.o: In function `ngx_shmtx_wakeup': /root/trunk/src/core/ngx_shmtx.c:181: undefined reference to`\_\_sync\_bool\_compare\_and\_swap\_4’  
objs/src/core/ngx\_shmtx.o: In function `ngx_shmtx_trylock': /root/trunk/src/core/ngx_shmtx.c:65: undefined reference to`\_\_sync\_bool\_compare\_and\_swap\_4’  
objs/src/core/ngx\_shmtx.o: In function `ngx_shmtx_lock': /root/trunk/src/core/ngx_shmtx.c:78: undefined reference to`\_\_sync\_bool\_compare\_and\_swap\_4’  
objs/src/core/ngx\_shmtx.o:/root/trunk/src/core/ngx\_shmtx.c:91: more  
undefined references to `__sync_bool_compare_and_swap_4' follow objs/src/event/ngx_event_accept.o: In function`ngx\_event\_accept’:  
/root/trunk/src/event/ngx\_event\_accept.c:224: undefined reference to  
`__sync_fetch_and_add_4' objs/src/event/ngx_event_connect.o: In function`ngx\_event\_connect\_peer’:  
/root/trunk/src/event/ngx\_event\_connect.c:105: undefined reference to  
`__sync_fetch_and_add_4' objs/src/http/ngx_http_file_cache.o: In function`ngx\_http\_file\_cache\_loader’:  
/root/trunk/src/http/ngx\_http\_file\_cache.c:1364: undefined reference  
to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory`/root/trunk’  
make: \*\*\* [build] Error 2

---

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [March 21, 2012, 7:39am UTC](https://www.ruby-forum.com/t/trunk-cant-be-compiled-atm/218098/2 "2012-03-21T07:39:54Z")

</div>

On Wed, Mar 21, 2012 at 07:16:27PM +1300, Ryan B. wrote:

> -march=i386 -mtune=i686’  
> objs/src/core/ngx\_resolver.o: In function `ngx_udp_connect': /root/trunk/src/core/ngx_resolver.c:2214: undefined reference to `\_\_sync\_fetch\_and\_add\_4’  
> objs/src/core/ngx\_file.o: In function `ngx_next_temp_number': /root/trunk/src/core/ngx_file.c:232: undefined reference to `\_\_sync\_fetch\_and\_add\_4’  
> objs/src/core/ngx\_times.o: In function `ngx_time_sigsafe_update': /root/trunk/src/core/ngx_times.c:193: undefined reference to `\_\_sync\_bool\_compare\_and\_swap\_4’

i386 CPU does not support atomic operations.  
The minimum level is i486. Do you really need “-march=i386” ?

–  
Igor S.
