Bug 152039 - libjawt causes revdep-rebuild to rebuild openoffice-2.0.4 and swt
Bug#: 152039 Product:  Gentoo Linux Version: 2006.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: java@gentoo.org Reported By: heiko@baums-on-web.de
Component: Applications
URL: 
Summary: libjawt causes revdep-rebuild to rebuild openoffice-2.0.4 and swt
Keywords:  
Status Whiteboard: 
Opened: 2006-10-20 01:14 0000
Description:   Opened: 2006-10-20 01:14 0000
revdep-rebuild wants to permanently reinstall openoffice-2.0.4:

Checking dynamic linking consistency...
  broken /usr/lib/openoffice/program/libofficebean.so (requires  libjawt.so)
 done.

All prepared. Starting rebuild...
emerge --oneshot -pv =app-office/openoffice-2.0.4


Both files are installed:

# locate libjawt.so
/opt/sun-jdk-1.5.0.08/jre/lib/i386/libjawt.so
# locate libofficebean.so
/usr/lib/openoffice/program/libofficebean.so


The only Java version I have installed is sun-jdk-1.5.0.08.


emerge --info:

Portage 2.1.2_pre3-r5 (default-linux/x86/2006.1/desktop, gcc-4.1.1,
glibc-2.5-r0, 2.6.17-gentoo-r8 i686)
=================================================================
System uname: 2.6.17-gentoo-r8 i686 AMD Athlon(tm) XP 1600+
Gentoo Base System version 1.12.5
Last Sync: Fri, 20 Oct 2006 00:00:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
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, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
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/gconf
/etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo
/etc/texmf/web2c"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://gd.tuwien.ac.at/opsys/linux/gentoo/
ftp://pandemonium.tiscali.de/pub/gentoo/
http://pandemonium.tiscali.de/pub/gentoo/"
LANG="de_DE.UTF-8"
LINGUAS="de"
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="/usr/var"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac aalib accessibility acpi alsa apache2 apm
arts asf audiofile avi berkdb bitmap-fonts bluetooth bzip2 cairo cdda cddb
cdparanoia cdr chipcard cli cracklib crypt cups curl dga directfb divx dlloader
doc dri dv dvb dvd dvdr dvdread eds effects elibc_glibc emacs emboss encode
expat extrafilters fam fame fbcon ffmpeg firefox flac foomaticdb fortran ftp
gcc-libffi gcj gd gdbm geldkarte gif gimp glitz gmedia gmp gnutls gpm graphviz
gs gstreamer gtk gtk2 gtkhtml hbci iconv idn imagemagick imlib inkjar
input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 irmc
isdnlog jce jpeg kde kernel_linux lcms ldap leim libg++ linguas_de lirc
lirc_devices_devinput live lm_sensors mad mailwrapper mbox mbrola mikmod mjpeg
mmx mmx2 mmxext mng modplug motif mozilla mp3 mp4 mpeg mplayer mysql mysqli nas
ncurses network nls nptl nptlonly nsplugin ntfs nvidia objc objc++ objc-gc odbc
offensive ofx ogg oggvorbis opengl oss pam pcre pdf perl php plugin png ppds
pppd print python qt qt3 qt4 quicktime quotes readline real realmedia
reflection reiserfs rtc rtsp scanner sdl session slang slideshow smime speex
spell spl sqlite sse sse-filters ssl svg svga tcl tcltk tcpd tetex theora
threads tidy tiff tk tokenizer tools truetype truetype-fonts type1-fonts udev
unicode usb userland_GNU utempter v4l v4l2 vdr video_cards_nvidia
video_cards_v4l vidix visualization vlm vorbis win32codecs wmf wmp xcomposite
xine xml xml2 xmms xorg xpm xv xvid yv12 zip zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, MAKEOPTS,
PORTAGE_RSYNC_EXTRA_OPTS


# emerge -pv openoffice

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] app-office/openoffice-2.0.4  USE="binfilter cairo cups gtk java
kde ldap pam -branding -dbus -debug -eds -firefox -gnome -gstreamer -odk -sound
-webdav" LINGUAS="de -af -ar -be_BY -bg -bn -bs -ca -cs -cy -da -el -en -en_GB
-en_US -en_ZA -es -et -fa -fi -fr -gu_IN -he -hi_IN -hr -hu -it -ja -km -ko -lt
-mk -nb -nl -nn -nr -ns -pa_IN -pl -pt -pt_BR -ru -rw -sh_YU -sk -sl -sr_CS -st
-sv -sw_TZ -th -tn -tr -ts -vi -xh -zh_CN -zh_TW -zu" 238,277 kB

------- Comment #1 From Andreas Proschofsky 2006-10-20 02:24:15 0000 -------
I get the same for swt, so I'm not sure this is the fault of openoffice.

Adding java-herd for comments / insight on this.

------- Comment #2 From Denis Dupeyron 2006-10-29 22:57:11 0000 -------
Re-emerging blackdown-jdk fixes this. I have no idea why, though.

Denis.

------- Comment #3 From Heiko Baums 2006-10-30 01:51:04 0000 -------
I tried re-emerging sun-jdk-1.5.0.08 but unfortunately this doesn't fix it.

------- Comment #4 From Andreas Proschofsky 2006-11-16 10:19:07 0000 -------
Re-assigning to java-herd, as I pointed out in an earlier comment, this does
not seem to be OOo-specific. Hoping to get some feedback this way

------- Comment #5 From Vlastimil Babka (Caster) 2006-11-22 05:59:13 0000 -------
I think the problem is that libofficebean.so is built without absolute path
reference to libjawt.so. This means that the linker won't find it unless
directory containing libjawt.so is defined in /etc/ld.so.conf, via a file
defining LDPATH in /etc/env.d/ We define this in /etc/env.d/20java but this is
only for generation 1 VM's. You have only sun-jdk-1.5 which is gen-2 (btw this
setup is not supported atm, you should also have a gen-1 system VM as well).
But anyway seems you found some hole in gen-2 setup. I see three possible
solutions here.

a) OOo build would harcdode the path to libjawt.so (during build it can find it
through JAVA_HOME). But I'm no expert on linking so I don't know if that's
correct. It would also mean that you would be tied to that hardcoded VM to run
openoffice with, I suppose running with one VM and with libs from other VM is
broken :)

b) find a way to control dynamically (possibly per user) LDPATH in gen-2 setup.
Not sure if we can do the same trick as with JAVA_HOME using symlinks, in
/etc/ld.so.conf :/

c) if none of that is possible, have gen-2 system VM set the LDPATH, and any
package depending on native lib stuff would need to run with system vm.

------- Comment #6 From Marian Kyral 2007-02-03 13:27:47 0000 -------
openoffice-2.1.0 - still the same problem.

I've removed the blackdown-jdk-1.4.2.03 package, switched to sun-jdk-1.5, but
the file /etc/env.d/20java still contains paths to blackdown-jdk-1.4.2.03.

[14:17:15 marian@nest ~]$ cat /etc/env.d/20java
# Autogenerated by java-config
# Command: --set-system-vm=blackdown-jdk-1.4.2
LDPATH=/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/:/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/native_threads/:/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/classic/:/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/server/
JDK_HOME=/opt/blackdown-jdk-1.4.2.03
JAVAC=/opt/blackdown-jdk-1.4.2.03/bin/javac
GENERATION=2
ROOTPATH=/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin
VMHANDLE=blackdown-jdk-1.4.2
# VERSION=Blackdown JDK 1.4.2.03
MANPATH=/opt/blackdown-jdk-1.4.2.03/man
PATH=/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin
JAVA_HOME=/opt/blackdown-jdk-1.4.2.03


I've tried eselect and java-config, but the file above is not changed. Is it
depricated now?

------- Comment #7 From Vladimir Pouzanov 2007-03-05 07:46:03 0000 -------
Confirming same problem for swt:
$ ldd /usr/lib/libswt-awt-gtk-3235.so
        linux-gate.so.1 =>  (0xa7f87000)
        libjawt.so => not found
        libc.so.6 => /lib/libc.so.6 (0xa7e28000)
        /lib/ld-linux.so.2 (0x75555000)
$ qfile libjawt.so
dev-java/sun-jdk (/opt/sun-jdk-1.6.0/jre/lib/i386/libjawt.so)

I have dev-java/sun-jdk-1.6.0-r1 and this is the only VM installed.

------- Comment #8 From Petteri Räty 2007-03-05 09:28:26 0000 -------
(In reply to comment #5)
> 
> a) OOo build would harcdode the path to libjawt.so (during build it can find it
> through JAVA_HOME). But I'm no expert on linking so I don't know if that's
> correct. It would also mean that you would be tied to that hardcoded VM to run
> openoffice with, I suppose running with one VM and with libs from other VM is
> broken :)
> 
> b) find a way to control dynamically (possibly per user) LDPATH in gen-2 setup.
> Not sure if we can do the same trick as with JAVA_HOME using symlinks, in
> /etc/ld.so.conf :/
> 
> c) if none of that is possible, have gen-2 system VM set the LDPATH, and any
> package depending on native lib stuff would need to run with system vm.
> 

d) We use the LD_LIBRARY_MASK feature in revdep-rebuild.

------- Comment #9 From Petteri Räty 2007-03-05 09:29:42 0000 -------
This is not a broken dependency as no-one has showed any problems in actually
running problems. The VM takes care of dynamically loading this library.

------- Comment #10 From Petteri Räty 2007-03-05 10:05:15 0000 -------
(In reply to comment #9)
> This is not a broken dependency as no-one has showed any problems in actually
> running problems. The VM takes care of dynamically loading this library.
> 

Added a revdep-rebuild control file to dev-java/java-config-2.0.31-r4. Thanks
for reporting.

------- Comment #11 From Max Arnold 2007-03-08 07:28:04 0000 -------
I encountered the same problem
(http://bugs.gentoo.org/show_bug.cgi?id=141974#c27) and fixed it by manually
placing 60-java into /etc/revdep-rebuild/, as described in latest ebuild.
Just one question:  since I don't have any blackdown-jdk in my system, should I
remove any "/opt/blackdown-jdk*" path occurrences from /etc/ld.so.conf and
remove /etc/env.d/20java ?  And why they weren't automatically removed during
blackdown-jdk unmerging?

------- Comment #12 From Petteri Räty 2007-03-08 11:24:10 0000 -------
(In reply to comment #11)
> I encountered the same problem
> (http://bugs.gentoo.org/show_bug.cgi?id=141974#c27) and fixed it by manually
> placing 60-java into /etc/revdep-rebuild/, as described in latest ebuild.
> Just one question:  since I don't have any blackdown-jdk in my system, should I
> remove any "/opt/blackdown-jdk*" path occurrences from /etc/ld.so.conf and
> remove /etc/env.d/20java ?  And why they weren't automatically removed during
> blackdown-jdk unmerging?
> 

Somewhat related to this bug better to still ask on #gentoo-java or our mailing
list. Those entries don't hurt anything as they just make ldconfig search those
dirs when building the cache but as we still expect people to install a
generation 1 VM because not everything is migrated to generation 2 we haven't
looked into cleaning that away yet. If you have sun-jdk-1.4 installed, just run
env-update and you should get that to ld.so.conf. I think originally the
entries were added there because of revdep-rebuild actually. But now we use a
different trick to remove those entries from the list.