Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146211 - gettext-0.15 is broken with expat.so.1
Summary: gettext-0.15 is broken with expat.so.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-03 22:47 UTC by Donnie Berkholz (RETIRED)
Modified: 2006-12-29 16:48 UTC (History)
4 users (show)

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


Attachments
patch to not use dlopen to load expat on linux (gettext-expat.patch,803 bytes, patch)
2006-09-05 04:45 UTC, Emanuele Giaquinta (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Donnie Berkholz (RETIRED) gentoo-dev 2006-09-03 22:47:56 UTC
New in gettext 0.15, there is supposedly support for libexpat.so.1 rather than libexpat.so.0. But this is broken on OS's for which gettext uses dlopen(), namely Linux.

`strings /usr/bin/xgettext | grep expat` will return libexpat.so.0 rather than libexpat.so.1. This originates in gettext-0.15/gettext-tools/src/x-glade.c. When using dlopen(), XML_MAJOR_VERSION never gets defined, so the code defaults to using libexpat.so.0 rather than libexpat.so.1.

Really it should be smart enough to try either at runtime, but it should at least get fixed to use XML_MAJOR_VERSION. Just adding an #include <expat.h> in the appropriate section was not enough, as that caused other conflicting definitions.
Comment 1 Kevin F. Quinn (RETIRED) gentoo-dev 2006-09-04 16:06:50 UTC
(Just plonking a note here, for reference:
dev-libs/expat-1.x generates libexpat.so.0, with XML_MAJOR_VERSION = 1
dev-libs/expat-2.x generates libexpat.so.1, with XML_MAJOR_VERSION = 2)

x-glade.c is manually defining the interface when it uses dlopen() in place of including <expat.h>, so clearly including <expat.h> isn't what the author intended - although I don't see why it's done that way.  XML_MAJOR_VERSION is only defined in expat.h; my guess is that in gettext it should have been defined by a configure check which detects which version of libexpat is installed.

Assuming this is the case, we will would have to force a rebuild of gettext whenever expat is upgraded from .0 to .1.  The other way of getting around it is to slot dev-libs/libexpat (with dev-libs/expat-2.0.0 at SLOT="1").
Comment 2 Emanuele Giaquinta (RETIRED) gentoo-dev 2006-09-05 04:41:10 UTC
(In reply to comment #1)
> x-glade.c is manually defining the interface when it uses dlopen() in place of
> including <expat.h>, so clearly including <expat.h> isn't what the author
> intended - although I don't see why it's done that way.  XML_MAJOR_VERSION is
> only defined in expat.h; my guess is that in gettext it should have been
> defined by a configure check which detects which version of libexpat is
> installed.

I proposed this solution to upstream but received no answer.

> Assuming this is the case, we will would have to force a rebuild of gettext
> whenever expat is upgraded from .0 to .1.  The other way of getting around it
> is to slot dev-libs/libexpat (with dev-libs/expat-2.0.0 at SLOT="1").

configure.ac forces the dl* interface for expat on linux, while on every other system it uses standard linking; we can patch it to use the latter also on linux. Alternatively, as proposed by Donnie, we can modify x-glade.c to always load libexpat.so.1 and depend on expat-2.
Comment 3 Emanuele Giaquinta (RETIRED) gentoo-dev 2006-09-05 04:45:03 UTC
Created attachment 96054 [details, diff]
patch to not use dlopen to load expat on linux
Comment 4 SpanKY gentoo-dev 2006-09-05 21:58:01 UTC
feel free to do whichever you think is best Emanuele ;)
Comment 5 Ziga Boehm 2006-09-25 08:45:12 UTC
Opting for slotted solution would probably be best solution as too many thing could otherwise break? Regardin latter please also look at bug #128108.
Comment 6 Bob McDonald 2006-10-24 06:04:30 UTC
This appears to affect other packages as well.  After emerging dev-libs/expat-2.0.0, emerging sys-apps/kbd and sys-apps-net-tools failed as described above.  After I went back to dev-libs/expat-1.95.8, these packages emerge without error.  Perhaps it be a good idea to add >=dev-libs/expat-2.0.0 to the mask file until you decide to slot or not.

Comment 7 SpanKY gentoo-dev 2006-12-29 16:48:40 UTC
gettext-0.15-r1 has this fix, just forgot to close this bug