You need to compile OpenSSL with the PURIFY flag (-DPURIFY in CFLAGS) to get rid of errors. Do not use the version compiled this way in the final application for debugging purposes only, as it reduces the entropy used in different places.
For example, compile OpenSSL in debug mode with
./config -d no-static shared zlib -Wa,--noexecstack -DPURIFY -O0 -ggdb3
source share