Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487138 - media-libs/freetype-2.5.0.1: png detection should use pkg-config rather than libpng-config
Summary: media-libs/freetype-2.5.0.1: png detection should use pkg-config rather than ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ben de Groot (RETIRED)
URL:
Whiteboard:
Keywords:
: 502114 (view as bug list)
Depends on: 487740 487696
Blocks:
  Show dependency tree
 
Reported: 2013-10-06 17:46 UTC by Johannes Hirte
Modified: 2014-03-21 11:38 UTC (History)
8 users (show)

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


Attachments
build-x86.log (build-x86.log,103.01 KB, text/x-log)
2013-10-06 17:48 UTC, Johannes Hirte
Details
freetype-2.5.0.1-libpng-pkg-config.patch (freetype-2.5.0.1-libpng-pkg-config.patch,1.29 KB, patch)
2013-10-09 06:37 UTC, Alexandre Rostovtsev (RETIRED)
Details | Diff
Suggested patch (freetype-2.5.1.ebuild.diff,2.29 KB, patch)
2013-12-08 12:04 UTC, Michał Górny
Details | Diff
Complete patched ebuild (freetype-2.5.1.ebuild,4.70 KB, text/plain)
2013-12-08 12:05 UTC, Michał Górny
Details
freetype-2.5.0.1.patch (freetype-2.5.0.1.patch,2.24 KB, patch)
2014-01-25 14:52 UTC, James Le Cuirot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Hirte 2013-10-06 17:46:14 UTC
Emerge of =media-libs/freetype-2.5.0.1 fails with linkage error:

libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC  /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftsystem.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftdebug.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftinit.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbase.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbbox.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbdf.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbitmap.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftcid.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftfstype.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgasp.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftglyph.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgxval.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftlcdfil.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftmm.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftotval.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftpatent.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftpfr.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftstroke.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftsynth.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/fttype1.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftwinfnt.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftxf86.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/truetype.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type1.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/cff.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type1cid.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pfr.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type42.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/winfnt.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pcf.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/bdf.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/sfnt.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/autofit.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pshinter.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/raster.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/smooth.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftcache.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/gxvalid.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgzip.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftlzw.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbzip2.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/otvalid.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/psaux.o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/psnames.o   -Wl,--as-needed -lz -lbz2 -L/usr/lib64 -lpng16  -m32 -Wl,-O1 -march=amdfam10   -Wl,-soname -Wl,libfreetype.so.6 -o /var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/libfreetype.so.6.10.2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: /lib64/libz.so.1: incompatible target
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: /lib64/libbz2.so.1: incompatible target
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping incompatible /usr/lib64/libpng16.so while searching for png16
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping incompatible /usr/lib64/libc.so while searching for c
collect2: error: ld returned 1 exit status
make: *** [/var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/libfreetype.la] Error 1
 * ERROR: media-libs/freetype-2.5.0.1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/freetype-2.5.0.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/freetype-2.5.0.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/freetype-2.5.0.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/freetype-2.5.0.1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86'
 * S: '/var/tmp/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1'

The x86 build gets the wrong linker flags.

Reproducible: Always




emerge --info

Portage 2.2.7 (default/linux/amd64, gcc-4.7.3, glibc-2.17, 3.12.0-rc3-00351-ge62063d x86_64)
=================================================================
System uname: Linux-3.12.0-rc3-00351-ge62063d-x86_64-AMD_A6-3650_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.2
KiB Mem:     7643668 total,   5922096 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of tree: Sun, 06 Oct 2013 17:00:01 +0000
ld GNU gold (GNU Binutils 2.23.2) 1.11
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/cmake:           2.8.11.2::kde
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.6.4, 4.7.3-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo x11 kde local
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10 AdobeFlash-10.1 AdobeFlash-10.3 AdobeFlash-11.x dlj-1.1 Google-TOS google-chrome skype-eula skype-4.0.0.7-copyright THINKTANKS"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=amdfam10 -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -ftracer -fvect-cost-model -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=amdfam10 -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -ftracer -fvect-cost-model -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer news parallel-fetch preserve-libs sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage/layman/kde /usr/local/portage"
USE="X a52 aac acl addressbook aften aio alsa amd64 amr apng assistant attica audiofile autotools berkdb bluetooth bogofilter bzip2 cairo calendar canberra caps caps-ng cdda cddb chm cli cmake consolekit corefonts cracklib crypt cups cvs cxx dbus declarative demosaic desktopglobe device-mapper dirac djvu dri dts dv dvd ebook eigen embedded encode epub exif expoblending faac faad fam ffmpeg fftw flac flickr fontconfig fortran fpx gbm gdbm gif git gles1 gles2 glew gmp google gphoto2 gpm graphicsmagick graphviz gs gsl hdri highlight iconv icu id3tag inotify ipv6 jemalloc jpeg jpeg2k kate kde kdepim kipi kpathsea lame latex lcms lensfun libffi libkms liblockfile libnotify libsamplerate lm_sensors lzma lzo mad marble midi minizip mjpeg mmap mmx mmxext mng modules mount mp3 mp4 mpeg mtp mudflap multilib musicbrainz mysql ncurses nfsidmap nfsv3 nls nptl ogg okteta openal openctl openexr opengl openmp opus oscar otr pam panorama pcre pdf pdfimport perl plasma png policykit postscript pyqt4 python python3 qt3support qt4 qthelp quicktime raptor raw readline redeyes rle romio samba scanner schroedinger sdl semantic-desktop session sftp sndfile soundtouch spell sqlite sqlite3 sse sse2 sse3 ssl subversion svg system-cairo system-icu system-jpeg system-sqlite taglib tcpd theora threads thumbnail tiff timidity truetype twolame udev udis86 unicode usb uuid v4l valgrind vamp vdpau vlc vorbis vpx webkit webp wmf x264 xattr xcb xcomposite xetex xml xmp xpm xscreensaver xv xvfb xvid yaz zip zlib" ABI_X86="64 32" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita plan sheets stage tables words" CAMERAS="canon ptp2 ricoh ricoh_g3" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20" SANE_BACKENDS="net" USERLAND="GNU" VIDEO_CARDS="r600 radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Johannes Hirte 2013-10-06 17:48:20 UTC
Created attachment 360262 [details]
build-x86.log
Comment 2 Martin Jansa 2013-10-08 12:43:45 UTC
I can confirm the same when building with ABI_X86="32 64 -x32", 32bit build is trying to use wrong libz, libbz2, libpng16 and libc

libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC  /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftsystem.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftdebug.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftinit.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbase.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbbox.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbdf.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbitmap.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftcid.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftfstype.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgasp.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftglyph.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgxval.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftlcdfil.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftmm.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftotval.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftpatent.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftpfr.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftstroke.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftsynth.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/fttype1.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftwinfnt.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftxf86.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/truetype.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type1.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/cff.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type1cid.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pfr.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/type42.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/winfnt.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pcf.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/bdf.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/sfnt.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/autofit.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/pshinter.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/raster.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/smooth.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftcache.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/gxvalid.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftgzip.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftlzw.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/ftbzip2.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/otvalid.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/psaux.o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/psnames.o   -lz -lbz2 -L/usr/lib64 -lpng16  -m32   -Wl,-soname -Wl,libfreetype.so.6 -o /tmp/tmpfs/portage/media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/.libs/libfreetype.so.6.10.2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/../../../../x86_64-pc-linux-gnu/bin/ld: error: /lib64/libz.so.1: incompatible target
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/../../../../x86_64-pc-linux-gnu/bin/ld: error: /lib64/libbz2.so.1: incompatible target
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping incompatible /usr/lib64/libpng16.so while searching for png16
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping incompatible /usr/lib64/libc.so while searching for c
collect2: error: ld returned 1 exit status
Comment 3 Richard Grenville 2013-10-08 13:13:50 UTC
A temporary workaround is to comment out the `L_opts="-L${libdir}"` line in /usr/bin/libpng-config . The `-L/usr/lib64` it outputs is causing ld to search in the wrong place. Not sure about the correct fix.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-08 19:16:59 UTC
I can't reproduce this and it looks weird to me ;/. Even though '-L/usr/lib64' is undesired here, the linker should still use the 32-bit libraries -- at least it does that in my case.

Do you have all those libraries in /usr/lib32? 'ls /lib32/libz* /usr/lib32/libz*', please.
Comment 5 Martin Jansa 2013-10-08 19:25:56 UTC
> Do you have all those libraries in /usr/lib32? 'ls /lib32/libz* /usr/lib32/libz*', please.

I do:

lrwxrwxrwx 1 root root   15 Jul 30 11:06 /lib32/libbz2.so.1 -> libbz2.so.1.0.6
lrwxrwxrwx 1 root root   15 Jul 30 11:06 /lib32/libbz2.so.1.0 -> libbz2.so.1.0.6
-rwxr-xr-x 1 root root  81K Jul 30 11:07 /lib32/libbz2.so.1.0.6
lrwxrwxrwx 1 root root   12 Jun 17 08:45 /lib32/libc.so.6 -> libc-2.17.so
lrwxrwxrwx 1 root root   13 Jul 30 11:10 /lib32/libz.so.1 -> libz.so.1.2.8
-rwxr-xr-x 1 root root  98K Jul 30 11:10 /lib32/libz.so.1.2.8
-rw-r--r-- 1 root root  88K Jul 30 11:07 /usr/lib32/libbz2.a
-rwxr-xr-x 1 root root  495 Jul 30 11:06 /usr/lib32/libbz2.so
-rw-r--r-- 1 root root 3.6M Jun 17 08:46 /usr/lib32/libc.a
-rwxr-xr-x 1 root root  244 Jun 17 08:44 /usr/lib32/libc.so
-rw-r--r-- 1 root root 302K Sep 17 21:45 /usr/lib32/libpng16.a
lrwxrwxrwx 1 root root   18 Sep 17 21:45 /usr/lib32/libpng16.so -> libpng16.so.16.6.0
lrwxrwxrwx 1 root root   18 Sep 17 21:45 /usr/lib32/libpng16.so.16 -> libpng16.so.16.6.0
-rwxr-xr-x 1 root root 251K Sep 17 21:45 /usr/lib32/libpng16.so.16.6.0
-rwxr-xr-x 1 root root  493 Jul 30 11:10 /usr/lib32/libz.so

and I can confirm that after removing -L/usr/lib64 from
media-libs/freetype-2.5.0.1/work/freetype-2.5.0.1-x86/unix-cc.mk:LDFLAGS := -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -lz -lbz2 -L/usr/lib64 -lpng16

I was able to finish building freetype (with ebuild /usr/portage/media-libs/freetype/freetype-2.5.0.1.ebuild merge)
Comment 6 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-10-09 01:26:25 UTC
Confirming same here on two different machines :/


Portage 2.2.7 (default/linux/amd64/13.0/desktop/gnome, gcc-4.8.1, glibc-2.17, 3.10.14 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.14-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    32924240 total,   1259028 free
KiB Swap:   33552380 total,  33552380 free
Timestamp of tree: Wed, 09 Oct 2013 01:00:01 +0000
ld GNU gold (GNU Binutils 2.23.2) 1.11
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.8-r3, 2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/ccache:          3.1.9-r2
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.2
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            3.3.6-r1, 4.6.4, 4.7.3-r1, 4.8.1-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo auto_portage lisp sunrise local
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-av --with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1"
MAKEOPTS="-j8 V=1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/auto-portage /usr/portage/local/layman/lisp /usr/portage/local/layman/sunrise /usr/local/portage"
USE="X a52 aac acl acpi adns alsa amd64 avx berkdb bluetooth branding bzip2 cairo caps cdda cddb cdr cjk cli colord cracklib crypt cups cxx dbus development djvu dri dts dvd dvdr eds emboss encode evo exif fam fftw firefox flac fortran gdbm geoip gif gmp gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk hscolour iconv idn introspection ipv6 jpeg lcms ldap libnotify libsecret mad mmx mng modules mp3 mp4 mpeg mudflap multilib musicbrainz nautilus ncurses networkmanager nls nptl offensive ogg opengl openmp opus pam pango pcre pdf png policykit postscript ppds pulseaudio qt3support qt4 readline sdl semantic-desktop session socialweb socks5 sound spell sqlite sse sse2 ssl ssse3 startup-notification svg systemd tcpd threads tiff truetype udev udisks unicode upnp upnp-av upower usb vdpau vim-syntax vorbis wxwidgets x264 xattr xcb xinerama xml xv xvid zeitgeist zlib" ABI_X86="64" ALSA_CARDS="hda-intel intel8x0" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info lapack log_config logio mem_cache mime mime_magic negotiation proxy proxy_http proxy_scgi reqtimeout rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev joystick keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver" LINGUAS="en en_US ru ru_RU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2 python3_3" QEMU_SOFTMMU_TARGETS="arm armeb i386 x86_64" QEMU_USER_TARGETS="arm armeb i386 x86_64" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="*" USERLAND="GNU" VIDEO_CARDS="nv nvidia v4l vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.2 3.3"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC

=================================================================
                        Package Settings
=================================================================

media-libs/freetype-2.4.12 was built with the following:
USE="X adobe-cff bzip2 infinality utils -auto-hinter -bindist -debug -doc -fontforge -static-libs" ABI_X86="32 64 -x32"
CFLAGS="-march=native -O2 -pipe -fno-strict-aliasing"
CXXFLAGS="-march=native -O2 -pipe -fno-strict-aliasing"


media-libs/libpng-1.2.50-r1 was built with the following:
USE="" ABI_X86="32 64 -x32"
CFLAGS="-march=native -O2 -pipe -ggdb"
CXXFLAGS="-march=native -O2 -pipe -ggdb"


media-libs/libpng-1.6.6 was built with the following:
USE="apng (-neon) -static-libs" ABI_X86="32 64 -x32"
CFLAGS="-march=native -O2 -pipe -ggdb"
CXXFLAGS="-march=native -O2 -pipe -ggdb"
Comment 7 Richard Grenville 2013-10-09 02:10:46 UTC
Strangely enough, the issue occurs on my home computer but not on my work one, although my configuration on the two systems are very similar. The last command executed (x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC ...) is almost identical to Johannes's, and there is -L/usr/lib64 inside, yet the problem simply doesn't exist on my work computer.
Comment 8 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-10-09 05:32:51 UTC
Probably the best solution would be to use pkg-config instead of libpng-config (and why is a package released in 2013 still relying on libpng-config?)
Comment 9 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-10-09 06:37:04 UTC
Created attachment 360458 [details, diff]
freetype-2.5.0.1-libpng-pkg-config.patch

Note: freetype has one of the most idiosyncratic build systems I've seen (it really, really doesn't fit in with our eautoreconf paradigm), so I am also including the necessary ebuild diff below:

diff -u -r1.2 freetype-2.5.0.1.ebuild
--- freetype-2.5.0.1.ebuild	6 Oct 2013 05:07:31 -0000	1.2
+++ freetype-2.5.0.1.ebuild	9 Oct 2013 06:35:06 -0000
@@ -82,6 +82,15 @@
 
 	epatch "${FILESDIR}"/${PN}-2.4.12-clean-include.patch # 482172
 
+	epatch "${FILESDIR}"/${PN}-2.5.0.1-libpng-pkg-config.patch # 487138
+
+	pushd builds/unix > /dev/null
+	# Warning: full eautoreconf breaks the build!
+	eaclocal
+	eautoconf
+	S=${PWD} elibtoolize --force
+	popd > /dev/null
+
 	if use utils; then
 		cd "${WORKDIR}/ft2demos-${MY_PV}" || die
 		# Disable tests needing X11 when USE="-X". (bug #177597
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-09 12:50:23 UTC
(In reply to Alexandre Rostovtsev from comment #8)
> Probably the best solution would be to use pkg-config instead of
> libpng-config (and why is a package released in 2013 still relying on
> libpng-config?)

To be honest, I'd prefer going the easier way and just hacking libpng-config not to output -L for standard system paths (that's what pkg-config does by default).

The pkg-config use patch should go upstream. But I'd still prefer to know why -L/usr/lib64 breaks it for some people and for some it works fine. It looks like there's some deeper issue beneath all this.
Comment 11 Richard Grenville 2013-10-11 13:17:13 UTC
I took two nights debugging the issue, but apparently I should have checked whether /usr/lib64/libz.so is a ELF file firstly... Well, it's a linker script!

----
/* GNU ld script
   Since Gentoo has critical dynamic libraries in /lib, and the static versions
   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
   run into linking problems.  This "fake" dynamic lib is a linker script that
   redirects the linker to the real lib.  And yes, this works in the cross-
   compiling scenario as the sysroot-ed linker will prepend the real path.

   See bug http://bugs.gentoo.org/4411 for more info.
 */

GROUP ( /lib64/libz.so.1 )
----

According to my results of tracing ld.gold, it will reject incompatible libraries automatically, as a warning, and search using alternative paths, but it doesn't reject a script file that points to an incompatible library. It pushes the linker script to the work queue, parses it later and pushes the absolute path /lib64/libz.so.1 to the work queue, and when ld.gold discovers the library with an absolute path is incompatible, it's treated as a fatal error. So with my almost-zero knowledge about ELF and the linker, it doesn't seem entirely unreasonable for ld.gold to break when it encounters such crazy things.

But, why doesn't the issue occur on certain computers?
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2013-10-11 13:36:39 UTC
(In reply to Richard Grenville from comment #11)
> But, why doesn't the issue occur on certain computers?


How about system not having

/lib -> /lib64/
Comment 13 Johannes Hirte 2013-10-11 14:53:38 UTC
(In reply to Justin Lecher from comment #12)
> (In reply to Richard Grenville from comment #11)
> > But, why doesn't the issue occur on certain computers?
> 
> 
> How about system not having
> 
> /lib -> /lib64/

No, can't confirm this. Two systems have the problem, one not and all have the /lib -> /lib64/ symlink.
Comment 14 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-10-11 16:56:51 UTC
(In reply to Richard Grenville from comment #11)
> According to my results of tracing ld.gold [...]

Note: I am getting the same build failure both with ld.gold and ld.bfd
Comment 15 Jonathan Callen (RETIRED) gentoo-dev 2013-10-11 17:46:04 UTC
It appears that using ld.bfd to build zlib is suffient (currently) for gen_usr_ldscript() to create a .so linker script that includes a line like "OUTPUT_FORMAT ( elf64-x86-64 )", which would probably be enough for ld.gold to realize that this script won't work.  Unfortunately, the method used to find what to put in that line does not work when the linker is ld.gold.

If you rebuild zlib with ld.bfd first, then try building freetype (with either linker), it should work.
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-11 20:19:00 UTC
Thanks for finding this out. So the underlying issue would be gen_usr_ldscript() not writing OUTPUT_FORMAT with ld.gold, am I correct?
Comment 17 Jonathan Callen (RETIRED) gentoo-dev 2013-10-11 20:20:44 UTC
(In reply to Michał Górny from comment #16)
> Thanks for finding this out. So the underlying issue would be
> gen_usr_ldscript() not writing OUTPUT_FORMAT with ld.gold, am I correct?

Yes.  Specifically, the issue is that with ld.gold, `${CC} ${CFLAGS} ${LDFLAGS} -Wl,--verbose` does not output the full linker script used like ld.bfd does.
Comment 18 SpanKY gentoo-dev 2013-10-12 21:35:42 UTC
we've updated the ldscript logic, so re-emerging zlib should probably make this work.  however, freetype is broken.

the configure script should be using pkg-config to look up libpng info, not `libpng-config`.
Comment 19 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 21:40:41 UTC
While at it, we may deploy a QA warning for using 'libpng-config' then. Most likely via a 'libpng-config' QA-wrapper in portage.
Comment 20 Paul Thompson 2013-11-07 21:14:52 UTC
I re-emerged zlib-1.2.8-r1, and the freetype-2.5.0.1 build still fails, trying to link the 64bit libs for the 32bit build as described by others here. Using ld.gold or ld.bfd.
Comment 21 SpanKY gentoo-dev 2013-11-21 21:54:37 UTC
(In reply to Michał Górny from comment #19)

i wonder if we could have some automatic logic.  like when it detects a package that installs a xxx-config script and a corresponding xxx.pc file.  libpng is common, but by no means the only (ncurses readily comes to mind).
Comment 22 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-22 05:03:21 UTC
(In reply to SpanKY from comment #21)
> (In reply to Michał Górny from comment #19)
> 
> i wonder if we could have some automatic logic.  like when it detects a
> package that installs a xxx-config script and a corresponding xxx.pc file. 
> libpng is common, but by no means the only (ncurses readily comes to mind).

Hmm, I think it would be possible to handle the most common case. We could make portage implicitly install a wrapper to /usr/lib/portage/bin as part of postinst cleanup.
Comment 23 Justin Lecher (RETIRED) gentoo-dev 2013-12-06 19:24:24 UTC
Can we get a solution here please.
Comment 24 Ben de Groot (RETIRED) gentoo-dev 2013-12-07 10:36:55 UTC
It's my understanding that the consensus is that we should apply the patches from comment #9. Any objections?
Comment 25 Justin Lecher (RETIRED) gentoo-dev 2013-12-07 13:35:56 UTC
(In reply to Ben de Groot from comment #24)
> It's my understanding that the consensus is that we should apply the patches
> from comment #9. Any objections?

Just tried it and it works fine.
Comment 26 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-08 11:28:50 UTC
I think that maintaining a build system patch that requires partial autoreconf in a package that fails with a full autoreconf is far from optimal. I'll try to wrap up a patch that will allow us to achieve the same via existing configure arguments.
Comment 27 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-08 12:04:43 UTC
Created attachment 364922 [details, diff]
Suggested patch

I hope it didn't become too unreadable but I switched to the newer (easier) API since configure arguments may differ per ABI.

This version passes the results of calling pkg-config as LIBPNG_{CFLAGS,LDFLAGS} like build system expects. This avoids autoreconf and IMO is the easiest way forward until upstream decides to fix it (like it's going to happen...).
Comment 28 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-08 12:05:02 UTC
Created attachment 364924 [details]
Complete patched ebuild

For comparison, the complete ebuild.
Comment 29 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-08 12:05:43 UTC
Note: I forgot to add toolchain-funcs inherit.
Comment 30 SpanKY gentoo-dev 2013-12-09 00:39:20 UTC
(In reply to Michał Górny from comment #27)

passing LIBPNG flags via the configure line looks like a reasonable stop gap until upstream sorts things out
Comment 31 SpanKY gentoo-dev 2013-12-09 00:39:39 UTC
removing toolchain since there's nothing that needs fixing on our side
Comment 32 Ben de Groot (RETIRED) gentoo-dev 2014-01-20 12:44:13 UTC
(In reply to Michał Górny from comment #28)
> Created attachment 364924 [details]
> Complete patched ebuild
> 
> For comparison, the complete ebuild.

Committed as freetype-2.5.2-r1.

If someone wants to make a diff for 2.5.0.1, I'd be happy to commit that as well.
Comment 33 James Le Cuirot gentoo-dev 2014-01-25 14:52:56 UTC
Created attachment 368694 [details, diff]
freetype-2.5.0.1.patch

Here you go, Ben. I needed this to cross-build for arm and 2.5.2 is masked. Tested with amd64[32,64] as well.
Comment 34 James Le Cuirot gentoo-dev 2014-03-02 19:35:11 UTC
Please, Ben? It would really help me if my above patch could be committed and you did ask for it.
Comment 35 Alex Xu (Hello71) 2014-03-08 01:08:05 UTC
*** Bug 502114 has been marked as a duplicate of this bug. ***
Comment 36 Ben de Groot (RETIRED) gentoo-dev 2014-03-21 11:38:06 UTC
(In reply to James Le Cuirot from comment #34)
> Please, Ben? It would really help me if my above patch could be committed
> and you did ask for it.

I'm sorry. I've been really busy lately, so I haven't come around it. But with 2.5.3-r1 now unmasked and going stable, I don't think we need this anymore.