I am having problems with the installed version of libsasl2 (Cyrus SASL).
In particular, it seems that the local headers and report are sasl_version version 2.1.26, but no character is specified for the global function sasl_client_done.
I am sure that I should have this symbol, because:
- It is present in the provided sasl / sasl.h header.
- List of news files cyrsus sasl NEWS "Implemented sasl_client_done () / sasl_server_done ()" as a function 2.1.24.
- It is there everywhere, which provides 2.1.26 outside of Yosemite.
To play:
- Please note that the sample below prints
- "impl: 'Cyrus SASL', version: 33619994, major: 2, minor: 1, step: 26"
- the sample compiles and runs when installing linux with the same library version after uncommenting the code
code without commenting creates a link error to yosemite
Undefined symbols for architecture x86_64: "_sasl_client_done", referenced from: _main in foo-072675.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
calling the compiler with
clang -Wall -Werror -lsasl2 -o foo foo.c -v
with clang -v from:
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 -xc 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 for architecture x86_64: "_sasl_client_done", referenced from: _main in foo-92054e.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
And the 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); } */ return 0; }
I think something is entrusted with how cyrus sasl was packaged for Yosemite (perhaps using a list of characters from Mavericks?).