Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75127 - vim 6.3-r2 is using -L/usr/local/lib, and getting the wrong libraries
Summary: vim 6.3-r2 is using -L/usr/local/lib, and getting the wrong libraries
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-20 19:03 UTC by hixon_c
Modified: 2005-01-15 04:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hixon_c 2004-12-20 19:03:01 UTC
It looks like something in the vim configuration is finding /usr/local/lib.
I have a custom debug version of python installed under /usr/local (it may also have some other compile-time options that makes it incompatible with the gentoo installed version I have in /usr/).  It appears that it is trying to link with my custom libpython2.3.so in /usr/local/lib:

I've tried the emerge with sudo and 'su -'.  I have no references to
/usr/local in my environment during the emerge (no LD_LIBRARY_PATH either).  The question is:
why is it adding -L/usr/local/lib?  Shouldn't it leave /usr/local alone?
As a workaround, I temporarily moved /usr/local to /usr/local_tmp and the emerge worked fine.

Reproducible: Always
Steps to Reproduce:
1. Manually compile and install custom version of python under /usr/local along with gentoo version under /usr?
2. emerge =app-editors/vim-6.3-r2


Actual Results:  
make[2]: Leaving directory `/var/tmp/portage/vim-6.3-r2/work/vim63/src/po'
gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -march=athlon-xp -pipe   -pipe
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/lib/perl5/5.8.5/i686-linux/CORE  -I/usr/include/python2.3 -pthread 
-I/usr/lib/ruby/1.8/i686-linux  version.c -o objects/version.o
  gcc   -rdynamic  -rdynamic   -L/usr/local/lib  -o vim objects/buffer.o
objects/charset.o objects/diff.o objects/digraph.o objects/edit.o objects/eval.o
objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o
objects/ex_getln.o objects/fileio.o objects/fold.o objects/getchar.o 
objects/if_cscope.o objects/if_xcmdsrv.o objects/main.o objects/mark.o
objects/memfile.o objects/memline.o objects/menu.o objects/message.o
objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o
objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o
objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o
objects/syntax.o  objects/tag.o objects/term.o objects/ui.o objects/undo.o
objects/window.o  objects/if_perl.o objects/if_perlsfio.o objects/if_python.o
objects/py_config.o  objects/if_ruby.o   objects/netbeans.o  objects/version.o 
     -lnsl   -lncurses -lacl -lattr -lgpm -ldl  -rdynamic  -L/usr/local/lib
/usr/lib/perl5/5.8.5/i686-linux/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl5/5.8.5/i686-linux/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt
-lutil -lc -L/usr/lib/python2.3/config -lpython2.3 -lpthread -ldl -lutil -lm
-Xlinker -export-dynamic  -lruby18 -ldl -lcrypt -lm
objects/if_python.o(.text+0x1d4f): In function `PythonMod_Init':
: undefined reference to `Py_InitModule4'
objects/py_config.o(.data+0x44): undefined reference to `initxxsubtype'
collect2: ld returned 1 exit status
make[1]: *** [vim] Error 1
make[1]: Leaving directory `/var/tmp/portage/vim-6.3-r2/work/vim63/src'
make: *** [first] Error 2

Expected Results:  
1. don't add -L/usr/local/lib in link stage
2. don't look in /usr/local for anything! (what's gentoo policy for /usr/local?)

Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.3, glibc-2.3.4.20040808-r1,
2.6.8-gentoo-r3 i686)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 AMD Athlon(tm)
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
Binutils: sys-devel/binutils-2.14.90.0.7-r4
Headers:  sys-kernel/linux-headers-2.4.19-r1,sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.4.3-r4
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/X11/app-defaults /etc/X11/xdm /etc/gconf /etc/terminfo
/usr/X11R6/lib/X11/xkb /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo
ftp://gentoo.mirrors.pair.com/ http://cudlug.cudenver.edu/gentoo/
ftp://gentoo.ccccom.com ftp://planetmirror.com/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X acl alsa apache apm arts avi berkdb bindist bitmap-fonts bonobo cdr
cjk crypt cscope cups curl dga directfb doc dvd dvdr encode f77 fam flash
fluidsynth foomaticdb fortran gd gdbm ggi gif gnome gpm gstreamer gtk gtk2
gtkhtml guile imagemagick imap imlib innodb jack java jpeg kde ladcca lcms
lesstif libg++libwww mbox mikmod mmx motif mozilla mpeg mysql nas ncurses
network nls odbc oggvorbis opengl oss pam pda pdflib perl plotutils png python
qt quicktime readline ruby scanner sdl slang softmmu spell sse ssl svga tcltk
tcpd tetex tiff truetype usb wmf x86 xinerama xml xml2 xmms xv zlib"

# emerge --ask -v =app-editors/vim-6.3-r2

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] app-editors/vim-6.3-r2  +acl +cscope -debug +gpm -minimal
+ncurses +nls +perl +python +ruby (-selinux) -vim-with-x 0 kB
Comment 1 Ciaran McCreesh 2004-12-21 08:06:29 UTC
Hrm, is vim the only package that does this? Not sure whether this is a general autoconfism or something strange vim is doing.
Comment 2 hixon_c 2004-12-22 03:56:00 UTC
It looks like the auto-generated configure script tests for the presence of /usr/local/lib and adds it to LDFLAGS if it exists: (snagged from /var/tmp/portage/vim-6.3-r2/work/vim63/src/auto/configure)

if test -z "$have_local_lib" -a -d /usr/local/lib; then
  tt=`echo "$LDFLAGS" | sed -e 's+-L/usr/local/lib ++g' -e 's+-L/usr/local/lib$++g'`
  if test "$tt" = "$LDFLAGS"; then
    LDFLAGS="$LDFLAGS -L/usr/local/lib"
  fi
fi

Thats as far as I've got in my digging...  I don't know
autoconf.  Is configure.in the master?
Comment 3 hixon_c 2004-12-22 04:19:02 UTC
I haven't _noticed_ any other package trying to link with stuff I have in /usr/local/lib.  In my case, the error occurs because of a mismatch
of the headers and library: -I/usr/include/python2.3 vs. -L/usr/local/lib.
Comment 5 hixon_c 2005-01-02 11:51:34 UTC
From the above link:
> If vim is built with USE="blah", and the blah library is present in
> /usr/local, vim will link against the /usr/local version. This is
> causing problems for at least one user. On the other hand, I'm thinking
> that this behaviour is probably desirable, in that it allows users to
> link against non-portage-installed apps if the user so desires.

I understand that it might be desirable to link against the /usr/local version,
however it's not doing that correctly either, at least in the case of USE="python".  If it's going to use the python in /usr/local,
it should be using the python installed in /usr/local/bin to obtain the
build flags (such as -I/usr/local/include/python2.3).

What seems to be happening with vim is: the configure script notices that /usr/local/lib exists, and adds -L/usr/local/lib to the LDFLAGS, but it's
using the /usr version of python to get the python (module?) build flags (notice the -I/usr/include/python2.3 in my compile output).
Comment 6 Ciaran McCreesh 2005-01-15 04:51:50 UTC
I'm going to close this one as WONTFIX. Looks like this is an autoconf feature.
Comment 7 Ciaran McCreesh 2005-01-15 04:52:19 UTC
WONTFIX