Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 408283

Summary: media-gfx/splashutils-1.5.4.4: linking to freetype fails due to missing static library bzip2 (-lbz2)
Product: Gentoo Linux Reporter: Piotr Szymaniak <bugzie>
Component: Current packagesAssignee: Asaf Gery <asaf.gery>
Status: RESOLVED FIXED    
Severity: normal CC: alon.barlev, anton.kochkov, bircoph, enviouzproductionz07, frayser411, jaak, joerg.schaible, M4rkusXXL, my, poletti.marco, proxy-maint, shubhadeepc, skrattaren, thev00d00, xmw
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 442826, 556954    
Attachments: Build.log
Build log on amd64
build log on amd64 after downgrade of media-libs/freetype
splashutils ebuild with line to apply the patch. revbumped
new suspend bzip patch
new ebuild for new patch
splashutils-1.5.4.4-r6.ebuild.patch

Description Piotr Szymaniak 2012-03-15 07:26:25 UTC
Created attachment 305439 [details]
Build.log

New zlib API issue?
Comment 1 jeremy 2012-04-13 02:25:10 UTC
Created attachment 308723 [details]
Build log on amd64
Comment 2 jeremy 2012-04-13 02:26:08 UTC
Created attachment 308725 [details]
build log on amd64 after downgrade of media-libs/freetype
Comment 3 jeremy 2012-04-13 02:35:33 UTC
(In reply to comment #0)
> Created attachment 305439 [details]
> Build.log
> 
> New zlib API issue?

Have you updated media-libs/freetype recently?

At least on my system that is where it problem seems to be. 

I found a few different cases that would allow it to build.

case 1:

media-gfx/splashutils -truetype

Case 2:

media-libs/freetype-2.4.9-r1 -bzip2
media-gfx/splashutils +truetype
Case 3:

mask media-libs/freetype-2.4.9-r1

and install

media-libs/freetype-2.4.9 +bzip
media-gfx/splashutils +truetype

Case three is the only one that allows a successful build of media-gfx/splashutils with both truetype turned on on that package and bzip2 turned on with freetype.

There mustve been some change between media-libs/freetype-2.4.9 and media-libs/freetype-2.4.9-r1 that broke it.

Either way i still see /usr/bin/ld: warning: cannot find entry symbol main; defaulting to 0000000000400200

But i still get a successful build.
Comment 4 Robert Cabrera 2012-04-13 16:12:16 UTC
Same issue here on my ~amd64 laptop. With the recent freetype update in portage splashutils fails to build. I'll try some of the suggestions listed by Jeremy in post #3 and see if I can get it to build.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2012-04-17 17:36:49 UTC
*** Bug 412383 has been marked as a duplicate of this bug. ***
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2012-04-17 17:38:07 UTC
(In reply to comment #5)
> *** Bug 412383 has been marked as a duplicate of this bug. ***

A patch was submitted to above duplicate:

http://bugs.gentoo.org/attachment.cgi?id=309297
Comment 7 Robert Cabrera 2012-04-19 21:14:57 UTC
Samuli, is it possible to update ebuild to include the patch? I can get splashutils to build by manually installing the patch, but I can't figure out how to incorporate it into my ebuild to get it to work from my overlay. TIA
Comment 8 jeremy 2012-04-19 21:20:07 UTC
(In reply to comment #7)
> Samuli, is it possible to update ebuild to include the patch? I can get
> splashutils to build by manually installing the patch, but I can't figure
> out how to incorporate it into my ebuild to get it to work from my overlay.
> TIA

I have an ebuild in my local overlay that incorporates the patch. builds fine. ill try to attach it to this bug report later this evening after i get home.
Comment 9 jeremy 2012-04-22 00:10:36 UTC
Created attachment 309763 [details]
splashutils ebuild with line to apply the patch. revbumped
Comment 10 jeremy 2012-04-22 00:15:46 UTC
New ebuild added. Incorporates the patch. Make sure the patch is in your local overlay. i have mine at /usr/local/portage/media-gfx/splashutils/files/
Comment 11 Robert Cabrera 2012-04-23 14:03:44 UTC
Thanks!
Rob
Comment 12 jeremy 2012-04-24 19:05:17 UTC
Your welcome. Hopefully this will get committed to the main portage tree soon.
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2012-05-07 08:30:47 UTC
*** Bug 414969 has been marked as a duplicate of this bug. ***
Comment 14 Michael Weber (RETIRED) gentoo-dev 2012-05-22 13:17:28 UTC
+*splashutils-1.5.4.4-r1 (22 May 2012)
+
+  22 May 2012; Michael Weber <xmw@gentoo.org> +splashutils-1.5.4.4-r1.ebuild,
+  +files/splashutils-1.5.4.4-bzip2.patch:
+  Revbump to fix bug 408283 and bug 412383 (non-maint commit)
+

@spock: no offense, plz.
Comment 15 dE 2012-06-17 14:58:40 UTC
I'm affected.
Comment 16 Alon Bar-Lev 2012-07-01 18:20:41 UTC
Hello,

This is not correct fix.

refer to /usr/lib/pkgconfig/libfbsplashrender.pc and you see that the bz2 is
missing. This means that the libfnsplashrender is not linked correctly with
all dependencies.

as result, depended packages such as sys-power/suspend fail to link.

spock, I tried to examine the build system to find the place to fix this properly, and failed.

I think that adding _PKG_CONFIG([FREETYPE2_STATIC_LIBS], [libs --static], [freetype2]) and use FREETYPE2_STATIC_LIBS should solve this.
Comment 17 Michael Weber (RETIRED) gentoo-dev 2012-11-30 01:22:56 UTC
+*splashutils-1.5.4.4-r3 (30 Nov 2012)
+
+  30 Nov 2012; Michael Weber <xmw@gentoo.org> +splashutils-1.5.4.4-r3.ebuild,
+  +files/splashutils-1.5.4.4-r3-bzip2.patch:
+  Revbump to add -lbz2 to libfbsplashrender.pc (bug 408283)
+
Comment 18 Oleg Ageev 2013-01-13 14:20:46 UTC
Created attachment 335478 [details, diff]
new suspend bzip patch

rewrite patch from https://bugs.gentoo.org/show_bug.cgi?id=416955
it fix this bug and correct fix https://bugs.gentoo.org/show_bug.cgi?id=416955
Comment 19 Oleg Ageev 2013-01-13 14:22:16 UTC
Created attachment 335480 [details]
new ebuild for new patch
Comment 20 Pacho Ramos gentoo-dev 2013-01-20 10:20:41 UTC
(In reply to comment #18)
> Created attachment 335478 [details, diff] [details, diff]
> new suspend bzip patch
> 
> rewrite patch from https://bugs.gentoo.org/show_bug.cgi?id=416955
> it fix this bug and correct fix
> https://bugs.gentoo.org/show_bug.cgi?id=416955

Is this still needed with -r2?
Comment 21 Pacho Ramos gentoo-dev 2013-06-16 17:40:33 UTC
latest revision should has this fixed
Comment 22 Anton Kochkov 2013-06-16 20:50:55 UTC
This is kind of related, I think https://bugs.gentoo.org/show_bug.cgi?id=473512
Comment 23 Andrew Savchenko gentoo-dev 2015-08-09 15:29:52 UTC
(In reply to Pacho Ramos from comment #21)
> latest revision should has this fixed

No, it is not fixed:

1. libfbsplashrender.pc doesn't contain -lbz2 when freetype compiled with USE="bzip2":
Libs: -L${libdir} -lfbsplashrender
Libs.private: -lfbsplash libfbsplash.la -ljpeg -lpng16 -lm -lz -lm -lfreetype -lm

2. Linking with libfbsplashrender.so fail with data taken from *.pc file:
libtool: link: x86_64-pc-linux-gnu-gcc -DS2RAM -D_LARGEFILE64_SOURCE -DCONFIG_BOTH -march=native -O2 -funswitch-loops -fpredictive-commoning -ftree-vectorize -ftree-slp-vecto
rize -fvect-cost-model -fgcse-after-reload -ftree-partial-pre -ftree-loop-im -fweb -frename-registers -fomit-frame-pointer -fexcess-precision=fast -pipe -frecord-gcc-switches
 -fno-stack-protector -std=gnu90 -march=native -O2 -funswitch-loops -fpredictive-commoning -pipe -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z -Wl,combreloc -Wl,-z -Wl,rel
ro -Wl,-z -Wl,now -Wl,--relax -Wl,--hash-style=gnu -o s2both s2both-suspend.o  libsuspend-common.a -lx86 -lpci -llzo2 /usr/lib64/libgcrypt.so -lgpg-error -lpthread -lfbsplash
render -lfbsplash -ljpeg -lpng16 -lz -lfreetype -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libfreetype.a(ftbzip2.o): In function `ft_bzip2_stream_close':
(.text+0x29): undefined reference to `BZ2_bzDecompressEnd'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libfreetype.a(ftbzip2.o): In function `ft_bzip2_file_fill_output':
(.text+0x133): undefined reference to `BZ2_bzDecompress'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libfreetype.a(ftbzip2.o): In function `ft_bzip2_stream_io':
(.text+0x2d0): undefined reference to `BZ2_bzDecompressEnd'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libfreetype.a(ftbzip2.o): In function `ft_bzip2_stream_io':
(.text+0x31d): undefined reference to `BZ2_bzDecompressInit'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libfreetype.a(ftbzip2.o): In function `FT_Stream_OpenBzip2':
(.text+0x500): undefined reference to `BZ2_bzDecompressInit'
collect2: error: ld returned 1 exit status
Comment 24 Andrew Savchenko gentoo-dev 2015-08-09 16:58:55 UTC
To be correct: the fix mentioned above fixes splashutils build with freetype[bzip2], but it doesn't fix *.pc file provided, thus packages linking with libfbsplashrender.so on systems with freetype[bzip2] will fail to link due to incomplete list of flags.
Comment 25 Andrew Savchenko gentoo-dev 2015-08-09 22:12:59 UTC
Created attachment 408692 [details, diff]
splashutils-1.5.4.4-r6.ebuild.patch

Currently used approach for bzip2 linking with freetype is not correct. Freetype already provides the list of all libraries required for linking. But because splashutils linking is static, static linking flags should be requested from freetype.

Here the problem lies: autotools request dynamic linker flags by default (pkg-config --libs), but they are incomplete for static linking in general case, e.g. for freetype2. Therefore `pkg-config --static` should be used instead. The only way to do this is to set it vian PKG_CONFIG variable, which is done in this patch.

Please note that *-bzip2 patches are no longer needed after this change.
Comment 26 Ian Delaney (RETIRED) gentoo-dev 2015-08-13 03:23:34 UTC
commit 3a633761a8499d37806ddc64a96a752c1cf1e692
Author: Ian Delaney <idella4@gentoo.org>
Date:   Thu Aug 13 11:22:31 2015 +0800

    media-gfx/splashutils: revbump, patch from bug #408283 by bircoph