-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drakvuf meson and ninja-injector linking build errors #1753
Comments
You can use autotools to build as a fallback. |
fantistic... using the old method works, thanks. /autogen.sh |
The instructions for the old build method should be put in the drakvuf.com site. |
I think this was something weird about your environment because the meson system works on a variety of CI environments. So perhaps need to check how you installed clang. As for the build commands, yea, it would have been good to have them in the repo itself but alas it's too late for that. |
$ meson setup build --native-file llvm.ini
The Meson build system
Version: 0.53.2
Source dir: /home/usr1/git/drakvuf
Build dir: /home/usr1/git/drakvuf/build
Build type: native build
Project name: DRAKVUF (C) Tamas K Lengyel 2014-2023
Project version: 1.1
WARNING: Env var CC seems to point to the cross compiler.
This is probably wrong, it should always point to the native compiler.
meson.build:1:0: ERROR: Unable to determine dynamic linker
A full log can be found at /home/usr1/git/drakvuf/build/meson-logs/meson-log.txt
***RESULTED IN linking ERROR
I then tried meson differently:
$ meson ./build
$ ninja -C build
ninja: Entering directory `build'
[122/126] Linking target injector.
FAILED: injector
clang++ -o injector 'injector@exe/src_injector.cpp.o' -flto -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -pie -Wl,--start-group src/libdrakvuf/libdrakvuf.a src/xen_helper/libxen_helper.a src/libinjector/libinjector.a -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now /usr/lib/x86_64-linux-gnu/libglib-2.0.so /usr/local/lib/libvmi.so /usr/lib/x86_64-linux-gnu/libjson-c.so -pthread -ldl -Wl,--end-group '-Wl,-rpath,$ORIGIN/src/libdrakvuf:$ORIGIN/src/xen_helper:$ORIGIN/src/libinjector:/usr/local/lib' -Wl,-rpath-link,/home/usr1/git/drakvuf/build/src/libdrakvuf -Wl,-rpath-link,/home/usr1/git/drakvuf/build/src/xen_helper -Wl,-rpath-link,/usr/local/lib -Wl,-rpath-link,/home/usr1/git/drakvuf/build/src/libinjector
/usr/bin/ld: src/libdrakvuf/libdrakvuf.a: error adding symbols: archive has no index; run ranlib to add one
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[123/126] Compiling C++ object 'drakvuf@exe/src_drakvuf.cpp.o'.
ninja: build stopped: subcommand failed.
***problem linking:
/usr/bin/ld: src/libdrakvuf/libdrakvuf.a: error adding symbols: archive has no index; run ranlib to add one
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ git log -1
commit 30fa531 (HEAD -> main, origin/main, origin/HEAD)
Author: Pavel 41573188+archercreat@users.noreply.github.com
Date: Wed Nov 29 22:10:30 2023 +0300
$ git submodule update --init
@xhf:~/git/drakvuf$ git submodule update --init
Submodule 'dwarf2json' (https://github.com/tklengyel/dwarf2json) registered for path 'dwarf2json'
Submodule 'libvmi' (https://github.com/libvmi/libvmi) registered for path 'libvmi'
Submodule 'volatility3' (https://github.com/volatilityfoundation/volatility3) registered for path 'volatility3'
Submodule 'xen' (https://github.com/xen-project/xen) registered for path 'xen'
Cloning into '/home/usr1/git/drakvuf/dwarf2json'...
Cloning into '/home/usr1/git/drakvuf/libvmi'...
Cloning into '/home/usr1/git/drakvuf/volatility3'...
Cloning into '/home/usr1/git/drakvuf/xen'...
Submodule path 'dwarf2json': checked out 'edee6cc49823599c524b6750cb85e3e864aee893'
Submodule path 'libvmi': checked out '12d3a8cc4d81033ff0b5c737ca35f54bcaf0264b'
Submodule path 'volatility3': checked out 'cb6d6e3a8e5ceb31ef71311e8a63220be055dee5'
Submodule path 'xen': checked out 'd75f1e9b74314cea91ce435730d4e3539ecca77d'
using:
export CC=clang
export CXX=clang++
Oddly if I use drakvuf git version 95d1759, the two previous env variables along with:
meson ./build
ninja -C ./build
...builds drakvuf.
I wonder if the variable dynamic_linker is supposed to be in the meson config file.
$ uname -a
Linux xhf 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I am not knowledgable with meson, yet. This looks like a setup error, but I am not sure how to solve it.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: