$ cmake -DDynamoRIO_DIR=../../cmake .
CMake Error at /home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOConfig.cmake:662 (include):
include could not find load file:
/home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOTarget64.cmake
Call Stack (most recent call first):
CMakeLists.txt:131 (find_package)
CMake Error at /home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOConfig.cmake:1352 (message):
DynamoRIO Extension "drmgr" not found
Call Stack (most recent call first):
CMakeLists.txt:156 (use_DynamoRIO_extension)
CMakeLists.txt:199 (add_sample_client)
-- Configuring incomplete, errors occurred!
See also "/home/david/dbi/dynamorio/build_arm/api/samples/CMakeFiles/CMakeOutput.log".
#include "dr_api.h"
#include "drmgr.h"
#include "syscall.h"
static void event_exit() {
drmgr_exit();
}
static void event_post_syscall(void *drcontext, int sysnum) {
reg_t result = dr_syscall_get_result(drcontext);
dr_printf("syscall %d: %d\n", sysnum, result);
}
DR_EXPORT void dr_client_main(client_id_t id, int argc, const char *argv[]) {
drmgr_init();
dr_register_exit_event(event_exit);
drmgr_register_post_syscall_event(event_post_syscall);
}
add_library(testclient SHARED testclient.c)
find_package(DynamoRIO)
if (NOT DynamoRIO_FOUND)
message(FATAL_ERROR "DynamoRIO package required to build")
endif(NOT DynamoRIO_FOUND)
configure_DynamoRIO_client(testclient)
use_DynamoRIO_extension(testclient drmgr)
$ cmake -DDynamoRIO_DIR=../cmake .
$ make
$ ../bin64/drrun -c ./libtestclient.so -- /bin/ls
$ cmake -DDynamoRIO_DIR=../cmake .
CMake Error at /home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOConfig.cmake:662 (include):
include could not find load file:
/home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOTarget64.cmake
Call Stack (most recent call first):
CMakeLists.txt:2 (find_package)
CMake Error at /home/david/dbi/dynamorio/build_arm/cmake/DynamoRIOConfig.cmake:1352 (message):
DynamoRIO Extension "drmgr" not found
Call Stack (most recent call first):
CMakeLists.txt:7 (use_DynamoRIO_extension)
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
-DCMAKE_TOOLCHAIN_FILE=../../make/toolchain-arm32.cmake
-DCMAKE_FIND_ROOT_PATH=/usr/arm-linux-gnueabihf
-DTARGET_ABI=linux-gnueabihf
Thank you!- David
$ cat dynamorio/api/samples/testclient.c
#include "dr_api.h"
#include "drmgr.h"
#include "syscall.h"
static void event_exit() {
drmgr_exit();
}
static void event_post_syscall(void *drcontext, int sysnum) {
reg_t result = dr_syscall_get_result(drcontext);
dr_printf("syscall %d: %d\n", sysnum, result);
}
DR_EXPORT void dr_client_main(client_id_t id, int argc, const char *argv[]) {
drmgr_init();
dr_register_exit_event(event_exit);
drmgr_register_post_syscall_event(event_post_syscall);
}
$$ git diff api/samples/CMakeLists.txt
diff --git a/api/samples/CMakeLists.txt b/api/samples/CMakeLists.txt
index 5c26f37..97e49fc 100644
--- a/api/samples/CMakeLists.txt
+++ b/api/samples/CMakeLists.txt
@@ -213,6 +213,7 @@ add_sample_client(empty "empty.c" "")
add_sample_client(memtrace_simple "memtrace_simple.c;utils.c" "drmgr;drreg;drutil;drx")
add_sample_client(memval_simple "memval_simple.c;utils.c" "drmgr;drreg;drutil;drx")
add_sample_client(instrace_simple "instrace_simple.c;utils.c" "drmgr;drreg;drx")
+add_sample_client(testclient "testclient.c" "drmgr") <---
if (X86) # FIXME i#1551, i#1569: port to ARM and AArch64
add_sample_client(cbr "cbr.c" "drmgr")
add_sample_client(countcalls "countcalls.c" "drmgr;drreg")
$rm -fr build_arm/
mkdir build_arm
cd build_arm/
cmake -DCMAKE_TOOLCHAIN_FILE=../dynamorio/make/toolchain-arm32.cmake ../dynamorio
make -j
$ file api/bin/libtestclient.so
api/bin/libtestclient.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=e7fea38c58990bc886bcebee9a6ecdf690806b19, not stripped
$$ cat hw.c
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Hello DynamoRIO!\n");
exit(0);
}
$
$ ./build_arm/bin32/drrun -c build_arm/api/bin/libtestclient.so -- ./hw
syscall 45: 143360
syscall 192: -1226899456
syscall 192: -1226915840
syscall 6: 0
syscall 192: -1228206080
syscall 125: 0
syscall 192: -1226940416
syscall 192: -1226928128
syscall 6: 0
syscall 192: -1228210176
syscall 983045: 0
syscall 125: 0
syscall 125: 0
syscall 125: 0
syscall 91: 0
syscall 192: -1226903552
Hello DynamoRIO!
$Make Warning (dev) at build_arm/cmake/DynamoRIOConfig.cmake:313 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target "dynamorio".
Call Stack (most recent call first):
build_arm/cmake/DynamoRIOConfig.cmake:1065 (DynamoRIO_add_rel_rpaths)
build_arm/cmake/DynamoRIOConfig.cmake:1244 (_DR_set_compile_flags)
clients/drcachesim/CMakeLists.txt:87 (configure_DynamoRIO_standalone)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at build_arm/cmake/DynamoRIOConfig.cmake:314 (file):
file RELATIVE_PATH must be passed a full path to the file: lib_loc-NOTFOUND
Call Stack (most recent call first):
build_arm/cmake/DynamoRIOConfig.cmake:1065 (DynamoRIO_add_rel_rpaths)
build_arm/cmake/DynamoRIOConfig.cmake:1244 (_DR_set_compile_flags)
clients/drcachesim/CMakeLists.txt:87 (configure_DynamoRIO_standalone)
--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To post to this group, send email to dynamor...@googlegroups.com.
Visit this group at https://groups.google.com/group/dynamorio-users.
For more options, visit https://groups.google.com/d/optout.
$ pwd
/home/david/dbi/dynamorio/build_arm
$ file /home/david/dbi/dynamorio/make/toolchain-arm32.cmake
/home/david/dbi/dynamorio/make/toolchain-arm32.cmake: ASCII text
$ file /home/david/dbi/dynamorio/build_arm/cmake
/home/david/dbi/dynamorio/build_arm/cmake: directory
$ rm CMakeCache.txt
$ rm -rf CMakeFiles/
$ ls -l testclient/
total 24
-rw-rw-r-- 1 david david 262 Feb 20 15:52 CMakeLists.txt
-rw-rw-r-- 1 david david 475 Feb 20 15:52 testclient.c
$ cat testclient/testclient.c
#include "dr_api.h"
#include "drmgr.h"
#include "syscall.h"
static void event_exit() {
drmgr_exit();
}
static void event_post_syscall(void *drcontext, int sysnum) {
reg_t result = dr_syscall_get_result(drcontext);
dr_printf("syscall %d: %d\n", sysnum, result);
}
DR_EXPORT void dr_client_main(client_id_t id, int argc, const char *argv[]) {
drmgr_init();
dr_register_exit_event(event_exit);
drmgr_register_post_syscall_event(event_post_syscall);
}
$ cat testclient/CMakeLists.txt
add_library(testclient SHARED testclient.c)
find_package(DynamoRIO)
if (NOT DynamoRIO_FOUND)
message(FATAL_ERROR "DynamoRIO package required to build")
endif(NOT DynamoRIO_FOUND)
configure_DynamoRIO_client(testclient)
use_DynamoRIO_extension(testclient drmgr)
$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/david/dbi/dynamorio/make/toolchain-arm32.cmake -DDynamoRIO_DIR=/home/david/dbi/dynamorio/build_arm/cmake ./testclient/
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/dbi/dynamorio/build_arm
$ make testclient
Scanning dependencies of target testclient
[ 50%] Building C object CMakeFiles/testclient.dir/testclient.o
In file included from /home/david/dbi/dynamorio/build_arm/testclient/testclient.c:1:0:
/home/david/dbi/dynamorio/build_arm/cmake/../include/dr_api.h:53:20: fatal error: dr_app.h: No such file or directory
compilation terminated.
CMakeFiles/testclient.dir/build.make:62: recipe for target 'CMakeFiles/testclient.dir/testclient.o' failed
make[3]: *** [CMakeFiles/testclient.dir/testclient.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/testclient.dir/all' failed
make[2]: *** [CMakeFiles/testclient.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/testclient.dir/rule' failed
make[1]: *** [CMakeFiles/testclient.dir/rule] Error 2
Makefile:140: recipe for target 'testclient' failed
make: *** [testclient] Error 2
$ find /home/david/dbi/ -name 'dr_app.h'
/home/david/dbi/dynamorio/core/lib/dr_app.h
/home/david/dbi/dynamorio/build_x86_64/include/dr_app.h
$ find /home/david/dbi/ -name 'dr_api.h'
/home/david/dbi/dynamorio/core/lib/dr_api.h
/home/david/dbi/dynamorio/build_x86_64/include/dr_api.h
/home/david/dbi/dynamorio/build_arm/include/dr_api.h
$ cmake -DDynamoRIO_DIR=/home/david/dbi/dynamorio/build_x86_64/cmake ./testclient/
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/dbi/dynamorio/build_x86_64
$ make testclient
Scanning dependencies of target testclient
[ 50%] Building C object CMakeFiles/testclient.dir/testclient.o
[100%] Linking C shared library libtestclient.so
[100%] Built target testclient
--