[botan-devel] Linker error on OS X 10.11.2

Jack Lloyd lloyd at randombit.net
Tue Dec 29 09:41:10 EST 2015


Hi Sviatoslav,

This error appears to be due to the recent addition of a call to a
Darwin security framework call (in module darwin_secrandom). It looks
like to call SecRandomCopyBytes you must reference the framework at
link time also.

Solving the problem may be as simple as adding the Security framework
to your build. However I do not know if there are any additional
implications to linking with a framework or etc; perhaps someone who
knows more about OS X frameworks can chime in on this.

If you don't want the additional dependency you can disable the use of
SecRandomCopyBytes by adding

--disable-modules=darwin_secrandom

to your configure.py line which is likely perfectly fine as this
function is actually only particularly useful in environments without
access to /dev/urandom (due to iOS sandboxing and the like).

What is the value of BOTAN_LIB_LINK in build.h? That value is
reflected into the output of `botan config libs` which should include
all needed library link flags.

I don't use OS X or iOS so I can't test any of this myself, but
hopefully this helps.

Best,
  Jack

On Tue, Dec 29, 2015 at 05:01:08AM +0000, Sviatoslav Feshchenko wrote:
> Hello,
> 
> 
> I have the following environment:
> 
> 
> Mac OS X 10.11.2
> 
> Botan 1.11.25 (configured --with=lzma)
> 
> Clang LLVM v 7.0.2 tageting x86_64-apple-darwin15.2.0
> 
> 
> When I declare the following variable in the private section of a class:
> 
> 
>         Botan::AutoSeeded_RNG rng_m;
> 
> 
> I get the following linker error:
> 
> 
> Undefined symbols for architecture x86_64:
> 
>   "_SecRandomCopyBytes", referenced from:
> 
>       Botan::Darwin_SecRandom::poll(Botan::Entropy_Accumulator&) in libbotan-1.11.a(entropy_darwin_secrandom.o)
> 
>   "_kSecRandomDefault", referenced from:
> 
>       Botan::Darwin_SecRandom::poll(Botan::Entropy_Accumulator&) in libbotan-1.11.a(entropy_darwin_secrandom.o)
> 
> ld: symbol(s) not found for architecture x86_64
> 
> 
> I don't know if this is a bug in the library. Please help!
> 
> 
> Many thanks

> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel



More information about the botan-devel mailing list