2009/12/22 Török Edwin <[email protected]>: > On 2009-12-22 12:40, Renato Botelho wrote: >> 2009/12/22 Török Edwin <[email protected]>: >> >>> On 2009-12-21 16:57, Renato Botelho wrote: >>> >>>> 2009/12/21 Török Edwin <[email protected]>: >>>> >>>> >>>>> Hi Renato, >>>>> >>>>> Thanks for the patch, what if you only wrap the include by #ifdef >>>>> HAVE_UNISTD_H? >>>>> >>>>> Something like: >>>>> #ifdef HAVE_UNISTD_H >>>>> #include <unistd.h> >>>>> #endif >>>>> >>>>> We have a similar bug for OS X >>>>> https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1776, which I haven't >>>>> had time to look into yet. >>>>> >>>>> >>>> FYI, I've attached this patch on bug 1776 asking someone to test it on OSX >>>> >>>> >>>> >>> Thanks, I applied the patch here: >>> http://git.clamav.net/gitweb?p=clamav-devel.git;a=commit;h=ce0c204a7ebcd6075cd58daeb5a5c2909343556c >>> >> >> Thank you. >> >> But there is a user saying he still has problems on FreeBSD 7.2, i can't >> reproduce, maybe you can help me to identify what's happening. >> >> Attached is the user's buildlog. >> > > The problems is around here: > checking build system type... i386-portbld-freebsd7.2 > checking host system type... i386-portbld-freebsd7.2 > checking target system type... i386-portbld-freebsd7.2 > > That should be i686-... > > ..... > checking for supported C++ compiler version... ok (4.2.1) > checking for supported OS... ok (i386-freebsd7.2) > .... > checking for GCC atomic builtins... no > configure: WARNING: LLVM will be built thread-unsafe because atomic > builtins are missing > ... > bytecode2llvm.cpp:63:2: error: #error "Multithreading support must be > available to LLVM!" > > I can work around the missing atomics (by adding a mutex around the > entire code), however I think its better if we find out why the atomics > are not available. > > This is the test program: > int main() { > volatile unsigned long val = 1; > __sync_synchronize(); > __sync_val_compare_and_swap(&val, 1, 0); > __sync_add_and_fetch(&val, 1); > __sync_sub_and_fetch(&val, 1); > return 0; > } > > It builds fine with default settings for me: > gcc test.c > > However it fails with -march=i386: > gcc test.c -march=i386 > /tmp/cc6dcRh7.o: In function `main': > test.c:(.text+0x29): undefined reference to `__sync_val_compare_and_swap_4' > collect2: ld returned 1 exit status > > But even building for 486 works: > gcc test.c -march=i486 > > What does happen on user's system if he/she runs gcc test.c? > > Question is why is ClamAV/LLVM built for i386? It should build for i686....
I'll ask user to test it, but anyway, here you can see a buildlog on my 7.2 tinderbox that went fine, and it was built for i386 too... http://freebsd1.asmallorange.com//logs/7.2-i386-garga/clamav-devel-20091221.log -- Renato Botelho _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net
