[Varnish] #138: [PATCH] varish-1.1 does not link on uclibc due to missing -lm linker flag

Varnish varnish-bugs at projects.linpro.no
Fri Aug 3 09:40:41 CEST 2007


#138: [PATCH] varish-1.1 does not link on uclibc due to missing -lm linker flag
--------------------+-------------------------------------------------------
 Reporter:  ncopa   |       Owner:  des          
     Type:  defect  |      Status:  new          
 Priority:  normal  |   Milestone:  Varnish 1.1.1
Component:  build   |     Version:  trunk        
 Severity:  normal  |    Keywords:               
--------------------+-------------------------------------------------------
 Hi,

 when I try to compile varnish-1.1 with uclibc (x86) I get the following
 error:


 {{{
 ...
 i386-gentoo-linux-uclibc-gcc -include config.h -march=i386 -Os -pipe
 -fomit-frame-pointer -o .libs/varnishd varnishd-cache_acceptor.o varnishd-
 cache_acceptor_epoll.o varnishd-cache_acceptor_poll.o varnishd-
 cache_acceptor_kqueue.o varnishd-cache_backend.o varnishd-cache_ban.o
 varnishd-cache_center.o varnishd-cache_cli.o varnishd-cache_expire.o
 varnishd-cache_fetch.o varnishd-cache_hash.o varnishd-cache_http.o
 varnishd-cache_lru.o varnishd-cache_main.o varnishd-cache_pool.o varnishd-
 cache_pipe.o varnishd-cache_response.o varnishd-cache_session.o varnishd-
 cache_synthetic.o varnishd-cache_vary.o varnishd-cache_vcl.o varnishd-
 cache_vrt.o varnishd-cache_vrt_acl.o varnishd-cache_vrt_re.o varnishd-
 cache_ws.o varnishd-hash_simple_list.o varnishd-hash_classic.o varnishd-
 instance.o varnishd-mgt_child.o varnishd-mgt_cli.o varnishd-mgt_event.o
 varnishd-mgt_param.o varnishd-mgt_vcc.o varnishd-rfc2616.o varnishd-
 shmlog.o varnishd-stevedore.o varnishd-storage_file.o varnishd-
 storage_malloc.o varnishd-tcp.o varnishd-varnishd.o -Wl,--export-dynamic
 ../../lib/libvarnish/.libs/libvarnish.so ../../lib/libcompat/libcompat.a
 ../../lib/libvcl/.libs/libvcl.so -ldl -lpthread
 varnishd-cache_pool.o: In function `wrk_do_one':
 cache_pool.c:(.text+0x6de): undefined reference to `__isnan'
 varnishd-cache_pool.o: In function `wrk_thread':
 cache_pool.c:(.text+0x9ff): undefined reference to `__isnan'
 collect2: ld returned 1 exit status
 make[3]: *** [varnishd] Error 1
 make[3]: Leaving directory `/var/tmp/portage/www-
 servers/varnish-1.1/work/varnish-1.1/bin/varnishd'
 make[2]: *** [all-recursive] Error 1
 make[2]: Leaving directory `/var/tmp/portage/www-
 servers/varnish-1.1/work/varnish-1.1/bin'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory `/var/tmp/portage/www-
 servers/varnish-1.1/work/varnish-1.1'
 make: *** [all] Error 2
 }}}

 The problem is that -lm should be added to the linker flags. This is a
 common misstake since glibc does not require -lm. I would not be
 surprised if you get the same linker error on *bsd.

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/138>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list