Open rklyujkov opened 10 years ago
The Makefile should allow you to simply execute:
CC=clang make
I can't say that I've tested clang compilation in OSX, so let me know if you run into any issues with that.
make ends with:
clang: error: unsupported option '-static-libgcc'
Without this option make generates swarm of undefined symbols like:
Undefined symbols for architecture i386: "_CyaSSL_CTX_free", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) _Curl_cyassl_close in libcurl.a(libcurl_la-cyassl.o) "_CyaSSL_CTX_load_verify_locations", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) "_CyaSSL_CTX_new", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) ...
... even for STL symbols:
"std::string::find_last_of(char, unsigned long) const", referenced from:
mimetic::utils::extractFilename(std::string const&) in libmimetic.a(utils.o)
"std::string::find_firstof(char const, unsigned long) const", referenced from:
mimetic::operator<<(std::ostream&, mimetic::FieldParam const&) in libmimetic.a(fieldparam.o)
"std::string::end() const", referenced from:
mimetic::AddressList::set(std::string const&) in libmimetic.a(addresslist.o)
mimetic::ContTokenizerstd::string::setSource(std::string const) in libmimetic.a(contenttype.o)
mimetic::IsDelim
clang: error: unsupported option '-static-libgcc'
Yes, I will have to fix the Makefile
Regarding the other issues, I just tested in OSX kernel 10.8 using clang version 3.0 (tags/Apple/clang-211.10.1) and I have no issue with either of the below:
CC=clang make
and
CC=clang++ make
It is also building fine with clang on Linux, as tracked here: https://travis-ci.org/kylehuff/libwebpg
Unfortunately, I don't have any advice for you at the moment; perhaps when I get off work I might be able to find the reason. At first guess, it appears to indicate something is different with your build environment.
@rklyujkov
This shouldn't be an issue anymore.
To compile using clang, simply execute CXX=clang++ make
How can build the library for os x on clang (not gcc)?