Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Undefined reference when trying to make #114

Open
@sinashan

Description

@sinashan

Hi

I'm using cmake for syscall_intercept. Now, when I want to make, I get the following error:

[  0%] Built target gen_ctags
[  0%] Built target check_whitespace
[  2%] Built target cpp_test
[  2%] Built target cstyle
Scanning dependencies of target syscall_intercept_base_c
[  3%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/disasm_wrapper.c.o
[  4%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/intercept.c.o
[  4%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/intercept_desc.c.o
[  5%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/intercept_log.c.o
[  6%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/intercept_util.c.o
[  6%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/patcher.c.o
[  7%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/magic_syscalls.c.o
[  8%] Building C object CMakeFiles/syscall_intercept_base_c.dir/src/syscall_formats.c.o
[  8%] Built target syscall_intercept_base_c
Scanning dependencies of target syscall_intercept_base_clf
[  8%] Building C object CMakeFiles/syscall_intercept_base_clf.dir/src/cmdline_filter.c.o
[  8%] Built target syscall_intercept_base_clf
Scanning dependencies of target syscall_intercept_base_asm
[  8%] Building ASM object CMakeFiles/syscall_intercept_base_asm.dir/src/intercept_template.S.o
[  9%] Building ASM object CMakeFiles/syscall_intercept_base_asm.dir/src/util.S.o
[  9%] Building ASM object CMakeFiles/syscall_intercept_base_asm.dir/src/intercept_wrapper.S.o
[  9%] Built target syscall_intercept_base_asm
Scanning dependencies of target syscall_intercept_unscoped
[ 10%] Linking C static library libsyscall_intercept_unscoped.a
[ 10%] Built target syscall_intercept_unscoped
Scanning dependencies of target generate_syscall_intercept_scoped
[ 11%] Generating syscall_intercept_unscoped.o
[ 12%] Generating syscall_intercept_scoped.o
[ 12%] Built target generate_syscall_intercept_scoped
Scanning dependencies of target syscall_intercept_shared
[ 12%] Linking C shared library libsyscall_intercept.so
[ 14%] Built target syscall_intercept_shared
Scanning dependencies of target syscall_intercept_static
[ 15%] Linking C static library libsyscall_intercept.a
[ 16%] Built target syscall_intercept_static
Scanning dependencies of target check_license_executable
[ 16%] Building C object CMakeFiles/check_license_executable.dir/utils/check_license/check-license.c.o
[ 17%] Linking C executable check_license_executable
[ 17%] Built target check_license_executable
Scanning dependencies of target syscall_logger
[ 17%] Building C object examples/CMakeFiles/syscall_logger.dir/syscall_logger.c.o
[ 18%] Building C object examples/CMakeFiles/syscall_logger.dir/syscall_desc.c.o
[ 19%] Linking C shared library libsyscall_logger.so
[ 19%] Built target syscall_logger
Scanning dependencies of target fork_ban
[ 19%] Building C object examples/CMakeFiles/fork_ban.dir/fork_ban.c.o
[ 20%] Linking C shared library libfork_ban.so
[ 20%] Built target fork_ban
Scanning dependencies of target icap
[ 21%] Building C object examples/CMakeFiles/icap.dir/icap.c.o
[ 21%] Linking C shared library libicap.so
[ 21%] Built target icap
Scanning dependencies of target vfork_logging
[ 22%] Building C object test/CMakeFiles/vfork_logging.dir/vfork_logging.c.o
[ 23%] Linking C executable vfork_logging
[ 23%] Built target vfork_logging
Scanning dependencies of target intercept_sys_write
[ 24%] Building C object test/CMakeFiles/intercept_sys_write.dir/intercept_sys_write.c.o
[ 25%] Linking C shared library libintercept_sys_write.so
[ 25%] Built target intercept_sys_write
Scanning dependencies of target test_clone_thread_preload
[ 26%] Building C object test/CMakeFiles/test_clone_thread_preload.dir/test_clone_thread_preload.c.o
[ 26%] Linking C shared library libtest_clone_thread_preload.so
[ 26%] Built target test_clone_thread_preload
Scanning dependencies of target test_clone_thread
[ 26%] Building C object test/CMakeFiles/test_clone_thread.dir/test_clone_thread.c.o
[ 27%] Linking C executable test_clone_thread
[ 27%] Built target test_clone_thread
Scanning dependencies of target filter_test
[ 27%] Building C object test/CMakeFiles/filter_test.dir/filter_test.c.o
[ 28%] Linking C executable filter_test
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_option'
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_free'
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_disasm_iter'
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_malloc'
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_open'
../libsyscall_intercept.so.0.1.0: undefined reference to `cs_close'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/filter_test] Error 1
make[1]: *** [test/CMakeFiles/filter_test.dir/all] Error 2
make: *** [all] Error 2

What does this "undefined reference" mean? And how can I solve the issue? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions