Installation/Configuration of Unicorn
Unicorn can be installed in OSX (Sierra), Linux, and Windows. I have installed it on OSX and Linux. I will leave some workarounds that I used to manage the unexpected hiccups during the installation in OSX and Linux.
- Unicorn official website: http://www.unicorn-engine.org/
- Test codes: http://www.unicorn-engine.org/samples/test1.tgz
There is an issue on testing with unicorn.
[21:03] 149-161-212-7: test1 $ make cc test1.c -L/usr/local/Cellar/glib/2.52.0/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -lpthread -lm -lunicorn -o test1 test1.c:5:10: fatal error: 'unicorn/unicorn.h' file not found #include <unicorn/unicorn.h> ^ 1 error generated. make: *** [test1] Error 1
It requires clang of XCode. In order to get the clang, make sure that XCode is installed with the “Command Line Tools”.
As The useful link of installation of “Command Line Tools” mentions,
xcode-select --installdid not work for me because it kept failing to get the “Command Line Tools” due to the network issues. My network was just fine but it seemed that my MBP could not get the “Command Line Tools” from the Apple App Store. So, I just downloaded the “Command Line Tools” dmg file from here as the above link suggests. Other than this,
brew install unicornmade unicorn works just fine based on the unicorn tutorials.
So far I did not have any issues with the github version.
UNICORN_ARCHS="arm aarch64 x86" ./make.shI lied! There was an issue on ubuntu-16.04 (cc-5.4.0) which does not compile the unicorn test codes without “-pthread” option. So, the workaround is that we have to put the
-pthreadoption in the Makefile or add it on the fly. The test codes that I played with is in here. I realized that this option is not necessary in Debian-8 (cc-4.9.5). It may not be necessary for the other distros either. Please check it out.