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

Bug 398023

Summary: media-libs/devil-1.7.8 fails to build with media-libs/libjpeg-turbo-1.1.90: il_bmp.c:(.text+0x70): multiple definition of `ilFloatToHalfOverflow'
Product: Gentoo Linux Reporter: Piotr Szymaniak <bugzie>
Component: [OLD] GamesAssignee: Gentoo Games <games>
Status: RESOLVED FIXED    
Severity: normal CC: anarchy, dcommander, graphics+disabled, skunk, ssuominen, tetromino
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build.log
This one seems to work for me.

Description Piotr Szymaniak 2012-01-07 13:42:48 UTC
emerge --info
Portage 2.2.0_alpha84 (default/linux/x86/10.0/desktop, gcc-4.6.2, glibc-2.13-r4, 3.2.0 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.2.0-i686-Pentium-R-_Dual-Core_CPU_E5400_@_2.70GHz-with-gentoo-2.1
Timestamp of tree: Fri, 06 Jan 2012 16:30:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 3.1.6 [disabled]
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/ccache:          3.1.6
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.7
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.11.2
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo multimedia x11 sunrise mgorny roslin gamerlay-stable
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.ift.uni.wroc.pl/"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl"
MAKEOPTS="-j3"
PKGDIR="/home/p/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/multimedia /var/lib/layman/x11 /var/lib/layman/sunrise /var/lib/layman/mgorny /home/lazy_bum/uberlay/roslin /home/lazy_bum/uberlay/gamerlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa bash-completion bzip2 cairo cdda cdr cli consolekit cracklib crypt cups custom-cflags custom-cxxflags cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gdu gif gpm gtk iconv ipv6 jabber jpeg lcms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pppd qt3support qt4 readline sdl session spell sse sse2 ssl ssse3 svg sysfs tcpd tiff truetype udev unicode usb vim-syntax vorbis x264 x86 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog cpu cpufreq disk hddtemp network uptime users" 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" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" 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


emerge -pqv
[ebuild  N    ] media-libs/devil-1.7.8  USE="X gif jpeg lcms mng opengl png sdl tiff -allegro -openexr -static-libs -xpm"

Reproducible: Always
Comment 1 Piotr Szymaniak 2012-01-07 13:43:41 UTC
Created attachment 298227 [details]
Build.log
Comment 2 Piotr Szymaniak 2012-01-07 14:54:04 UTC
PS Someone got the same issue already on forums.g.o. → http://forums.gentoo.org/viewtopic-p-6922340.html
Comment 3 Rafał Mużyło 2012-01-07 22:12:19 UTC
Well, as said on the forum, this seems to be "the package fails to build with >=gcc:4.3".
If that's the case, '-fgnu89-inline' might be a valid workaround.
Given when that one was released/stabilized, it should give you a hint about the status of media-libs/devil.
Comment 4 Tom Macdonald 2012-01-09 21:19:44 UTC
I tried "CFLAGS="-O2 -pipe -march=native -fgnu89-inline" emerge -a1v devil" and it failed as well.
Comment 5 Rafał Mużyło 2012-01-10 11:20:14 UTC
There seems to be something odd here - I've just tested the lib and it builds just fine on x86 with same libtool/gcc/binutils/glibc as in the original report (OK, no autoreconf, so libtool doesn't mater, but the rest stands).
Comment 6 NemesisSOAD 2012-01-10 11:25:04 UTC
I confirm the bug is reproducible with a flag + jpeg.
Sorry for bad English.
Comment 7 Dawid Olwinski 2012-01-11 15:17:05 UTC
Hi. I wrote that post on the forum. Removing jpeg flag indeed lets devIL compile without bug but render it useless for me.
Comment 8 Rafał Mużyło 2012-01-11 22:33:37 UTC
(In reply to comment #7)
> Hi. I wrote that post on the forum. Removing jpeg flag indeed lets devIL
> compile without bug but render it useless for me.

What useflags did you you built devil with ?
It may or may not matter, but which package virtual/jpeg does resolves to (it's media-libs/jpeg-8c here) ?
Comment 9 Piotr Szymaniak 2012-01-11 23:14:56 UTC
(In reply to comment #8)
> It may or may not matter, but which package virtual/jpeg does resolves to?

For me it's media-libs/libjpeg-turbo
Comment 10 Dawid Olwinski 2012-01-12 16:00:14 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Hi. I wrote that post on the forum. Removing jpeg flag indeed lets devIL
> > compile without bug but render it useless for me.
> 
> What useflags did you you built devil with ?
> It may or may not matter, but which package virtual/jpeg does resolves to (it's
> media-libs/jpeg-8c here) ?

Hello. These are my flags for devil. It compiles with -jpeg.
[ebuild   R    ] media-libs/devil-1.7.8  USE="X gif mng opengl png sdl tiff xpm -allegro -jpeg -lcms -openexr -static-libs" 0 kB

Library used is also media-libs/libjpeg-turbo.
Comment 11 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-23 18:49:08 UTC
media-libs/devil-1.7.8 with USE="X gif jpeg lcms mng opengl png sdl tiff -allegro -openexr -static-libs -xpm" builds with media-libs/libjpeg-turbo-1.1.1, but fails as described by other reporters with media-libs/libjpeg-turbo-1.1.90.
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2012-01-23 19:29:08 UTC
I can build it with USE="jpeg" using the following:

CFLAGS="-DNOINLINE" emerge -av devil

Still trying to figure out where the conflict is though
Comment 13 Rafał Mużyło 2012-01-25 22:22:42 UTC
(In reply to comment #12)
> I can build it with USE="jpeg" using the following:
> 
> CFLAGS="-DNOINLINE" emerge -av devil
> 
> Still trying to figure out where the conflict is though

I think I may see the reason: does CFLAGS="-DINLINE=inline" work too ?
Comment 14 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-25 22:42:39 UTC
(In reply to comment #13)
> does CFLAGS="-DINLINE=inline" work too ?

No. CFLAGS="-DNOINLINE" works, but CFLAGS="-DINLINE=inline" fails with

.libs/libIL_la-il_doom.o: In function `iSwapUShort':
il_doom.c:(.text+0x0): multiple definition of `iSwapUShort'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x0): first defined here
.libs/libIL_la-il_doom.o: In function `iSwapShort':
il_doom.c:(.text+0x2f): multiple definition of `iSwapShort'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x2f): first defined here
.libs/libIL_la-il_doom.o: In function `iSwapUInt':
il_doom.c:(.text+0x49): multiple definition of `iSwapUInt'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x49): first defined here
.libs/libIL_la-il_doom.o: In function `iSwapInt':
il_doom.c:(.text+0x8f): multiple definition of `iSwapInt'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x8f): first defined here
[...]
.libs/libIL_la-il_mp3.o: In function `SaveBigInt':
il_mp3.c:(.text+0x5a1): multiple definition of `SaveBigInt'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x5a1): first defined here
.libs/libIL_la-il_mp3.o: In function `SaveBigFloat':
il_mp3.c:(.text+0x5d7): multiple definition of `SaveBigFloat'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x5d7): first defined here
.libs/libIL_la-il_mp3.o: In function `SaveBigDouble':
il_mp3.c:(.text+0x60f): multiple definition of `SaveBigDouble'
.libs/libIL_la-il_alloc.o:il_alloc.c:(.text+0x60f): first defined here
collect2: ld returned 1 exit status
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2012-01-26 08:14:13 UTC
I reported this to the libjpeg-turbo upstream since this is fine with libjpeg-turbo-1.1.1, jpeg-6b, jpeg-8b, jpeg-8c but not with libjpeg-turbo-1.1.90 here:

sf.net project libjpeg-turbo, Ticket, 3479995, "DevIl (openil) 1.7.8 fails to build with jpeg-turbo-1.1.90"

https://sourceforge.net/tracker/?group_id=303195&atid=1278158

https://sourceforge.net/tracker/?func=detail&aid=3479995&group_id=303195&atid=1278158
Comment 16 DRC 2012-01-26 08:23:52 UTC
Hi, guys.  The error you're seeing doesn't seem to have anything to do with libjpeg-turbo, i.e. those aren't our symbols that are being multiply defined.  Thus, I have no clue as to why libjpeg-turbo 1.1.90 would make any difference vs. 1.1.1.  The libjpeg API has not changed since 1.1.1.  Most of the functional changes in the 1.2 release have to do with the higher-level TurboJPEG API.  All of the other changes since 1.1.1 should be "behind the scenes."
Comment 17 Rafał Mużyło 2012-01-26 12:29:25 UTC
Well, my idea was that it's an inherited flaw:
in devil-1.7.8/include/IL/devil_internal_exports.h there's:
#ifndef INLINE
#if defined(__GNUC__)
#define INLINE extern inline
#elif defined(_MSC_VER)
#define NOINLINE
#define INLINE __inline
#else
#define INLINE inline
#endif
#endif
jpeg-turbo defines INLINE too (a flaw inherited from jpeg config.h abuse).
Comment 14 seems to suggest that I might have a point, but my guess at a solution is wrong.
Comment 18 Samuli Suominen (RETIRED) gentoo-dev 2012-01-26 12:45:13 UTC
(In reply to comment #17)
> Well, my idea was that it's an inherited flaw:
> in devil-1.7.8/include/IL/devil_internal_exports.h there's:
[ .. ]
> jpeg-turbo defines INLINE too (a flaw inherited from jpeg config.h abuse).
> Comment 14 seems to suggest that I might have a point, but my guess at a
> solution is wrong.

I came up with that -DNOINLINE from src-IL/include/il_manip.h, line 28, to skip the entire block of code where these are defined.

(In reply to comment #16)
> Hi, guys.  The error you're seeing doesn't seem to have anything to do with
> libjpeg-turbo, i.e. those aren't our symbols that are being multiply defined. 
> Thus, I have no clue as to why libjpeg-turbo 1.1.90 would make any difference
> vs. 1.1.1.  The libjpeg API has not changed since 1.1.1.  Most of the
> functional changes in the 1.2 release have to do with the higher-level
> TurboJPEG API.  All of the other changes since 1.1.1 should be "behind the
> scenes."

I didn't mean to sound like we are blaming libjpeg-turbo, but fact is that DevIl is /accidentally/ inheriting something from libjpeg-turbo, that is new in version 1.1.90 which will result in this error which at first doesn't look jpeg related at all.   I was hoping you could take a look :-)
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2012-01-26 12:56:28 UTC
Created attachment 299961 [details, diff]
This one seems to work for me.
Comment 20 DRC 2012-01-26 21:48:14 UTC
(In reply to comment #17)
> jpeg-turbo defines INLINE too (a flaw inherited from jpeg config.h abuse).
> Comment 14 seems to suggest that I might have a point, but my guess at a
> solution is wrong.

You're right.  This was added because, in 1.2, we inline the C color conversion routines for improved performance on non-SIMD platforms.  Since the INLINE macro is used only internally to libjpeg-turbo, I think it's probably a bug that it is defined in jconfig.h.  It probably should just be defined in config.h.
Comment 21 DRC 2012-01-26 22:21:48 UTC
Should now be fixed in libjpeg-turbo trunk.
Comment 22 Samuli Suominen (RETIRED) gentoo-dev 2012-01-27 15:22:45 UTC
(In reply to comment #21)
> Should now be fixed in libjpeg-turbo trunk.

awesome, I tried to make a svn diff based on r731 between r739 (iirc) from libjpeg-turbo trunk to get a patch for the issue but it pulled a lot of unrelated changes too

what would you recommend, pulling a snapshot from trunk and call it 1.1.90_p20120127 or is there any chance of rolling a 1.1.91 for the issue?
Comment 23 DRC 2012-01-27 20:54:10 UTC
The unrelated changes you're referring to are the addition of alpha-channel-specific colorspace constants, which are necessary to fix another Gentoo-reported bug:

https://bugs.gentoo.org/show_bug.cgi?id=393471

There won't be a 1.1.91.  1.2.0 is ready to go, pending resolution of the above issue and this one.
Comment 24 Samuli Suominen (RETIRED) gentoo-dev 2012-01-27 23:05:27 UTC
(In reply to comment #23)
> There won't be a 1.1.91.  

OK no problem

> 1.2.0 is ready to go, pending resolution of the above issue and this one.

awesome

meanwhile I've committed 1.1.90_p20120128 to resolve this bug, closing

Thanks everyone