When LDFLAGS is set to "-Wl,--as-needed" emerging hteditor has failed when it tried to link with ncurses: ... htcurses.cc:(.text+0xbe0): undefined reference to `nodelay' htcurses.cc:(.text+0xbe5): undefined reference to `noecho' htcurses.cc:(.text+0xbea): undefined reference to `cbreak' htcurses.cc:(.text+0xbf0): undefined reference to `ESCDELAY' io/posix/libhtio.a(htcurses.o): In function `screendrawbuf::show()': htcurses.cc:(.text+0x4b2): undefined reference to `curs_set' htcurses.cc:(.text+0x521): undefined reference to `curs_set' io/posix/libhtio.a(htkeyb.o): In function `done_keyb()': htkeyb.cc:(.text+0x10): undefined reference to `XCloseDisplay' io/posix/libhtio.a(htkeyb.o): In function `init_keyb()': htkeyb.cc:(.text+0x24): undefined reference to `XOpenDisplay' io/posix/libhtio.a(htkeyb.o): In function `ht_raw_getkey()': htkeyb.cc:(.text+0xd3): undefined reference to `stdscr' htkeyb.cc:(.text+0xdb): undefined reference to `wgetch' htkeyb.cc:(.text+0x141): undefined reference to `XQueryPointer' htkeyb.cc:(.text+0x16b): undefined reference to `stdscr' htkeyb.cc:(.text+0x173): undefined reference to `wgetch' io/posix/libhtio.a(htkeyb.o): In function `ht_keypressed()': htkeyb.cc:(.text+0x193): undefined reference to `stdscr' htkeyb.cc:(.text+0x19b): undefined reference to `wgetch' htkeyb.cc:(.text+0x1aa): undefined reference to `ungetch' collect2: ld returned 1 exit status Portage 2.1.1 (default-linux/x86/2006.1/desktop, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-ck1-r2 i686) ================================================================= System uname: 2.6.17-ck1-r2 i686 Intel(R) Celeron(R) CPU 2.00GHz Gentoo Base System version 1.12.4 Last Sync: Mon, 11 Sep 2006 21:30:06 +0000 ccache version 2.4 [enabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-lang/python: 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r2 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -ftree-vectorize -msse2 -mmmx -mfpmath=sse" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -ftree-vectorize -msse2 -mmmx -mfpmath=sse" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LC_ALL="pl_PL" LDFLAGS="-Wl,--as-needed" LINGUAS="pl" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/portage-xgl /usr/portage/local/layman/vmware /usr/local/portage /usr/portage/local/layman/portage-xgl" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="7zip X Xaw3d a52 acl adns adsl alsa apache2 applet atk atm audiofile authfile avi bash-completion bcp bdf berkdb bitmap-fonts bittorrent bonobo bootsplash bzip2 cairo cdda cdio cdparanoia cdr chroot cjk ck-plus cli crypt cscope ctype cvs dba dbus directfb dlloader dlopen dpms dri dvd dvdr ecc eds elibc_glibc emboss encode escreen exif expat extensions fam fastbuild fbcon fbsplash ffmpeg firefox flac font-server fontconfig force-cgi-redirect ftp fuse gb gd gdbm gg gif glade glibc-omitfp glitz glut glx gmail gmailtimestamps gmp gnutls gpgme gpm gstreamer gtk gtk2 gtkhtml gtkspell guile hal hpn iconv idn imagemagick imlib imlib2 input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jabber jack jpeg kde kernel_linux ladspa lame lcms ldap libg++ libgda libwww linguas_pl linuxkeys lua mad maildir memlimit metar mikmod mime mmx mmxext mng mozsvg mp3 mpeg mplayer mysql mysqli ncurses nls nntp nojava nomotif nosendmail nptl nptlonly ntfs nvidia ogg oggvorbis opengl openssh oss pam pcntl pcre pdf pdflib pear pear-db perl php png pop posix ppds ppp pppd python qt qt3 qt4 quicktime readline real reflection reiser4 reiserfs rplay ruby screen sdl session sftp slang sndfile soap sockets softquota speedtouch-usb spell sql sse sse2 ssl subversion svga tcpd threads tidy tiff tokenizer truetype truetype-fonts type1-fonts udev userland_GNU uudeview video_cards_nvidia vim-pager vim-with-x vorbis win32codecs wma wma123 wxwindows x86 xface xml xml2 xmlrpc xorg xpm xsl xv xvid zip zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
I guess that happens because I link in the "wrong" order. I don't understand automake (or whoever is responsible for this) enough to change it. And I even have binutils >= 2.17 so I couldn't even test it, but any patch is appreciated.
(In reply to comment #1) > I guess that happens because I link in the "wrong" order. Correct. It needed the libs (-lncurses) at the end with all the other libs. > I don't understand > automake (or whoever is responsible for this) enough to change it. Was a bit in automake and a bit in autoconf. See the patch for details. Automake was adding the libs to LDFLAGS instead of LDADD "ht_LIBS= @HT_LIBS@" Was actually never used. Autoconf - configure.in needed to be changed to substatute the HT_LIBS > And I even > have binutils >= 2.17 so I couldn't even test it, but any patch is appreciated. Not relevant I think. fixed in hteditor-0.9.4 - patch submitted upstream