eteran / edb-debugger

edb is a cross-platform AArch32/x86/x86-64 debugger.
GNU General Public License v2.0
2.66k stars 321 forks source link

undefined reference on build stage #867

Closed Pro-pra closed 3 months ago

Pro-pra commented 3 months ago

i see more undefined reference error and build failed:

FAILED: libDebuggerCore.so 
: && /usr/bin/g++ -fPIC -O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -g -DNDEBUG  -O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic -Wl,-O2  -Wl,--no-undefined -shared -Wl,-soname,libDebuggerCore.so -o libDebuggerCore.so plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/DebuggerCore_autogen/mocs_compilation.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/DebuggerCoreBase.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DialogMemoryAccess.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/FeatureDetect.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/PlatformCommon.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/PlatformEvent.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/PlatformProcess.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/PlatformRegion.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/PlatformThread.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/Posix.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/Unix.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/arch/x86-generic/Breakpoint.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/arch/x86-generic/PlatformState.cpp.o plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/arch/x86-generic/PlatformThread.cpp.o  /usr/lib64/libQt5Widgets.so.5.15.12  /usr/lib64/libQt5Gui.so.5.15.12  -lgvc  -lcgraph  -lcdt  lib/gdtoa-desktop/libgdtoa-desktop.so  -lcapstone  /usr/lib64/libQt5Xml.so.5.15.12  /usr/lib64/libQt5XmlPatterns.so.5.15.12  /usr/lib64/libQt5Network.so.5.15.12  /usr/lib64/libQt5Svg.so.5.15.12  /usr/lib64/libQt5Widgets.so.5.15.12  /usr/lib64/libQt5Gui.so.5.15.12  /usr/lib64/libQt5Core.so.5.15.12  -ldouble-conversion && :
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/DebuggerCoreBase.cpp.o: in function `DebuggerCorePlugin::DebuggerCoreBase::endDebugSession()':
/home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/DebuggerCoreBase.cpp:129:(.text+0xe1): undefined reference to `edb::v1::config()'
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o: in function `DebuggerCorePlugin::DebuggerCore::detectCpuMode()':
/home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/unix/linux/DebuggerCore.cpp:828:(.text+0xe84): undefined reference to `CapstoneEDB::init(CapstoneEDB::Architecture)'
/usr/bin/x86_64-rosa-linux-gnu-ld: /home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/unix/linux/DebuggerCore.cpp:838:(.text+0xf1b): undefined reference to `CapstoneEDB::init(CapstoneEDB::Architecture)'
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o: in function `DebuggerCorePlugin::DebuggerCore::ptraceOptions() const':
/home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/unix/linux/DebuggerCore.cpp:403:(.text+0xfb5): undefined reference to `edb::v1::config()'
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o: in function `DebuggerCorePlugin::DebuggerCore::stackPointer() const':
/home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/unix/linux/DebuggerCore.cpp:1091:(.text+0x11c5): undefined reference to `edb::v1::debuggeeIs32Bit()'
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o: in function `non-virtual thunk to DebuggerCorePlugin::DebuggerCore::stackPointer() const':
/home/notamock/rpmbuild/BUILD/edb-debugger/plugins/DebuggerCore/unix/linux/DebuggerCore.h:85:(.text+0x11f5): undefined reference to `edb::v1::debuggeeIs32Bit()'
/usr/bin/x86_64-rosa-linux-gnu-ld: plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/DebuggerCore.cpp.o: in function `DebuggerCorePlugin::DebuggerCore::framePointer() const':

may be need link with *.o from src dir? i not see shared libedb.so :(

eteran commented 3 months ago

The plugins link against the main executable in order to access the API.

It looks like you are using custom linked flags, can you try using the standard set of build flags?

Pro-pra commented 3 months ago

Thank you, i drop and all compiled

-DCMAKE_MODULE_LINKER_FLAGS=-O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic -Wl,-O2  -Wl,--no-undefined   -Wl,--unresolved-symbols=ignore-all