On 01/27/2010 01:27 PM, Renato Botelho wrote:
> 2010/1/27 Török Edwin <edwinto...@gmail.com>:
>   
>> On 01/27/2010 12:48 PM, Renato Botelho wrote:
>>     
>>> 2010/1/26 Török Edwin <edwinto...@gmail.com>:
>>>
>>>       
>>>> On 12/22/2009 02:39 PM, Renato Botelho wrote:
>>>>
>>>>         
>>>>> 2009/12/22 Török Edwin <edwinto...@gmail.com>:
>>>>>
>>>>>
>>>>>           
>>>>>> Yes, I opened a bug about that now:
>>>>>> https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1781
>>>>>>
>>>>>> For now the workaround for the user is to set the CPU for the build to
>>>>>> at least i486.
>>>>>>
>>>>>>
>>>>>>             
>>>>> OK, i'll mark clamav-devel port as BROKEN on FreeBSD i386 for now.
>>>>>
>>>>>           
>>>> Hi Renato,
>>>>
>>>> I have added the mutex workaround when building on i386, sorry for
>>>> taking so long to fix.
>>>> Also removed the Perl dependency from LLVM's configure, which would be
>>>> needed only if we'd use LLVM's buildsystem.
>>>> We don't use that, I've written a Makefile.am for LLVM.
>>>>
>>>> ClamAV should now build again on i386/FreeBSD, please test and report if
>>>> you still have any build problems.
>>>>
>>>> The fix is in the git master repository (if you use git). If you are
>>>> using a snapshot, then it will be in tomorrow's snapshot.
>>>>
>>>>         
>>> I had started the tests, but i was thinking something, i think we just have
>>> a "name" problem here, FreeBSD call 32-bit arch as i386, but it doesn't
>>> mean that is i386, looking at FreeBSD kernel config file we have 3
>>> possibilities of CPU:
>>>
>>> cpu             I486_CPU
>>> cpu             I586_CPU
>>> cpu             I686_CPU
>>>
>>> As you can see, it's not really i386, so, i think we can build llvm thread 
>>> safe.
>>>
>>>       
>> Would this solve it in your ports makefile (or is it too late to override?):
>> CPUTYPE?=i586
>>     
>
> The problem is I cannot set this var under ports Makefile
>   

Can you detect whether CPUTYPE was set or not?
If variable was not set, then add -march=i486 to CFLAGS and CXXFLAGS.
If variable is set then I assume CFLAGS/CXXFLAGS are already setup by
the ports system?

>   
>> That way the user can still set the CPUTYPE explicitly in /etc/make.conf
>> to something better,
>> and we'd get a good default (i586 instead of i386).
>> LLVM JIT generates code for pentium and above only, so if you really run
>> it on a i386/i486 ClamAV won't
>> use LLVM's JIT (but fallback to an interpreter).
>>     
>
> If user choose to set it on make.conf ports will respect.
>
>   
>> Please add back this code to libclamav/c++/bytecode2llvm.cpp while
>> testing if CPUTYPE override works:
>> #if !defined(LLVM_MULTITHREADED) || !LLVM_MULTITHREADED
>> #error "Multithreading not available for llvm?"
>> #endif
>>
>>     
>>> What do you think about it?
>>>
>>>       
>> I think the problem is how FreeBSD's gcc is built.
>> If gcc is built with i386-* triple, it will generate i386 code by
>> default. Debian's is built as i486-linux-gnu.
>> Anyway I don't think we can do anything about how gcc is built for old
>> versions of FreeBSD.
>>     
>
> The oldest supported FreeBSD version is 6.x, and on this version we just
> support i486+ CPUs on kernel. Based on this, when FreeBSD say you
> i386-freebsd it just try to say it's running x86 arch, but cpu supported
> is 486+
>   

Yes, I understand that. But for gcc i386-* means generate code that runs
on i386,
i486-* means generate code that runs on i486 by default (and gcc itself
is compiled in such a way).
IMHO it would make sense to do this:
 - for official FreeBSD packages build with CPUTYPE/-march set to the
oldest CPU supported (i486 in this case)
 - for ports built by users, it should default to -march=native to get
best performance

But this is getting offtopic, I don't want to change how FreeBSD builds
its packages by default.


> I'll try to contact someone directly from freebsd gcc team.
>
> Anyway, clamav built fine on FreeBSD 6, 7 and 8 i386 and amd64. If you
> have some time, take a look at build logs here:
>
> http://freebsd1.asmallorange.com/index.php?action=describe_port&id=566
>   

7.2 and 8.0 buildlogs look fine.
6.4 has this:

checking for supported C++ compiler version... configure: error: C++ compiler 
too old (3.4.6)


BTW you can add --enable-llvm to configure.
That way it will fail at configure time if LLVM is not supported.

> http://freebsd2.asmallorange.com/index.php?action=describe_port&id=365
>   

====================<phase 5: make test>====================

make: don't know how to make regression-test(continuing)


You can run it: "make check" (needs the "check" package to be really useful).


Best regards,
--Edwin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to