Hi,
I have seen a recent update where Dynamo RIO introduces configure_DynamoRIO_static_client() cmake function to compile static clients. I am not entirely sure what this does, but I was hoping that I can now create my own tool that is a standalone binary and does not require drrun to run.
The cmake file for my old tool looks as follows:
```
cmake_minimum_required(VERSION 3.28)
project(my_tool)
add_library(my_tool SHARED my_tool.c)
find_package(DynamoRIO)
if (NOT DynamoRIO_FOUND)
message(FATAL_ERROR "DynamoRIO package required to build")
endif(NOT DynamoRIO_FOUND)
configure_DynamoRIO_client(my_tool)
use_DynamoRIO_extension(my_tool drmgr)
```
And it compiles libmy_tool.so library, which I can use like this:
./bin64/drrun -c ../../my_tool/build/libmy_tool.so -- vim
I was hoping that I can recompile my tool by changing cmake file as follows:
cmake_minimum_required(VERSION 3.28)
project(my_tool)
add_executable(my_tool my_tool.c)
set(extra_flags "-DSTATIC_LIBRARY")
find_package(DynamoRIO)
if (NOT DynamoRIO_FOUND)
message(FATAL_ERROR "DynamoRIO package required to build")
endif(NOT DynamoRIO_FOUND)
configure_DynamoRIO_global(OFF ON)
configure_DynamoRIO_static(my_tool)
configure_DynamoRIO_static_client(my_tool)
use_DynamoRIO_extension(my_tool drmgr_drstatic)
To be able to run the tool as follows:
./../sha_mask/build/my_tool -- vim
But it ends up with immediate segmentation fault.
Could you tell me if what I want is even possible and if yes, how can I achieve it?
--
Regards,
Maksym Planeta