c - Is libsasl2 broken on OSX Yosemite? Missing sasl_client_done -
c - Is libsasl2 broken on OSX Yosemite? Missing sasl_client_done -
i've been having problem installed version of libsasl2 (cyrus sasl).
in particular, seems local headers , sasl_version study version 2.1.26, no symbol provided global function sasl_client_done.
i'm pretty sure i'm supposed have symbol because:
it's there in provided sasl/sasl.h header the cyrsus sasl news file lists "implemented sasl_client_done()/sasl_server_done()" 2.1.24 feature it's there everywhere provides 2.1.26 outside of yosemitefor reproduction:
note sample below prints "impl: 'cyrus sasl', version: 33619994, major: 2, minor: 1, step: 26" the sample compiles , executes on linux install same library version after uncommenting codethe uncommented code produces link error on yosemite
undefined symbols architecture x86_64: "_sasl_client_done", referenced from: _main in foo-072675.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation)
invoking compiler with:
clang -wall -werror -lsasl2 -o foo foo.c -v
with clang -v of:
apple llvm version 6.0 (clang-600.0.54) (based on llvm 3.5svn) target: x86_64-apple-darwin14.0.0 thread model: posix "/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name foo.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -v -resource-dir /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/../lib/clang/6.0 -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk -wall -werror -fdebug-compilation-dir /users/jcarey/work -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature -fdiagnostics-show-option -vectorize-slp -o /var/folders/wq/jypwqgv976n0db5l5qxw900r0000gq/t/foo-92054e.o -x c foo.c clang -cc1 version 6.0 based upon llvm 3.5svn default target x86_64-apple-darwin14.0.0 ignoring nonexistent directory "/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/usr/local/include" ignoring nonexistent directory "/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/library/frameworks" #include "..." search starts here: #include <...> search starts here: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/../lib/clang/6.0/include /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/usr/include /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/system/library/frameworks (framework directory) end of search list. "/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -syslibroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk -o foo -lsasl2 /var/folders/wq/jypwqgv976n0db5l5qxw900r0000gq/t/foo-92054e.o -lsystem /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.osx.a undefined symbols architecture x86_64: "_sasl_client_done", referenced from: _main in foo-92054e.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation)
and code in question:
#include <sasl/sasl.h> #include <stdio.h> #include <stdint.h> int main(int argc, char ** argv) { const char *impl; int version; uint32_t buf; uint16_t major; uint8_t minor; uint8_t step; sasl_version(&impl, &version); buf = version; major = buf >> 24; minor = (buf << 8) >> 24; step = (buf << 24) >> 24; printf("impl: '%s', version: %d, major: %d, minor: %d, step: %d\n", impl, version, major, minor, step); /* { int (* scd)(void); scd = &sasl_client_done; printf("sasl_client_done: %p\n", scd); } */ homecoming 0; }
i'm thinking something's screwy way cyrus sasl got packaged yosemite (using symbol list mavericks perhaps?).
as matter of interest, checked 10.10.4 , see symbol there:
$ nm /usr/lib/libsasl2.dylib |grep sasl_client_done 000000000000724a t _sasl_client_donethe sample code works fine (with commented section uncommented). same cyrus sasl version still returned though:
impl: 'cyrus sasl', version: 33619994, major: 2, minor: 1, step: 26 sasl_client_done: 0x7fff8e3dc24a c osx osx-yosemite sasl
Comments
Post a Comment