Unable to build openvas-smb - duplicate functions

I am trying to build version 22.5.3 on Rocky Linux 9.3 for several hours now with no success. The issue seems to be duplicate function definition in kerberos related object that comes in the source and heimdal-devel package.

The 1st problem that I faced is related to missing and hardcoded /builddir/build/BUILD/gnutls-3.7.6/bundled_gmp/.libs/libgmp.a .

[ 96%] Building C object wmi/CMakeFiles/openvas_wmiclient.dir/winsmb.c.o
[ 97%] Building C object wmi/CMakeFiles/openvas_wmiclient.dir/wmicore.c.o
make[2]: *** No rule to make target '/builddir/build/BUILD/gnutls-3.7.6/bundled_gmp/.libs/libgmp.a', needed by 'wmi/libopenvas_wmiclient.so.22.5.3'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 97%] Building C object wmi/CMakeFiles/openvas_wmiclient.dir/wbemdata.c.o
make[1]: *** [CMakeFiles/Makefile2:192: wmi/CMakeFiles/openvas_wmiclient.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

That is resolved by downloading source from the project website, compiling it and changing path in all files to /usr/local/lib/libgmp.a.

This is main blocker now duplicate definition of krb5_free_unparsed_name

[ 95%] Building C object samba/CMakeFiles/samba-static.dir/librpc/gen_ndr/tables.c.o
[ 95%] Linking C static library libsamba-static.a
[ 95%] Built target samba-static
Consolidate compiler generated dependencies of target openvas_wmiclient
[ 95%] Linking C shared library libopenvas_wmiclient.so
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-deprecated.o): in function `krb5_free_unparsed_name':
(.text[.text.group]+0x770): multiple definition of `krb5_free_unparsed_name'; ../samba/libsamba-static.a(clikrb5.c.o):clikrb5.c:(.text+0x160): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [wmi/CMakeFiles/openvas_wmiclient.dir/build.make:179: wmi/libopenvas_wmiclient.so.22.5.3] Error 1
make[1]: *** [CMakeFiles/Makefile2:192: wmi/CMakeFiles/openvas_wmiclient.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I tried removing this function definition in the source code and building it but then I get a lot of sqlite3 errors. Since I am not developer I am stuck.

[  1%] Generating IDL tables
Consolidate compiler generated dependencies of target samba-static
[  1%] Generating IDL tables
[  2%] Building C object samba/CMakeFiles/samba-static.dir/librpc/gen_ndr/tables.c.o
[  2%] Linking C static library libsamba-static.a
[ 95%] Built target samba-static
[ 95%] Linking C shared library libopenvas_wmiclient.so
[ 97%] Built target openvas_wmiclient
Consolidate compiler generated dependencies of target wmic
[ 98%] Linking C executable wmic
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_set_default':
(.text[.text.group]+0x52): undefined reference to `sqlite3_bind_text'
/usr/bin/ld: (.text[.text.group]+0x65): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x75): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0xaf): undefined reference to `sqlite3_reset'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_free':
(.text[.text.group]+0x11a): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x128): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x136): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x144): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x152): undefined reference to `sqlite3_finalize'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o):(.text[.text.group]+0x160): more undefined references to `sqlite3_finalize' follow
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_free':
(.text[.text.group]+0x1a6): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `default_db':
(.text[.text.group]+0x247): undefined reference to `sqlite3_open_v2'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_destroy':
(.text[.text.group]+0x2a3): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x2b5): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x2c5): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x2da): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_get_next':
(.text[.text.group]+0x3bc): undefined reference to `sqlite3_column_int64'
/usr/bin/ld: (.text[.text.group]+0x3cc): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x3d5): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x3e3): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x3ec): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x423): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x453): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x463): undefined reference to `sqlite3_column_blob'
/usr/bin/ld: (.text[.text.group]+0x471): undefined reference to `sqlite3_column_bytes'
/usr/bin/ld: (.text[.text.group]+0x48e): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x4c9): undefined reference to `sqlite3_reset'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `open_database.part.0':
(.text[.text.group]+0x506): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x52c): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `exec_stmt':
(.text[.text.group]+0x593): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x5b4): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_end_cache_get':
(.text[.text.group]+0x5fc): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x605): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_end_get':
(.text[.text.group]+0x637): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x640): undefined reference to `sqlite3_finalize'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `bind_principal.constprop.0':
(.text[.text.group]+0x6d9): undefined reference to `sqlite3_bind_text'
/usr/bin/ld: (.text[.text.group]+0x6ee): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `get_def_name':
(.text[.text.group]+0x850): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0x865): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x876): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x885): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x895): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0x8b8): undefined reference to `sqlite3_column_text'
/usr/bin/ld: (.text[.text.group]+0x8d7): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x8e1): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0x8fa): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x920): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_get_cache_first':
(.text[.text.group]+0xb3d): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0xbb1): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0xbdd): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0xc2f): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0xc65): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0xc8c): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0xcc4): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0xcf1): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0xd32): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `make_database.part.0':
(.text[.text.group]+0xd87): undefined reference to `sqlite3_open_v2'
/usr/bin/ld: (.text[.text.group]+0xdb4): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0xdde): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0xe08): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0xe32): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0xe5c): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o):(.text[.text.group]+0xe86): more undefined references to `sqlite3_prepare_v2' follow
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `make_database.part.0':
(.text[.text.group]+0xf41): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0xf7f): undefined reference to `sqlite3_open_v2'
/usr/bin/ld: (.text[.text.group]+0xfac): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0xfd1): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0xff6): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x101b): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x1040): undefined reference to `sqlite3_exec'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o):(.text[.text.group]+0x1065): more undefined references to `sqlite3_exec' follow
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `make_database.part.0':
(.text[.text.group]+0x10ac): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x10d6): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0x1104): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1134): undefined reference to `sqlite3_close'
/usr/bin/ld: (.text[.text.group]+0x117d): undefined reference to `sqlite3_close'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_move':
(.text[.text.group]+0x11ea): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x120a): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1215): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1226): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1249): undefined reference to `sqlite3_bind_text'
/usr/bin/ld: (.text[.text.group]+0x125a): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1265): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1276): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x12a5): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x12f4): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_get_first':
(.text[.text.group]+0x14d6): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x1545): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0x158e): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0x1621): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x16a6): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1712): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1737): undefined reference to `sqlite3_finalize'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_remove_cred':
(.text[.text.group]+0x17d5): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0x17f5): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1811): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x1826): undefined reference to `sqlite3_column_blob'
/usr/bin/ld: (.text[.text.group]+0x1835): undefined reference to `sqlite3_column_bytes'
/usr/bin/ld: (.text[.text.group]+0x187c): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1898): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x18b4): undefined reference to `sqlite3_prepare_v2'
/usr/bin/ld: (.text[.text.group]+0x18d0): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x18de): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x18ef): undefined reference to `sqlite3_finalize'
/usr/bin/ld: (.text[.text.group]+0x1954): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1997): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x19f3): undefined reference to `sqlite3_column_int64'
/usr/bin/ld: (.text[.text.group]+0x1a04): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_get_principal':
(.text[.text.group]+0x1a73): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1a7c): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1a8c): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x1aa0): undefined reference to `sqlite3_column_text'
/usr/bin/ld: (.text[.text.group]+0x1ac3): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1af5): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1b21): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1b3a): undefined reference to `sqlite3_reset'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_store_cred':
(.text[.text.group]+0x1bec): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1c40): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1c51): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1c6f): undefined reference to `sqlite3_bind_blob'
/usr/bin/ld: (.text[.text.group]+0x1c86): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1c9c): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x1cb5): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1cc5): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1cd7): undefined reference to `sqlite3_last_insert_rowid'
/usr/bin/ld: (.text[.text.group]+0x1d02): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1d13): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1d25): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1d35): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1d62): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1d73): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1d85): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1d95): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x1dbb): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x1dca): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1ea4): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1eb8): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x1ef6): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_initialize':
(.text[.text.group]+0x1f5e): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x1f7e): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x1f8d): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x1f9d): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x2006): undefined reference to `sqlite3_bind_text'
/usr/bin/ld: (.text[.text.group]+0x2015): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x202c): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x2035): undefined reference to `sqlite3_last_insert_rowid'
/usr/bin/ld: (.text[.text.group]+0x206d): undefined reference to `sqlite3_bind_int'
/usr/bin/ld: (.text[.text.group]+0x207d): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x208d): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x209f): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x20d4): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x2105): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x2131): undefined reference to `sqlite3_exec'
/usr/bin/ld: (.text[.text.group]+0x2144): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_resolve':
(.text[.text.group]+0x2233): undefined reference to `sqlite3_bind_text'
/usr/bin/ld: (.text[.text.group]+0x2247): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x2268): undefined reference to `sqlite3_reset'
/usr/bin/ld: (.text[.text.group]+0x230b): undefined reference to `sqlite3_errmsg'
/usr/bin/ld: (.text[.text.group]+0x23af): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x23bf): undefined reference to `sqlite3_column_int'
/usr/bin/ld: (.text[.text.group]+0x23fe): undefined reference to `sqlite3_reset'
/usr/bin/ld: /usr/lib64/heimdal/lib/libkrb5.a(libkrb5_la-scache.o): in function `scc_get_cache_next':
(.text[.text.group]+0x2455): undefined reference to `sqlite3_step'
/usr/bin/ld: (.text[.text.group]+0x246a): undefined reference to `sqlite3_column_type'
/usr/bin/ld: (.text[.text.group]+0x247a): undefined reference to `sqlite3_column_text'
/usr/bin/ld: (.text[.text.group]+0x24d5): undefined reference to `sqlite3_errmsg'
collect2: error: ld returned 1 exit status
make[2]: *** [wmi/CMakeFiles/wmic.dir/build.make:132: wmi/wmic] Error 1
make[1]: *** [CMakeFiles/Makefile2:166: wmi/CMakeFiles/wmic.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Not sure but could be possibly related to some older / manually compiled libraries / binaries which haven’t been rebuild in the past after upgrading the distro like mentioned here:

Think you replied to wrong topic :slight_smile:

Actually the above has been posted in the correct topic / here on purpose:

The linked topic above shows that there are some remains / leftovers from before the Linux version was updated which could cause this issue.

Compiling additional libraries from sources and not using the ones providing by the package manager of the Linux distribution could make things worse, especially if something similar has been also done previously with other libraries (from the times before the Distribution update has been done).

1 Like