Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 682198 - media-libs/giflib-5.1.9 breaks older packages that require GifQuantizeBuffer
Summary: media-libs/giflib-5.1.9 breaks older packages that require GifQuantizeBuffer
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal with 4 votes (vote)
Assignee: Gentoo Graphics Project
URL: https://sourceforge.net/p/giflib/bugs...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 707326
  Show dependency tree
 
Reported: 2019-04-01 03:57 UTC by Gary Stein
Modified: 2020-02-22 23:17 UTC (History)
3 users (show)

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


Attachments
Added deprecated utility functions back into libgif.so (Makefile.patch,512 bytes, patch)
2019-04-01 03:58 UTC, Gary Stein
Details | Diff
Re-introduce GifQuantizeBuffer() to gif_lib.h (GifQuantizeBuffer_h.patch,878 bytes, patch)
2020-01-30 20:47 UTC, Bernd Feige
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Stein 2019-04-01 03:57:32 UTC
In giflib-5.1.9, they split the library into libgif.so and libutil.so and only install libgif.so.  It wasn't like that in 5.1.8 or lower.

GifQuantizeBuffer was moved into the util library. Their NEWS file does say that that function is deprecated around 2012, but added back in because some programs still use it.  Specifically libgdiplus breaks for me.


Reproducible: Always

Steps to Reproduce:
1. Compile giflib-5.1.9
2. Compile libgdiplus (or another package that needs GifQuantizeBuffer)
Actual Results:  
../src/.libs/libgdiplus.so: undefined reference to `GifQuantizeBuffer'


Expected Results:  
Compile normally

It can be fixed with adding all the functions back into the libgif.so

< libgif.so: $(OBJECTS) $(HEADERS)
< 	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS)
---
> libgif.so: $(OBJECTS) $(HEADERS) $(UOBJECTS)
> 	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS) $(UOBJECTS)
Comment 1 Gary Stein 2019-04-01 03:58:28 UTC
Created attachment 571424 [details, diff]
Added deprecated utility functions back into libgif.so
Comment 2 Lars Wendler (Polynomial-C) gentoo-dev 2019-04-01 05:04:06 UTC
Did you report that to upstream as well?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2019-04-02 07:06:48 UTC
media-video/mplayer[gif] is also affected.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2019-04-03 17:43:38 UTC
Full comparison of lists of defined symbols:

# diff -u <(nm -C -D --defined-only --with-symbol-versions giflib-5.1.8-r1/image/usr/lib64/libgif.so | sed -e "s/^[0-9a-f]\+ //") <(nm -C -D --defined-only --with-symbol-versions giflib-5.1.9/image/usr/lib64/libgif.so | sed -e "s/^[0-9a-f]\+ //")
--- /dev/fd/63
+++ /dev/fd/62
@@ -38,9 +38,6 @@
 T EGifSetGifVersion@@Base
 T EGifSpew@@Base
 T FreeLastSavedImage@@Base
-T GAGetArgs@@Base
-T GAPrintErrMsg@@Base
-T GAPrintHowTo@@Base
 T GifAddExtensionBlock@@Base
 T GifApplyTranslation@@Base
 R GifAsciiTable8x8@@Base
@@ -55,11 +52,7 @@
 T GifFreeSavedImages@@Base
 T GifMakeMapObject@@Base
 T GifMakeSavedImage@@Base
-B GifNoisyPrint@@Base
-T GifQprintf@@Base
-T GifQuantizeBuffer@@Base
 T GifUnionColorMap@@Base
-T PrintGifError@@Base
 T _ClearHashTable@@Base
 T _ExistsHashTable@@Base
 T _InitHashTable@@Base


The only symbol from these 7 symbols deleted in giflib-5.1.9 which is declared in installed header (gif_lib.h) is GifQuantizeBuffer. It is declared in both giflib-5.1.8 and giflib-5.1.9.
Comment 5 Victor Mataré 2019-06-05 19:54:26 UTC
Well, quoting from /usr/include/gif_lib.h:309:

/******************************************************************************
 Color table quantization (deprecated)
******************************************************************************/
int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
[...]

But deprecated certainly doesn't mean "declare it, but remove the definition". It should much rather be defined, but compile with a deprecation warning.
Comment 6 Miroslav Šulc gentoo-dev 2019-11-16 11:27:00 UTC
media-video/mplayer-1.3.0-r5:0 not affected. this is the only one in the tree.
Comment 7 Larry the Git Cow gentoo-dev 2019-11-16 13:55:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbf3b048f150e28d08d1ba12cbaf22f6135cd552

commit cbf3b048f150e28d08d1ba12cbaf22f6135cd552
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2019-11-16 13:54:01 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2019-11-16 13:54:51 +0000

    media-libs/simage-1.7.1: bump
    
    1) removed not needed stuff from simage-1.7.1-cmake-automagic-deps.patch
    2) disabling check that uses GifQuantizeBuffer (see #687088, #682198)
    3) added simage-1.7.1-fix-examples-linking.patch for fixing linking issues
    4) reintroduced ~sparc
    5) removed buggy simage-1.7.1a_beta_pre20180312.ebuild (see 2))
    
    Bug: https://bugs.gentoo.org/682198
    Closes: https://bugs.gentoo.org/687088
    Closes: https://bugs.gentoo.org/698882
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 media-libs/simage/Manifest                         |   2 +-
 .../files/simage-1.7.1-cmake-automagic-deps.patch  | 498 ++-------------------
 .../simage-1.7.1-disable-gif-quantize-buffer.patch |  31 ++
 .../files/simage-1.7.1-fix-examples-linking.patch  |  22 +
 ...beta_pre20180312.ebuild => simage-1.7.1.ebuild} |  19 +-
 5 files changed, 108 insertions(+), 464 deletions(-)
Comment 8 Arfrever Frehtes Taifersar Arahesis 2019-11-17 02:59:32 UTC
(In reply to Miroslav Šulc from comment #6)
> media-video/mplayer-1.3.0-r5:0 not affected.

Both media-video/mplayer-1.3.0-r5[gif] and media-video/mplayer-9999[gif] are still affected:

$ nm -C -D /usr/bin/mplayer | grep GifQuantizeBuffer
                 U GifQuantizeBuffer
Comment 9 Larry the Git Cow gentoo-dev 2019-12-25 17:44:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76ebdaa3d46dc8fcc23375cd365039ef272fd74d

commit 76ebdaa3d46dc8fcc23375cd365039ef272fd74d
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2019-12-25 17:43:39 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2019-12-25 17:43:39 +0000

    media-libs/giflib: Add patch for GifQuantizeBuffer API
    
    * Patch taken from Archlinux
    
    Bug: https://bugs.gentoo.org/682198
    Package-Manager: Portage-2.3.83, Repoman-2.3.20
    Signed-off-by: David Seifert <soap@gentoo.org>

 ...ib-5.2.1-fix-missing-quantize-API-symbols.patch | 32 ++++++++++++++++++++++
 ...{giflib-5.2.1.ebuild => giflib-5.2.1-r1.ebuild} |  1 +
 2 files changed, 33 insertions(+)
Comment 10 Andreas Sturmlechner gentoo-dev 2020-01-29 21:40:06 UTC
Is this bug still relevant?
Comment 11 Bernd Feige 2020-01-30 20:44:44 UTC
(In reply to Andreas Sturmlechner from comment #10)
> Is this bug still relevant?

Well, the merged patch only adds the object to the library, so it allows binaries using the ABI to run, but upstream also removed the declaration of GifQuantizeBuffer from gif_lib.h, so compilation still fails. Here this happens only with media-gfx/exact-image. I append the patch that's needed in addition...
Comment 12 Bernd Feige 2020-01-30 20:47:56 UTC
Created attachment 609396 [details, diff]
Re-introduce GifQuantizeBuffer() to gif_lib.h
Comment 13 Larry the Git Cow gentoo-dev 2020-02-22 23:17:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=568f99f6c440db42edc001e6074a50eb614ae131

commit 568f99f6c440db42edc001e6074a50eb614ae131
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2020-02-22 23:17:34 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2020-02-22 23:17:34 +0000

    media-video/mplayer: Disable GIF support
    
    * mplayer relies on private APIs of giflib that
      have been moved around and will be removed in
      a future release.
    
    Bug: https://bugs.gentoo.org/682198
    Package-Manager: Portage-2.3.89, Repoman-2.3.20
    Signed-off-by: David Seifert <soap@gentoo.org>

 .../{mplayer-1.3.0-r5.ebuild => mplayer-1.3.0-r6.ebuild}       |  8 +++++---
 media-video/mplayer/mplayer-9999.ebuild                        | 10 ++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)