Error at make on MacOS High Sierra


#1

9429:~ administrator$ cd pjx/sqlcipher/
9429:sqlcipher administrator$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_UNLOCK_NOTIFY"
checking build system type… i386-apple-darwin17.4.0
checking host system type… i386-apple-darwin17.4.0
checking how to print strings… printf
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for a sed that does not truncate output… /usr/bin/sed
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for fgrep… /usr/bin/grep -F
checking for ld used by gcc… /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld… no
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 196608
checking how to convert i386-apple-darwin17.4.0 file names to i386-apple-darwin17.4.0 format… func_convert_file_noop
checking how to convert i386-apple-darwin17.4.0 file names to toolchain format… func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for dlltool… no
checking how to associate runtime and link libraries… printf %s\n
checking for ar… ar
checking for archiver @FILE support… no
checking for strip… strip
checking for ranlib… ranlib
checking for gawk… no
checking for mawk… no
checking for nawk… no
checking for awk… awk
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for sysroot… no
checking for a working dd… /bin/dd
checking how to truncate binary pipes… /bin/dd bs=4096 count=1
checking for mt… no
checking if : is a manifest tool… no
checking for dsymutil… dsymutil
checking for nmedit… nmedit
checking for lipo… lipo
checking for otool… otool
checking for otool64… no
checking for -single_module linker flag… yes
checking for -exported_symbols_list linker flag… yes
checking for -force_load linker flag… yes
checking how to run the C preprocessor… gcc -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… yes
checking for gcc option to produce PIC… -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works… yes
checking if gcc static flag -static works… no
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries… yes
checking dynamic linker characteristics… darwin17.4.0 dyld
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for a BSD-compatible install… /usr/bin/install -c
checking for special C compiler options needed for large files… no
checking for _FILE_OFFSET_BITS value needed for large files… no
checking for int8_t… yes
checking for int16_t… yes
checking for int32_t… yes
checking for int64_t… yes
checking for intptr_t… yes
checking for uint8_t… yes
checking for uint16_t… yes
checking for uint32_t… yes
checking for uint64_t… yes
checking for uintptr_t… yes
checking for sys/types.h… (cached) yes
checking for stdlib.h… (cached) yes
checking for stdint.h… (cached) yes
checking for inttypes.h… (cached) yes
checking malloc.h usability… no
checking malloc.h presence… no
checking for malloc.h… no
checking for fdatasync… yes
checking for gmtime_r… yes
checking for isnan… yes
checking for localtime_r… yes
checking for localtime_s… no
checking for malloc_usable_size… no
checking for strchrnul… no
checking for usleep… yes
checking for utime… yes
checking for pread… yes
checking for pread64… no
checking for pwrite… yes
checking for pwrite64… no
checking for tclsh8.6… no
checking for tclsh8.5… tclsh8.5
configure: Version set to 3.20
configure: Release set to 3.20.1
configure: Version number set to 3020001
checking whether to support threadsafe operation… yes
checking for library containing pthread_create… none required
checking for library containing pthread_mutexattr_init… none required
checking for crypto library to use… openssl
checking for HMAC_Init_ex in -lcrypto… yes
checking whether to allow connections to be shared across threads… no
checking whether to support shared library linked as release mode or not… no
checking whether to use an in-ram database for temporary tables… yes
checking if executables have the .exe suffix… unknown
checking for Tcl configuration… configure: WARNING: Can’t find Tcl configuration definitions
configure: WARNING: *** Without Tcl the regression tests cannot be executed ***
configure: WARNING: *** Consider using --with-tcl=… to define location of Tcl ***
checking for library containing readline… -ledit
checking for library containing fdatasync… none required
checking for library containing dlopen… none required
checking whether to support MEMSYS5… no
checking whether to support MEMSYS3… no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlcipher.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
9429:sqlcipher administrator$ make
./libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/Users/administrator/pjx/sqlcipher/src -I/Users/administrator/pjx/sqlcipher/ext/rtree -I/Users/administrator/pjx/sqlcipher/ext/icu -I/Users/administrator/pjx/sqlcipher/ext/fts3 -I/Users/administrator/pjx/sqlcipher/ext/async -I/Users/administrator/pjx/sqlcipher/ext/session -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -no-undefined -o libsqlcipher.la sqlite3.lo -lcrypto
-rpath “/usr/local/lib” -version-info “8:6:8”
libtool: link: gcc -dynamiclib -o .libs/libsqlcipher.0.dylib .libs/sqlite3.o -lcrypto -install_name /usr/local/lib/libsqlcipher.0.dylib -compatibility_version 9 -current_version 9.6 -Wl,-single_module
Undefined symbols for architecture x86_64:
“_HMAC_CTX_free”, referenced from:
_sqlcipher_openssl_hmac in sqlite3.o
“_HMAC_CTX_new”, referenced from:
_sqlcipher_openssl_hmac in sqlite3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libsqlcipher.la] Error 1

What is my mistake?


#2

Hi @gregkr

It appears you may have an older version of OpenSSL (possibly less than 1.1.0) installed on your machine. Is that the case? You might installing a new version of OpenSSL, or building SQLCipher against a newer version of OpenSSL. The problem is during the linking phase on your machine:

libtool: link: gcc -dynamiclib -o .libs/libsqlcipher.0.dylib .libs/sqlite3.o -lcrypto -install_name /usr/local/lib/libsqlcipher.0.dylib -compatibility_version 9 -current_version 9.6 -Wl,-single_module
Undefined symbols for architecture x86_64:
“_HMAC_CTX_free”, referenced from:
_sqlcipher_openssl_hmac in sqlite3.o
“_HMAC_CTX_new”, referenced from:
_sqlcipher_openssl_hmac in sqlite3.o
ld: symbol(s) not found for architecture x86_64

#3

Hi @developernotes

OpenSSL 1.1.0i 14 Aug 2018

There is a function sqlcipher_openssl_hmac(…) in sqlcipher\src\cpypto_openssl.c.
And it calls HMAC_CTX_new() /HMAC_CTX_free(…). It turns out that the configuration
for darwin17.4 in configure is not provided. and by default it does not work.
What about such explanation?


#4

Hi @developernotes

I useв your recommendation from another branch from Oct 2017

./configure … LDFLAGS="/usr/lib/x86_64-linux-gnu/libcrypto.a"

Thats was enough.
Thank your very much.


#5

Hello @gregkr

We are happy to hear you were able to resolve the compilation issue. Take care!