This ports over the RISC-V architecture from Qemu. This is currently a
very barebones transition. No code hooking or any fancy stuff.
Currently, you can feed it instructions and query the CPU state itself.
This also allows choosing whether or not RISC-V 32-bit or RISC-V 64-bit
is desirable through Unicorn's interface as well.
Extremely basic examples of executing a single instruction have been
added to the samples directory to help demonstrate how to use the basic
functionality.
* Integration with oss-fuzz
* Use CFLAGS even for linking
as for fuzzing with asan
* Do not abort on uc_emu_start error
* Redirect fuzz output somewhere else than stdout
* Use uc_open for every fuzz instance
* Avoids timeouts from infinite loops
Limiting the number of instructions
* Moving fuzz to tests directory
* Haiku: fix broken gcc strong stack protector
* qemu: Backport minor Haiku fix
We need to push this fix upstream to qemu. If we don't
get it upstreamed, i'll circle back and patch it if
Unicorn updates its qemu version.
Backports commit c7be4a2160e15089563f207752fb346a38db18ec from unicorn
Introduce a new crypto/ directory that will (eventually) contain
all the cryptographic related code. This initially defines a
wrapper for initializing gnutls and for computing hashes with
gnutls. The former ensures that gnutls is guaranteed to be
initialized exactly once in QEMU regardless of CLI args. The
block quorum code currently fails to initialize gnutls so it
only works by luck, if VNC server TLS is not requested. The
hash APIs avoids the need to litter the rest of the code with
preprocessor checks and simplifies callers by allocating the
correct amount of memory for the requested hash.
Backports commit ddbb0d09661f5fce21b335ba9aea8202d189b98e from qemu
Providing a default level of parallelism is perfectly fine, but it
should also be possible to set higher or lower levels of parallelism
easily. This is particularly beneficial for people packaging the
software for Linux distributions.
- in appveyor, install clang and cmake in cygwin, enable package upgrades, and build cmocka and enable testing for gcc only
- in `gitignore`, ignore generated cmocka folder
- in travis, use brew in osx to install cmocka, and enable testing for gcc and clang on os x and linux
- in `Makefile`, change to use `uname -s` to determine os type
- make `install-cmocka-linux.sh`, a simple shell script to download and install cmocka on linux
- in `bindings/Makefile`, enable `make -c` to call subdirectory makefiles instead of `cd [dir] && make` and include environment variables for runtime access to generated libraries
- in `samples/Makefile`, change to use `uname -s` to determine os type, remove `clean_bins` from `all` command, and include `Werror` for compile strictness
- in `tests/unit/Makefile`, add `cflags` for compile time access to cmocka headers and library, include execute vars for runtime access to cmocka and unicorn libs
- in `tests/unit/test_tb_x86.c`, comment out assert that would not compile
Now that LIBRARY is the versioned name (e.g. "libunicorn.so.0"), we
don't need this rename step; just create the symlink for libunicorn.so.
If VERSION_EXT isn't set, then the library we installed already has the
correct name, and no symlink is necessary.
We should probably be running 'ldconfig' to handle this, or better yet,
using libtool.
This allows executables (e.g. unit tests) to link against the
libunicorn.so in the build directory, after the SONAME was added in
4860fdb3.
Becuase libunicorn.so has an SONAME of libunicorn.so.0, the linker uses
the SONAME for the DT_NEEDED entry of the tests. But because a library
with that name did not exist, they would fail to run.