diff --git a/cmake/qemu.cmake b/cmake/qemu.cmake index 0083211d..7585419d 100644 --- a/cmake/qemu.cmake +++ b/cmake/qemu.cmake @@ -50,7 +50,7 @@ if(BUILD_QEMU) # make sure aspects don't fail to match in entry.cc include_directories(${PROJECT_SOURCE_DIR}/src/core ${CMAKE_BINARY_DIR}/src/core) add_executable(fail-client "${qemu_lib}") - target_link_libraries(fail-client "${qemu_lib}" fail ${qemu_library_dependencies}) + target_link_libraries(fail-client -Wl,-whole-archive "${qemu_lib}" -Wl,-no-whole-archive fail ${qemu_library_dependencies}) install(TARGETS fail-client RUNTIME DESTINATION bin) # a few QEMU-specific passthrough targets: diff --git a/src/core/config/FailConfig.hpp.in b/src/core/config/FailConfig.hpp.in index d18643e7..19db6e93 100644 --- a/src/core/config/FailConfig.hpp.in +++ b/src/core/config/FailConfig.hpp.in @@ -34,5 +34,7 @@ #cmakedefine CLIENT_RAND_BACKOFF_TSTART @CLIENT_RAND_BACKOFF_TSTART@ #cmakedefine CLIENT_RAND_BACKOFF_TEND @CLIENT_RAND_BACKOFF_TEND@ #cmakedefine CLIENT_RETRY_COUNT @CLIENT_RETRY_COUNT@ +#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@" +#define FAIL_VERSION PROJECT_VERSION #endif // __FAIL_CONFIG_HPP__ diff --git a/src/core/sal/CMakeLists.txt b/src/core/sal/CMakeLists.txt index 4cae2c26..2221c11b 100644 --- a/src/core/sal/CMakeLists.txt +++ b/src/core/sal/CMakeLists.txt @@ -41,6 +41,7 @@ elseif(BUILD_QEMU) SimulatorController.cc qemu/QEMUController.cc qemu/QEMUListener.cc + qemu/wrappers.cc ) endif(BUILD_BOCHS) diff --git a/src/core/sal/qemu/wrappers.cc b/src/core/sal/qemu/wrappers.cc new file mode 100644 index 00000000..17fc96d6 --- /dev/null +++ b/src/core/sal/qemu/wrappers.cc @@ -0,0 +1,16 @@ +#include "../SALInst.hpp" +#include "config/FailConfig.hpp" + +extern "C" { + +#include +//#include "qemu/failqemu.h" + +struct CPUX86State; +void failqemu_init(struct CPUX86State *env) +{ + printf("FailQEMU v%s\n", FAIL_VERSION); + fail::simulator.startup(); +} + +}