Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Link dnf5-plugins/builddep_plugin to librpm
Building with LDFLAGS='-Wl,-z,defs' shows among others: $ /usr/bin/c++ -fPIC -O0 -g -Wl,-z,defs -shared -o builddep_cmd_plugin.so CMakeFiles/builddep_cmd_plugin.dir/builddep.cpp.o CMakeFiles/builddep_cmd_plugin.dir/builddep_cmd_plugin.cpp.o -Wl,-rpath,/tmp/d/libdnf5-cli:/tmp/d/libdnf5: /usr/lib64/librpmbuild.so ../../libdnf5-cli/libdnf5-cli.so.1 ../../libdnf5/libdnf5.so.1 -ldl -lstdc++ -lfmt -lsmartcols [...] /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:125:(.text+0xba8): undefined reference to `rpmdsInit' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:127:(.text+0xbba): undefined reference to `rpmdsDNEVR' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:126:(.text+0xbe1): undefined reference to `rpmdsNext' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:129:(.text+0xbf6): undefined reference to `rpmdsFree' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:130:(.text+0xc0f): undefined reference to `rpmdsInit' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:132:(.text+0xc21): undefined reference to `rpmdsDNEVR' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:131:(.text+0xc48): undefined reference to `rpmdsNext' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:134:(.text+0xc5d): undefined reference to `rpmdsFree' /usr/bin/ld: CMakeFiles/builddep_cmd_plugin.dir/builddep.cpp.o: in function `dnf5::BuildDepCommand::add_from_srpm_file(std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, char const*)': /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:141:(.text+0xc9f): undefined reference to `Fopen' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:142:(.text+0xcb6): undefined reference to `Ferror' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:143:(.text+0xd1d): undefined reference to `Fstrerror' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:145:(.text+0xd4d): undefined reference to `Fclose' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:152:(.text+0xd64): undefined reference to `rpmtsCreate' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:153:(.text+0xd79): undefined reference to `rpmtsSetVSFlags' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:154:(.text+0xd95): undefined reference to `rpmReadPackageFile' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:155:(.text+0xda4): undefined reference to `rpmtsFree' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:156:(.text+0xdb0): undefined reference to `Fclose' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:160:(.text+0xddd): undefined reference to `rpmdsNewPool' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:160:(.text+0xde5): undefined reference to `rpmdsInit' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:162:(.text+0xdf7): undefined reference to `rpmdsDNEVR' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:161:(.text+0xe46): undefined reference to `rpmdsNext' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:167:(.text+0xe5b): undefined reference to `rpmdsFree' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:168:(.text+0xe76): undefined reference to `rpmdsNewPool' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:168:(.text+0xe7e): undefined reference to `rpmdsInit' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:170:(.text+0xe90): undefined reference to `rpmdsDNEVR' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:169:(.text+0xeb7): undefined reference to `rpmdsNext' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:172:(.text+0xecc): undefined reference to `rpmdsFree' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:177:(.text+0xf2c): undefined reference to `headerFree' /usr/bin/ld: CMakeFiles/builddep_cmd_plugin.dir/builddep.cpp.o: in function `dnf5::BuildDepCommand::run()': /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:223:(.text+0x1966): undefined reference to `rpmPushMacro' /usr/bin/ld: /home/test/dnf5/dnf5-plugins/builddep_plugin/builddep.cpp:231:(.text+0x1aae): undefined reference to `rpmPopMacro' All these functions are explicitly called from builddep.cpp, hence builddep.cpp must include header files defining the functions and must link to libraries providing them. rpmbuild header and library were utilizied. But librpm and librpmio were completely missing. This patch adds them. Related to <rpm-software-management#267>.
- Loading branch information