emerge fails in compile phase. Reproducible: Always Steps to Reproduce: 1.emerge 2. 3. Actual Results: Scanning dependencies of target openvas_nasl_shared Linking C executable test-hosts cd /var/tmp/portage/net-analyzer/openvas-libraries-8.0.4/work/openvas-libraries-8.0.4_build/base && /usr/bin/cmake -E cmake_link_script CMakeFiles/test-hosts.dir/link.txt --verbose=1 /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -march=nocona -pipe -fomit-frame-pointer -Wformat -Wformat-security -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wl,-z,relro -Wl,-z,now -D_FILE_OFFSET_BITS=64 -Wall -fPIC -Wl,-O1 -Wl,--as-needed CMakeFiles/test-hosts.dir/test-hosts.c.o -o test-hosts -rdynamic -lgnutls ../misc/libopenvas_misc.so.8.0.4 -lglib-2.0 libopenvas_base.so.8.0.4 ../omp/libopenvas_omp.so.8.0.4 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lz -L/usr/lib64 -lgpgme -lassuan -lgpg-error -lgnutls -luuid -L/usr/lib64 -Wl,-rpath,/usr/lib64 -lpcap -lssh -lhiredis -lgcrypt -lgpg-error -Wl,-rpath,/var/tmp/portage/net-analyzer/openvas-libraries-8.0.4/work/openvas-libraries-8.0.4_build/misc:/var/tmp/portage/net-analyzer/openvas-libraries-8.0.4/work/openvas-libraries-8.0.4_build/base:/var/tmp/portage/net-analyzer/openvas-libraries-8.0.4/work/openvas-libraries-8.0.4_build/omp libopenvas_base.so.8.0.4: undefined reference to `openvas_server_vsendf' libopenvas_base.so.8.0.4: undefined reference to `log_legacy_write' ../omp/libopenvas_omp.so.8.0.4: undefined reference to `openvas_server_sendf_xml_quiet' libopenvas_base.so.8.0.4: undefined reference to `openvas_server_open_with_cert' libopenvas_base.so.8.0.4: undefined reference to `ssh_key_type_to_char' libopenvas_base.so.8.0.4: undefined reference to `ssh_pki_import_privkey_base64' ../omp/libopenvas_omp.so.8.0.4: undefined reference to `openvas_server_sendf_xml' libopenvas_base.so.8.0.4: undefined reference to `openvas_server_close' libopenvas_base.so.8.0.4: undefined reference to `ssh_key_free' libopenvas_base.so.8.0.4: undefined reference to `ssh_key_type' libopenvas_base.so.8.0.4: undefined reference to `ssh_pki_export_pubkey_base64' ../omp/libopenvas_omp.so.8.0.4: undefined reference to `openvas_server_sendf' collect2: error: ld returned 1 exit status base/CMakeFiles/test-hosts.dir/build.make:88: recipe for target 'base/test-hosts' failed make[2]: *** [base/test-hosts] Error 1 make[2]: Leaving directory '/var/tmp/portage/net-analyzer/openvas-libraries-8.0.4/work/openvas-libraries-8.0.4_build' CMakeFiles/Makefile2:178: recipe for target 'base/CMakeFiles/test-hosts.dir/all' failed make[1]: *** [base/CMakeFiles/test-hosts.dir/all] Error 2 $ emerge --info Portage 2.2.20 (python 3.4.1-final-0, hardened/linux/amd64, gcc-4.8.4, glibc-2.20-r2, 3.18.9-hardened x86_64) ================================================================= System uname: Linux-3.18.9-hardened-x86_64-Intel_Xeon_E312xx_-Sandy_Bridge-with-gentoo-2.2 KiB Mem: 1016644 total, 51596 free KiB Swap: 524284 total, 502040 free Timestamp of repository gentoo: Wed, 05 Aug 2015 21:30:01 +0000 sh bash 4.3_p33-r2 ld GNU ld (Gentoo 2.24 p1.4) 2.24 app-shells/bash: 4.3_p33-r2::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.9-r1::gentoo, 3.4.1::gentoo dev-util/cmake: 3.2.2::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.17::gentoo sys-apps/sandbox: 2.6-r1::gentoo sys-devel/autoconf: 2.69::gentoo sys-devel/automake: 1.15::gentoo sys-devel/binutils: 2.24-r3::gentoo sys-devel/gcc: 4.8.4::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers) sys-libs/glibc: 2.20-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/conf.d/hostname /etc/conf.d/hwclock /etc/conf.d/modules /etc/locale.gen /etc/rc.conf /etc/securetty /usr/share/gnupg/qualified.txt /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LC_ALL="" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_BZIP2_COMMAND="/bin/bzip2" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri gdbm hardened iconv justify maildir mmx mmxext modules multilib ncurses nls nptl openmp pam pax_kernel pcre php pie readline session snmp sse sse2 ssl ssp symlink tcpd unicode urandom xattr xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
please attach full build.log
Created attachment 408408 [details] openvas-libraries-8.0.4 build log
Interestingly all version 8 fail here. Only using lg.gold for linking makes it work.
I can confirm this. Building with ld.gold allows compilation to finish, but afterwards when attempting to run openvasmd it dies with the following error: openvasmd: symbol lookup error: /usr/lib/libopenvas_base.so.8: undefined symbol: ssh_pki_import_privkey_base64 openvassd seems to run with no problems. I'm building and running this on x86 rather than x86_64. $ emerge --info Portage 2.2.20.1 (python 3.4.1-final-0, default/linux/x86/13.0, gcc-4.8.4, glibc-2.20-r2, 4.0.5-gentoo i686) ================================================================= System uname: Linux-4.0.5-gentoo-i686-Intel-R-_Xeon-TM-_CPU_2.80GHz-with-gentoo-2.2 KiB Mem: 2073644 total, 128668 free KiB Swap: 2097148 total, 2085476 free Timestamp of repository gentoo: Wed, 19 Aug 2015 22:30:01 +0000 sh bash 4.3_p33-r2 ld GNU ld (Gentoo 2.24 p1.4) 2.24 app-shells/bash: 4.3_p33-r2::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.9-r1::gentoo, 3.4.1::gentoo dev-util/cmake: 3.2.2::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.17::gentoo sys-apps/sandbox: 2.6-r1::gentoo sys-devel/autoconf: 2.69::gentoo sys-devel/automake: 1.15::gentoo sys-devel/binutils: 2.24-r3::gentoo sys-devel/gcc: 4.7.4::gentoo, 4.8.4::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers) sys-libs/glibc: 2.20-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 x-portage location: /usr/local/portage masters: gentoo priority: 0 ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" USE="acl berkdb bzip2 cli cracklib crypt cscope cxx dri gd gdbm iconv icu jpeg ldap modules ncurses nls nptl nscd pam pcre perl png python readline ruby seccomp session slang ssl syslog tcpd udev unicode vim-syntax winbind x86 xattr zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="none" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
I tried compiling openvas-libraries-8.0.4 manually with ld.bfd and was successful. I'm attaching a log of the build process
Created attachment 412014 [details] Log of successful manual build process
It seems there are circular dependencies between openvas_misc and openvas_base. Adding "append-ldflags $(no-as-needed)" to the openvas-libraries ebuild allows the package to build. Dependent packages then build fine with no changes. I think adding openvas_misc a second time to the link list for the test-hosts executable (after openvas_base) could allow it to link without disabling the --as-needed link flag and I think line 92 in openvas-libraries-8.0.4/base/CMakeLists.txt attempts to do that, but cmake seems to insist on adding openvas_misc first to the link list and not allowing it to be added a second time later. I should mention that I'm not really familiar with cmake. Here's the relevant portion of the CMakLists.txt file. 88 # Link the test-hosts executable 89 # TODO: This is currently only built for BUILD_SHARED 90 if (BUILD_SHARED) 91 add_executable (test-hosts test-hosts.c) 92 target_link_libraries (test-hosts openvas_base_shared ${GNUTLS_LDFLAGS} openvas_misc_shared ${GLIB_LDFLAGS}) 93 endif (BUILD_SHARED) I've tweaked the target_link_libraries line in various ways, but can't seem to effect link order at all.
commit d91c938896457ce366ea399bb79a809b56fecb36 Author: Justin Lecher <jlec@gentoo.org> Date: Wed Nov 18 16:28:26 2015 +0100 net-analyzer/openvas-libraries: Version Bump fixes gnutls-3 support and compilation problems Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=544664 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=555544 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=556788 Package-Manager: portage-2.2.25 Signed-off-by: Justin Lecher <jlec@gentoo.org> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d91c938896457ce366ea399bb79a809b56fecb36