Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 486248 - app-office/magicpoint-1.13a USE=gif - ./image/libmgpimage.a(gif.o): In function `gifLoad': gif.c:(.text+0x3f1): undefined reference to `PrintGifError'
Summary: app-office/magicpoint-1.13a USE=gif - ./image/libmgpimage.a(gif.o): In functi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Peter Stuge
URL:
Whiteboard: Pending removal: 2016-02-05
Keywords: PMASKED
: 539428 (view as bug list)
Depends on:
Blocks: 512540
  Show dependency tree
 
Reported: 2013-09-28 00:40 UTC by Anton Kochkov
Modified: 2016-01-28 15:27 UTC (History)
6 users (show)

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


Attachments
magicpoint-giflib.patch (giflib.patch,1.60 KB, patch)
2013-12-08 12:23 UTC, Anton Kochkov
Details | Diff
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.25 KB, text/plain)
2016-01-12 02:25 UTC, Peter Stuge
Details
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.27 KB, text/plain)
2016-01-12 02:45 UTC, Peter Stuge
Details
magicpoint-1.13a_p20121015-draw-charset.patch (magicpoint-1.13a_p20121015-draw-charset.patch,376 bytes, patch)
2016-01-12 17:17 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015-draw-stringtoolong.patch (magicpoint-1.13a_p20121015-draw-stringtoolong.patch,310 bytes, patch)
2016-01-12 17:19 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015-implicit-declaration.patch (magicpoint-1.13a_p20121015-implicit-declaration.patch,3.59 KB, patch)
2016-01-12 17:20 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015-any-giflib.patch (magicpoint-1.13a_p20121015-any-giflib.patch,3.50 KB, patch)
2016-01-12 17:23 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015-gif-dimension.patch (magicpoint-1.13a_p20121015-gif-dimension.patch,493 bytes, patch)
2016-01-12 17:24 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.55 KB, text/plain)
2016-01-12 17:26 UTC, Peter Stuge
Details
magicpoint-1.13a_p20121015-parse-empty.patch (magicpoint-1.13a_p20121015-parse-empty.patch,316 bytes, patch)
2016-01-12 18:27 UTC, Peter Stuge
Details | Diff
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.61 KB, text/plain)
2016-01-12 18:27 UTC, Peter Stuge
Details
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.63 KB, text/plain)
2016-01-13 04:36 UTC, Peter Stuge
Details
magicpoint-1.13a_p20121015.ebuild (magicpoint-1.13a_p20121015.ebuild,3.68 KB, text/plain)
2016-01-13 04:42 UTC, Peter Stuge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2013-09-28 00:40:46 UTC
With media-libs/giflib-4.2.3:

rm -f libmgpimage.a
ar clq libmgpimage.a  imagetypes.o gif.o send.o zio.o zoom.o new.o compress.o reduce.o	value.o misc.o rotate.o rle.o rlelib.o smooth.o halftone.o clip.o	dither.o xbitmap.o xpixmap.o pbm.o pcx.o xwd.o mac.o jpeg.o g3.o	path.o sunraster.o mcidas.o fbm.o faces.o cmuwmraster.o bright.o	img.o mc_tables.o window.o png.o
ranlib libmgpimage.a
make[1]: Leaving directory `/var/tmp/portage/app-office/magicpoint-1.13a/work/magicpoint-1.13a/image'
rm -f mgp
i686-pc-linux-gnu-gcc -o mgp -O2 -march=core2 -mfpmath=sse -mmmx -msse -msse2 -mssse3 -pipe     -Wl,-O1 -Wl,--as-needed -L/usr/lib   mgp.o draw.o parse.o plist.o globals.o x11.o font.o background.o 	scanner.o grammar.o postscript.o tfont.o embed.o unimap.o mng.o m17n.o strlcpy.o strlcat.o     -L./image -lmgpimage -lm  -lpng16  -L/usr/lib -lpng -L/usr/lib -lmng -L/usr/lib/X11 -lXft  -lgif  -lXext -lX11 
./image/libmgpimage.a(gif.o): In function `gifLoad':
gif.c:(.text+0x3f1): undefined reference to `PrintGifError'
collect2: error: ld returned 1 exit status
make: *** [mgp] Error 1
 [31;01m*[0m ERROR: app-office/magicpoint-1.13a::gentoo failed (compile phase):
 [31;01m*[0m   emake failed
 [31;01m*[0m 
 [31;01m*[0m If you need support, post the output of `emerge --info '=app-office/magicpoint-1.13a::gentoo'`,
 [31;01m*[0m the complete build log and the output of `emerge -pqv '=app-office/magicpoint-1.13a::gentoo'`.
 [31;01m*[0m The complete build log is located at '/var/tmp/portage/app-office/magicpoint-1.13a/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/app-office/magicpoint-1.13a/temp/environment'.
 [31;01m*[0m Working directory: '/var/tmp/portage/app-office/magicpoint-1.13a/work/magicpoint-1.13a'
 [31;01m*[0m S: '/var/tmp/portage/app-office/magicpoint-1.13a/work/magicpoint-1.13a'
Comment 1 Aaron Pelton 2013-09-28 20:31:52 UTC
This appears to be related to the elimination of PrintGifError with GifErrorString as mentioned in https://abf.rosalinux.ru/openmandriva/imlib/commit/b74ec4832c680c1bbe084cc94562f812fb05c7c5 (changed from giflib 4.1 in 4.2)

imlib has the same problem. see 486372 for example patch
Comment 2 Anton Kochkov 2013-12-08 12:23:58 UTC
Created attachment 364928 [details, diff]
magicpoint-giflib.patch

Here is the patch, fixing this bug.
Comment 3 Attila Tóth 2014-07-22 08:13:05 UTC
Bug confirmed.
Attached patch fixes the problem.
Thanks.
Please include it in portage.
Comment 4 Anton Kochkov 2015-01-15 15:52:30 UTC
Any chance to push this patch in the tree, so giflib would be stabilized?
Comment 5 Pacho Ramos gentoo-dev 2015-05-23 08:56:57 UTC
*** Bug 539428 has been marked as a duplicate of this bug. ***
Comment 6 Pacho Ramos gentoo-dev 2015-10-26 15:28:58 UTC
This is one of the last consumers of old imlib... do we really need this in the tree?
Comment 7 Peter Stuge 2016-01-11 00:25:58 UTC
(In reply to Pacho Ramos from comment #6)
> This is one of the last consumers of old imlib... do we really need this in
> the tree?

I would like to be able to continue using it. I'm talking with idella4 about proxy-maintaining it.
Comment 8 Peter Stuge 2016-01-12 02:25:46 UTC
Created attachment 422606 [details]
magicpoint-1.13a_p20121015.ebuild
Comment 9 Peter Stuge 2016-01-12 02:30:49 UTC
Lots of fun here.

ESR in his wisdom removed the PrintGifError() function from the public giflib API in giflib-4.2.0.

Instead, GifErrorString() was added, which has different semantics.

I propose to fix this bug *and* make Pacho happy at the same time by bumping app-office/magicpoint to the latest snapshot version, 20121015. There are later snapshots but nothing has changed since then.

I have attached magicpoint-1.13a_p20121015.ebuild which depends on imlib2 instead of old imlib with USE=imlib and which with USE="-imlib gif" depends on >=giflib-4.2.0 and uses sed to patch image/gif.c to use the newer API.

image/gif.c and image/png.c are #ifdef:ed out when imlib is used, so libpng is no longer a dependency with USE=imlib.

I also added RESTRICT_USE="imlib? ( !gif )"
Comment 10 Peter Stuge 2016-01-12 02:45:12 UTC
Created attachment 422608 [details]
magicpoint-1.13a_p20121015.ebuild

Add IUSE=png to model dependencies more accurately.
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2016-01-12 11:38:27 UTC
The review. This is mostly content carried over from the magicpoint-1.13a.ebuild.

1. 1999-2011 -> 1999-2016
2. EAPI=4    -> EAPI=5 and any required adjustments.
3. MY_DEPEND.
No idea who came up with that name. More commonly, use COMMON_DEPEND
4. ${S} & REQUIRED_USE typically follow dependencies but this is purely style. You can leave them as they are and not be wrong.

It appears you've not run repoman full but if you had it would have prompted over
png? ( >=media-libs/libpng-1.4 ) requiring a slot operator.

5. OPTIONAL. First two patches MIGHT go into var PATCHES prior to src_prepare().
Sometimes the order of execution messes things up, so they could stay as they are.

6. use doc && dodoc FAQ... should go
7. Use of pushd/popd is a populat option over `cd` to a folder
8. samples probably belong in /usr/share/doc/${PF}/sample  or make a folder examples and set with use examples, possibly with just doins -r.
9. mgp2html.pl,mgp2latex.pl are perl scripts meaning you need dep on dev-lang/perl
Comment 12 Ian Delaney (RETIRED) gentoo-dev 2016-01-12 11:42:24 UTC
Also, on runtesting, it does build and install. There is a non fatal qa warning concerning [-Wimplicit-function-declaration]

With the items in previous Comment addressed, this should then be about ready.
Comment 13 Peter Stuge 2016-01-12 17:17:15 UTC
Created attachment 422710 [details, diff]
magicpoint-1.13a_p20121015-draw-charset.patch

This fixes a bug in upstream code which noticed by a GCC warning.
Comment 14 Peter Stuge 2016-01-12 17:19:03 UTC
Created attachment 422712 [details, diff]
magicpoint-1.13a_p20121015-draw-stringtoolong.patch

This patch fixes an upstream bug causing mgp to hang with 100% CPU load when a string on a slide was too long to fit inside the presentation window. Now mgp exits with an error instead.
Comment 15 Peter Stuge 2016-01-12 17:20:12 UTC
Created attachment 422714 [details, diff]
magicpoint-1.13a_p20121015-implicit-declaration.patch

This patch tries to fix all implicit declaration compiler warnings.
Comment 16 Peter Stuge 2016-01-12 17:23:14 UTC
Created attachment 422718 [details, diff]
magicpoint-1.13a_p20121015-any-giflib.patch

This patch contains the actual fix for this bug; the upstream code is adapted to make it build successfully and work correctly with any version of giflib currently available in the gentoo tree, as well as with any older versions.

Since giflib has a history of breaking API and ABI without changing soname this might need to be extended further in the future, but on the other hand I don't expect the giflib API to change further in these areas. As of 5.1.0 the API is finally thread-safe everywhere.
Comment 17 Peter Stuge 2016-01-12 17:24:47 UTC
Created attachment 422720 [details, diff]
magicpoint-1.13a_p20121015-gif-dimension.patch

This patch fixes an upstream bug where an error message format string was used without passing data that matched the format, potentially causing an access to uninitialized memory at runtime.
Comment 18 Peter Stuge 2016-01-12 17:26:13 UTC
Created attachment 422722 [details]
magicpoint-1.13a_p20121015.ebuild

This is an updated ebuild which applies the attached patches as neccessary, includes fixes for all feedback by Ian in comment#12 and works for me.
Comment 19 Peter Stuge 2016-01-12 18:27:05 UTC
Created attachment 422726 [details, diff]
magicpoint-1.13a_p20121015-parse-empty.patch

Do not crash on .mgp files without any pages.
Comment 20 Peter Stuge 2016-01-12 18:27:45 UTC
Created attachment 422728 [details]
magicpoint-1.13a_p20121015.ebuild

Updated ebuild which also applies parse-empty.patch.
Comment 21 Ian Delaney (RETIRED) gentoo-dev 2016-01-13 01:25:19 UTC
Very good effort. A couple of fine points to finish off

1. I'd add a  # Comment to qualify the opening sed statement in src_prepare.
2. pushd contrib requires on of the following options
a) pushd contrib > /dev/null || die
b) pushd contrib > /dev/null || die "nice $msg"
c) pushd contrib || die +- "nice $msg"

All are acceptable and appease repoman. (I'd go for c))

Then I shall add it albeit masked. The unmasking we shall handle separately
Comment 22 Peter Stuge 2016-01-13 04:36:02 UTC
Created attachment 422748 [details]
magicpoint-1.13a_p20121015.ebuild

Updated ebuild with || die on all pushd lines
Comment 23 Peter Stuge 2016-01-13 04:42:33 UTC
Created attachment 422750 [details]
magicpoint-1.13a_p20121015.ebuild

Add a comment describing that sed is used to put the snapshot date into the version string.
Comment 24 Ian Delaney (RETIRED) gentoo-dev 2016-01-13 05:08:41 UTC
commit 4330b52986b655353b9aa63d7479537a9beee9f1
Author: Ian Delaney <idella4@gentoo.org>
Date:   Wed Jan 13 13:04:28 2016 +0800

    app-office/magicpoint: bump to vn. 1.13a_p20121015, a snapshot
    
    ebuild prepared, with support, by user Peter Stuge, now entered as the
    proxy maintainer under the proxy-maintainers herd in metadata.
    Also new use flag 'contrib' added to metadata,
    ebuild and patches submitted all vua the gentoo bug, though the package
    remains pmasked for removal. Yet to be negotiated with pertinent devs
    
    Gentoo bug: #486248
Comment 25 Attila Tóth 2016-01-15 20:28:47 UTC
Fails to build because of underlinking:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: m17n.o: undefined reference to symbol 'FcPatternGetString'
/usr/lib64/libfontconfig.so.1: error adding symbols: DSO missing from command line

-lfontconfig is missing, adding it solves the problem

x86_64-pc-linux-gnu-gcc -o mgp -O2 -march=native -pipe     -Wl,-O1 -Wl,--as-needed -L/usr/lib64   mgp.o draw.o parse.o plist.o globals.o x11.o font.o background.o      scanner.o grammar.o postscript.o tfont.o embed.o unimap.o mng.o m17n.o strlcpy.o strlcat.o     -L./image -lmgpimage -lm  -lpng16 -L/usr/lib -lpng -L/usr/lib -lmng -L/usr/lib/X11 -lXft -lgif -L/usr/lib64 -lm17n-core -lm17n -lm17n-flt -lm17n-gui -lm17n-core  -lXext -lX11 -lfontconfig
Comment 26 Peter Stuge 2016-01-15 20:55:06 UTC
(In reply to Attila Tóth from comment #25)
> Fails to build because of underlinking:
> /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: m17n.o: undefined reference to symbol 'FcPatternGetString'
> /usr/lib64/libfontconfig.so.1: error adding symbols: DSO missing from
> command line
> 
> -lfontconfig is missing, adding it solves the problem

Thanks a lot for testing! I didn't look into m17n. :( fontconfig is actually not hard required, but is used if fontconfig.h is found. I'll go over the configure script tonight and upload an updated ebuild. I will not revbump it (-p1) since there is no difference in what gets installed.
Comment 27 Pacho Ramos gentoo-dev 2016-01-16 10:08:44 UTC
unmasked and dropped the old version, for the pending bugs please use a separate bug

Thanks
Comment 28 Peter Stuge 2016-01-23 03:53:00 UTC
(In reply to Pacho Ramos from comment #27)
> for the pending bugs please use a separate bug

I've opened https://bugs.gentoo.org/show_bug.cgi?id=572658
with a new patch and a new ebuild attached.
Comment 29 Ian Delaney (RETIRED) gentoo-dev 2016-01-28 15:27:38 UTC
commit 4330b52986b655353b9aa63d7479537a9beee9f1
Author: Ian Delaney <idella4@gentoo.org>
Date:   Wed Jan 13 13:04:28 2016 +0800

    app-office/magicpoint: bump to vn. 1.13a_p20121015, a snapshot
    
    ebuild prepared, with support, by user Peter Stuge, now entered as the
    proxy maintainer under the proxy-maintainers herd in metadata.
    Also new use flag 'contrib' added to metadata,
    ebuild and patches submitted all vua the gentoo bug, though the package
    remains pmasked for removal. Yet to be negotiated with pertinent devs
    
    Gentoo bug: #486248