retdec: Fails to build with Xcode 10 on macOS Mojave, openssl and yaracpp issue

I’ve been trying to get this to build with Xcode 10 on macOS Mojave, but it seems to be running into trouble with 2 of the dependencies.

CMake Error at /Users/user/Software/RetDec/0.7/retdec-master/build/deps/openssl/openssl/src/openssl-stamp/openssl-build-Release.cmake:16 (message):
  Command failed: 2

   'make' '-j8'

  See also

    /Users/user/Software/RetDec/0.7/retdec-master/build/deps/openssl/openssl/src/openssl-stamp/openssl-build-*.log


make[2]: *** [deps/openssl/openssl/src/openssl-stamp/openssl-build] Error 1
make[1]: *** [deps/openssl/CMakeFiles/openssl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

CMake Error at /Users/user/Software/RetDec/0.7/retdec-master/build/external/src/yaracpp-project-stamp/yaracpp-project-build-Release.cmake:16 (message):
  Command failed: 2

   '/Applications/Xcode.app/Contents/Developer/usr/bin/make'

  See also

    /Users/user/Software/RetDec/0.7/retdec-master/build/external/src/yaracpp-project-stamp/yaracpp-project-build-*.log


make[2]: *** [external/src/yaracpp-project-stamp/yaracpp-project-build] Error 1
make[1]: *** [deps/yaracpp/CMakeFiles/yaracpp-project.dir/all] Error 2

Attached are the log files detailing the errors.

openssl-build-err.log yaracpp-project-build-err.log

Based on the log file info, I suspect this issue may be related to Apple dropping support for 32-bit code.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 43 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, I had the same issue and I’ve been able to fix it by these steps:

OpenSSL issue occurred because cmake was unable to locate it. I fixed this issue by explicitly exporting environment variables with brew installed openssl paths:

export OPENSSL_ROOT_DIR=/usr/local//Cellar/openssl/1.0.2s/
export OPENSSL_LIBRARIES=/usr/local//Cellar/openssl/1.0.2s/lib/

Then I stumbled on the same issue with yaracpp as you. The version of clang that is used by autoconf (installed by Xcode’s command-line tools) has invalid include paths which result in basic c program compilation to fail.

To fix this I reinstalled macOS SDK headers:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

After this, I was able to install RetDec successfully.

Edit: If OpenSSL is installed from brew then a more generic solution for the specification of OpenSSL path would be:

export OPENSSL_ROOT_DIR="$(brew --prefix openssl)"
export OPENSSL_LIBRARIES="$(brew --prefix openssl)/lib"

Thank you @appleguru for the files.

I have prepared branch macos-build in yaracpp repo where we tried to set sysroot of compiler to macOS SDK when configuring yara. It would be really helpful if you or anyone else tried to compile it WITHOUT installed SDK headers.

git clone https://github.com/avast-tl/yaracpp.git
cd yaracpp
git checkout macos-build
mkdir build
cd build
cmake ..
cmake --build .