Gentoo Archives: gentoo-dev

From: Samuli Suominen <ssuominen@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] doubtful about libjpeg-turbo vs. libjpeg binary compatibility
Date: Thu, 19 Jan 2012 09:38:33
Message-Id: 4F17E3EF.2070706@gentoo.org
In Reply to: [gentoo-dev] doubtful about libjpeg-turbo vs. libjpeg binary compatibility by "Paweł Hajdan
1 On 01/19/2012 11:19 AM, "Paweł Hajdan, Jr." wrote:
2 > While dealing with<https://bugs.gentoo.org/show_bug.cgi?id=393471> I
3 > started discussing with developers working on libjpeg-turbo support in
4 > WebKit, and I learned that despite
5 > <http://archives.gentoo.org/gentoo-dev/msg_e67bedf25dd178ec09a325a1220724e6.xml>
6 > libjpeg-turbo is not necessarily binary compatible with libjpeg, and
7 > even with different versions of itself.
8 >
9 > Here's why. See
10 > <http://libjpeg-turbo.svn.sourceforge.net/viewvc/libjpeg-turbo/trunk/libjpeg.txt?revision=299&view=markup>
11 > and search for "as a shared library". I'll paste the relevant quote here
12 > anyway:
13 >
14 >> While you can build the JPEG library as a shared library if the whim strikes
15 >> you, we don't really recommend it. The trouble with shared libraries is that
16 >> at some point you'll probably try to substitute a new version of the library
17 >> without recompiling the calling applications. That generally doesn't work
18 >> because the parameter struct declarations usually change with each new
19 >> version. In other words, the library's API is *not* guaranteed binary
20 >> compatible across versions; we only try to ensure source-code compatibility.
21 >
22 > The particular problem with www-client/chromium is caused by
23 > <http://trac.webkit.org/changeset/101286/trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp>
24 > which sort of "hardcodes" in the compiled binary whether it was compiled
25 > against libjpeg-turbo with swizzle support (whatever that is) or not.
26 >
27 > The real problem here is that with above "no guarantee" of binary
28 > compatibility such a solution may be considered legitimate, especially
29 > that for e.g. Google Chrome the bundled copy of libjpeg-turbo is always
30 > used.
31 >
32 > What do you guys think we should do with this on the Gentoo side?At
33
34 always use system libraries and i'm in process of dropping keywording
35 from media-libs/jpeg wrt[1] since we have no need for source slot of it
36
37 [1] http://bugs.gentoo.org/398909
38
39 both providers will be left in the virtual/jpeg, but only libjpeg-turbo
40 will be keyworded (and thus supported), eliminating rest of the issues
41 raised here
42
43 - Samuli
44
45 > this moment I've just reverted the mentioned change in
46 > www-client/chromium ebuild, but it's not feasible to keep a local patch
47 > too long (it needs rebasing too often).
48 >
49 > I was thinking about changing SONAMES, which would trigger rebuilds make
50 > things work, but then don't we rely on specific libjpeg SONAMES for
51 > binary-only software to work? Or does such binary-only software just use
52 > libjpeg-6b?
53 >
54 > Are there some other solutions we could apply on the Gentoo side? The
55 > main point here is that Chromium upstream considers
56 > <http://trac.webkit.org/changeset/101286/trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp>
57 > a legitimate change, and based on the referenced
58 > <http://libjpeg-turbo.svn.sourceforge.net/viewvc/libjpeg-turbo/trunk/libjpeg.txt?revision=299&view=markup>
59 > disclaimer about no guarantee of binary compatibility, I think it makes
60 > sense.
61 >

Replies