Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246733 - media-gfx/imagemagick- has undefined references
Summary: media-gfx/imagemagick- has undefined references
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Graphics Project
Depends on:
Blocks: 246757
  Show dependency tree
Reported: 2008-11-14 14:54 UTC by Robert Wohlrab
Modified: 2009-02-08 21:27 UTC (History)
0 users

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

Patch to add "-lperl @MATH_LIBS@" to PerlMagick/ (imagemagick-link-perl-lib.patch,525 bytes, patch)
2009-01-01 21:13 UTC, Kevin Pyle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Wohlrab 2008-11-14 14:54:56 UTC
I checked the package for undefined reference and got undefined reference. For
testing purposes LDFLAGS in /etc/make.conf was changed to
 LDFLAGS="${LDFLAGS} -Wl,-z,-defs -Wl,--no-undefined"
The reported problem is in most cases a upstream problem - please report it
upstream if it is so. Please use the man page to find the needed library. For
example dlsym would need '-ldl' ( or cosf need '-lm' (

Current results are following:
x86_64-pc-linux-gnu-gcc  -L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -shared -L/usr/local/lib64 -Wl,-O1 -Wl,-z,-defs -Wl,--no-undefined Magick.o  -o blib/arch/auto/Image/Magick/ 	\
	   -L/usr/lib64 -L/var/tmp/portage/media-gfx/imagemagick- -lMagickCore -L/var/tmp/portage/media-gfx/imagemagick- -lMagickWand  	\

Magick.o: In function `boot_Image__Magick':
Magick.c:(.text+0x61): undefined reference to `PL_stack_sp'
Magick.c:(.text+0x68): undefined reference to `PL_stack_base'
Magick.c:(.text+0x72): undefined reference to `PL_markstack_ptr'
Magick.c:(.text+0x132): undefined reference to `Perl_croak'
Magick.c:(.text+0x156): undefined reference to `Perl_newXS'
Magick.c:(.text+0x165): undefined reference to `Perl_sv_setpv'
Magick.c:(.text+0x17f): undefined reference to `Perl_newXS'{}
Magick.o: In function `XS_Image__Magick_UNLOAD':
Magick.c:(.text+0x27ed1): undefined reference to `PL_markstack_ptr'
Magick.c:(.text+0x27ed8): undefined reference to `PL_stack_sp'
Magick.c:(.text+0x27ef0): undefined reference to `PL_stack_base'
Magick.c:(.text+0x27f2e): undefined reference to `Perl_croak'
collect2: ld returned 1 exit status
make[2]: *** [blib/arch/auto/Image/Magick/] Error 1
make[2]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-'
make[1]: *** [all-perl] Error 2
make[1]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-'
make: *** [all] Error 2

Portage 2.2_rc14 (default/linux/amd64/2008.0, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.26-1-amd64 x86_64)
System uname: Linux-2.6.26-1-amd64-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-glibc2.2.5
Timestamp of tree: Fri, 14 Nov 2008 12:07:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r8
dev-util/cmake:      2.6.1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0-r1
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -pipe"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
FEATURES="distlocks parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,-z,-defs -Wl,--no-undefined"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm iconv ipv6 isdnlog midi minimal mmx mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl sse sse2 ssl sysfs tcpd unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Comment 1 Markus Meier gentoo-dev 2008-11-15 08:36:34 UTC
please post the USE-flags you used for imagemagick (emrege -pv imagemagick).
Comment 2 Robert Wohlrab 2008-11-15 08:52:42 UTC
media-gfx/imagemagick-  USE="bzip2 corefonts openmp perl zlib -X -djvu -doc -fontconfig -fpx -graphviz -gs -hdri -jbig -jpeg -jpeg2k -lcms -nocxx -openexr -png -q32 -q8 -raw -svg -tiff -truetype -wmf -xml"
Comment 3 Kevin Pyle 2009-01-01 21:13:27 UTC
Created attachment 177034 [details, diff]
Patch to add "-lperl @MATH_LIBS@" to PerlMagick/

Magick.o fails to link due to two missing libraries: libperl, and libm.  libm is needed to satisfy references to cos, fmod, sin, sqrt, tan.  The imagemagick configure script already probes for whether sqrt is found in libm and sets MATH_LIBS to '' if not, or '-lm' if so.  Thus, to handle systems where the math functions are part of libc, this patch uses @MATH_LIBS@.

With this patch applied, I can build media-gfx/imagemagick- with  LDFLAGS="-Wl,--as-needed,-O1,-z,defs,--no-undefined,--warn-once".  Without it, I see a build failure like the one reported in comment #0.
Comment 4 Markus Meier gentoo-dev 2009-01-03 11:58:27 UTC
(In reply to comment #3)

thanks for your investigation and patch - I reported this upstream, see the URL field.
Comment 5 Markus Meier gentoo-dev 2009-02-08 21:27:45 UTC
should be fixed with media-gfx/imagemagick-
please reopen if this should still be an issue.