On 10/05/2014 11:22, James Lee wrote:

I think it is intended to call this via cl_initialize_crypto(), except it's not called.
"__attribute__((constructor))" works, compiler tested, but not here.
...
Please don't take this as final, it's just a hint towards the problem.

Indeed <rant>it's the usual brain dead pile-O-rubbish that is configure and friends</rant>.

*** simple workaround:
CPPFLAGS="... -DHAVE_ATTRIB_PACKED"

My complete CPPFLAGS are:
CPPFLAGS="-D__EXTENSIONS__ -DHAVE_ATTRIB_PACKED"



*** Fix
Fix configure.
configure checks for __attribute__((packed)) and make the wrong decision.

configure assumes that if the compiler is not GNU it can't have the extension so doesn't bother checking:
#ifdef __GNUC__
struct { int i __attribute__((packed)); } s;
#else
#error Only checking for packed attribute on gcc-like compilers
#endif

which is silly because if it's the gnu cc then the answer is already known, it's the non gnu cc that need checking. However moving on, based on the packed check this add to the headers:
#ifndef HAVE_ATTRIB_PACKED
#define __attribute__(x)
#endif
which renders all __attributes__ ineffective including the "__attribute__((constructor))" which is needed to initialise openssl. For it to work in the general case "__attribute__((constructor))" should be checked.



James.
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/support/ml

Reply via email to