Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 535784 - media-libs/flac-1.3.1-r1 - ld: i386 architecture of input file `ia32/.libs/libFLAC-asm.a(cpu_asm.o)' is incompatible with i386:x64-32 output
Summary: media-libs/flac-1.3.1-r1 - ld: i386 architecture of input file `ia32/.libs/li...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Sound Team
URL: https://github.com/srcshelton/gentoo-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 11:15 UTC by Stuart Shelton
Modified: 2015-12-10 21:11 UTC (History)
3 users (show)

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


Attachments
emerge --info '=media-libs/flac-1.3.1-r1::gentoo' (emerge --info =media-libs:flac-1.3.1-r1.txt,16.46 KB, text/plain)
2015-01-06 12:17 UTC, Stuart Shelton
Details
flac-1.3.1-r1:20150106-110753.log.gz (flac-1.3.1-r1:20150106-110753.log.gz,16.25 KB, application/gzip)
2015-01-06 12:20 UTC, Stuart Shelton
Details
Detection of x32 build by predefined macros instead of compiler name (flac-1.3.1-x32.patch,1.44 KB, patch)
2015-12-09 10:28 UTC, Lukáš Ručka
Details | Diff
emerge --info =flac-1.3.1-r1::gentoo (einfo,6.57 KB, text/plain)
2015-12-10 20:52 UTC, Lukáš Ručka
Details
Log from failed build configuration, without my patch. (config.log,69.29 KB, text/plain)
2015-12-10 20:53 UTC, Lukáš Ručka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2015-01-06 11:15:02 UTC
libtool: link: (cd .libs/libFLAC-static.lax/libFLAC-asm.a && x86_64-pc-linux-gnux32-ar x "/var/tmp/portage/media-libs/flac-1.3.1-r1/work/flac-1.3.1-abi_x86_x32.x32/src/libFLAC/ia32/.libs/libFLAC-asm.a")
libtool: link: x86_64-pc-linux-gnux32-ar cru .libs/libFLAC-static.a .libs/bitmath.o .libs/bitreader.o .libs/bitwriter.o .libs/cpu.o .libs/crc.o .libs/fixed.o .libs/fixed_intrin_sse2.o .libs/fixed_intrin_ssse3.o .libs/float.o .libs/format.o .libs/lpc.o .libs/lpc_intrin_sse.o .libs/lpc_intrin_sse2.o .libs/lpc_intrin_sse41.o .libs/lpc_intrin_avx2.o .libs/md5.o .libs/memory.o .libs/metadata_iterators.o .libs/metadata_object.o .libs/stream_decoder.o .libs/stream_encoder.o .libs/stream_encoder_intrin_sse2.o .libs/stream_encoder_intrin_ssse3.o .libs/stream_encoder_intrin_avx2.o .libs/stream_encoder_framing.o .libs/window.o .libs/ogg_decoder_aspect.o .libs/ogg_encoder_aspect.o .libs/ogg_helper.o .libs/ogg_mapping.o   .libs/libFLAC-static.lax/libFLAC-asm.a/cpu_asm.o .libs/libFLAC-static.lax/libFLAC-asm.a/fixed_asm.o .libs/libFLAC-static.lax/libFLAC-asm.a/lpc_asm.o 
libtool: link: x86_64-pc-linux-gnux32-ranlib .libs/libFLAC-static.a
/usr/lib/gcc/x86_64-pc-linux-gnux32/4.8.3/../../../../x86_64-pc-linux-gnux32/bin/ld: i386 architecture of input file `ia32/.libs/libFLAC-asm.a(cpu_asm.o)' is incompatible with i386:x64-32 output
/usr/lib/gcc/x86_64-pc-linux-gnux32/4.8.3/../../../../x86_64-pc-linux-gnux32/bin/ld: i386 architecture of input file `ia32/.libs/libFLAC-asm.a(fixed_asm.o)' is incompatible with i386:x64-32 output
/usr/lib/gcc/x86_64-pc-linux-gnux32/4.8.3/../../../../x86_64-pc-linux-gnux32/bin/ld: i386 architecture of input file `ia32/.libs/libFLAC-asm.a(lpc_asm.o)' is incompatible with i386:x64-32 output
libtool: link: rm -fr .libs/libFLAC-static.lax
collect2: error: ld returned 1 exit status
Makefile:621: recipe for target 'libFLAC.la' failed
make[4]: *** [libFLAC.la] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: link: ( cd ".libs" && rm -f "libFLAC-static.la" && ln -s "../libFLAC-static.la" "libFLAC-static.la" )
make[4]: Leaving directory '/var/tmp/portage/media-libs/flac-1.3.1-r1/work/flac-1.3.1-abi_x86_x32.x32/src/libFLAC'
Makefile:739: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/media-libs/flac-1.3.1-r1/work/flac-1.3.1-abi_x86_x32.x32/src/libFLAC'
Makefile:415: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-libs/flac-1.3.1-r1/work/flac-1.3.1-abi_x86_x32.x32/src'
Makefile:472: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-libs/flac-1.3.1-r1/work/flac-1.3.1-abi_x86_x32.x32'
Makefile:403: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: media-libs/flac-1.3.1-r1::gentoo failed (compile phase):
 *   emake failed

... I notice that libFLAC's Makefile does contain `ld='... -m i386'` - but this may be related to the use of a multilib ebuild.

flac-1.3.0 builds correctly, even for this ABI.

emerge -pqv '=media-libs/flac-1.3.1-r1::gentoo':
[ebuild     U ] media-libs/flac-1.3.1-r1 [1.3.0] USE="cxx ogg sse (-altivec) -debug -static-libs (-3dnow%)" ABI_X86="(x32) (-32) -64" 

'emerge --info' to follow...
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-06 11:39:43 UTC
1) Please attach the entire build log to this bug report.
2) Please post your `emerge --info' output in a comment.
Comment 2 Stuart Shelton 2015-01-06 12:17:32 UTC
Created attachment 393312 [details]
emerge --info '=media-libs/flac-1.3.1-r1::gentoo'

emerge --info '=media-libs/flac-1.3.1-r1::gentoo' (too long to add as a comment)
Comment 3 Stuart Shelton 2015-01-06 12:20:10 UTC
Created attachment 393314 [details]
flac-1.3.1-r1:20150106-110753.log.gz

Build log
Comment 4 Stuart Shelton 2015-03-07 18:46:22 UTC
Fixed it.  The following patch fixes a bad assumption in configure.ac:

https://raw.githubusercontent.com/srcshelton/gentoo-ebuilds/master/media-libs/flac/files/flac-1.3.1-x32.patch

... and an updated ebuild applies it:

https://raw.githubusercontent.com/srcshelton/gentoo-ebuilds/master/media-libs/flac/flac-1.3.1-r1.ebuild
Comment 5 Stuart Shelton 2015-03-07 18:57:17 UTC
Reported upstream: https://sourceforge.net/p/flac/bugs/427/
Comment 6 Tiago Marques 2015-05-09 22:49:58 UTC
I'm having the same problem when trying to build my x32 system. Please merge the patch soon.

Is there a reason for this to still be marked as "unconfirmed"?
Comment 7 Lukáš Ručka 2015-12-09 10:28:38 UTC
Created attachment 418830 [details, diff]
Detection of x32 build by predefined macros instead of compiler name

The patch Stuart made did not work for me, as the host is not linux-gnux32 rather than linux-gnu. The patch enclosed uses macros described in http://sites.google.com/site/x32abi/documents/abi.pdf to recognize x32 build instead of target host alias.
Comment 8 Stuart Shelton 2015-12-10 11:03:02 UTC
(In reply to Lukáš Ručka from comment #7)
> The patch Stuart made did not work for me, as the host is not linux-gnux32
> rather than linux-gnu.

Searching for "chost gnux32" suggests that the correct CHOST value should be 'x86_64-pc-linux-gnux32' - is this incorrect or no longer the case?
Comment 9 Lukáš Ručka 2015-12-10 20:52:27 UTC
Created attachment 418948 [details]
emerge --info =flac-1.3.1-r1::gentoo

Fresh install, amd64 minimal cd with x32 stage3, after rebuilding the compiler & kernel.
Comment 10 Lukáš Ručka 2015-12-10 20:53:14 UTC
Created attachment 418950 [details]
Log from failed build configuration, without my patch.
Comment 11 Lukáš Ručka 2015-12-10 21:11:56 UTC
False alarm (last two attachments), I've missed patching again in the fresh install. After Stuart's last comment, I reexplored the failing build from yet another perspective and noticed that I had my original configuration partialy restored by git, including broken gcc and CHOST setting. As a result, the broken configuration emerged in the failure of the original patched build, couple of hundred packages later.

Please ignore the last two attachments, as I've forgotten to patch the flac in freshinstall with the original patch. I can confirm the original patch works and the error was on my side.