Emerging (4 of 50) media-libs/x264-0.0.20130912 * x264-snapshot-20130912-2245.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking x264-snapshot-20130912-2245.tar.bz2 to /var/tmp/portage/media-libs/x264-0.0.20130912/work >>> Source unpacked in /var/tmp/portage/media-libs/x264-0.0.20130912/work >>> Preparing source in /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245 ... * Applying x264-cflags.patch ... [ ok ] >>> Source prepared. >>> Configuring source in /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245 ... * amd64: running multilib-minimal_abi_src_configure endian test failed * ERROR: media-libs/x264-0.0.20130912::gentoo failed (configure phase): * (no error message) Reproducible: Always Portage 2.2.8 (default/linux/amd64/13.0/no-multilib, gcc-4.9.0-alpha20140110, glibc-2.17, 3.12.6-gentoo x86_64) ================================================================= System uname: Linux-3.12.6-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.2 KiB Mem: 8170356 total, 1211048 free KiB Swap: 8396796 total, 8358624 free Timestamp of tree: Fri, 10 Jan 2014 15:30:01 +0000 ld GNU ld (GNU Binutils) 2.24.51.20140109 app-shells/bash: 4.2_p45-r1 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.6, 3.2.5-r3, 3.3.3 dev-util/cmake: 2.8.12.1-r2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6, 1.12.6, 1.14.1 sys-devel/binutils: 2.24.51 sys-devel/gcc: 4.8.2, 4.9.0_alpha20140110 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.12 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /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 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--quiet-build=n" 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 splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox usersync xattr" FFLAGS="-O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin" GENTOO_MIRRORS="ftp://gentoo.mirror.web4u.cz/" LANG="cs_CZ.UTF-8" LDFLAGS="-Wl,--as-needed -Wl,-O2 -Wl,-flto=4 -flto=4 -fuse-linker-plugin -O2 -ggdb -pipe -march=native -mtune=native" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="echo" 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="" USE="X a52 aac acl alsa amd64 berkdb blas bluetooth branding bzip2 cairo caps cdda cddb cdparanoia cdr cli cracklib crypt cvs cxx dbus djvu dri dts dv dvb dvd dvdr encode exif fam ffmpeg fftw flac fontconfig fortran ftp gd gdbm geoip gif gmp gnuplot gps graphviz gsl gsm gstreamer gtk hdf5 iconv icu idn ieee1394 imagemagick imlib ipv6 ithreads javascript jbig jpeg jpeg2k kde ladspa lame lapack lcms ldap libass libsamplerate lzma lzo mad matroska mms mmx mmxext mng modplug modules mp3 mp4 mpeg mplayer msn mtp mudflap musepack musicbrainz ncurses netcdf nls nptl ocaml ocamlopt odbc ogg openexr opengl openmp pam pcre pdf perl plotutils png policykit postscript pulseaudio python qt4 quicktime rdesktop readline ruby samba scanner semantic-desktop session slang smp sndfile sox speex spell sse sse2 ssl ssse3 svg szip tcpd theora threads tidy tiff truetype udev unicode usb v4l vcd vdpau vnc vorbis wavpack wmf wxwidgets x264 xattr xcb xft xine xinerama xml xosd xpm xscreensaver xv xvid xvmc zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 adc65 agfa_cl20 aox ax203 barbie canon casio_qv clicksmart310 digigr8 digita dimagev dimera3500 directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 jl2005a jl2005c kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150 largan lg_gsm mars mustek panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859 pccam300 pccam600 pentax polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ricoh ricoh_g3 samsung sierra sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 st2205 stv0674 stv0680 sx330z topfield toshiba_pdrm11 tp6801" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FFTOOLS="aviocat cws2fws ffescape ffeval fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher ffhash" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 navcom nmea ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf superstar2 tnt tripmate tsip ubx fury geostar nmea2000" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer scripting-beanshell scripting-javascript nlpsolver" LINGUAS="cs en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 arm i386" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19 ruby20 ruby21" 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" USE_PYTHON="2.7 3.2 3.3" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Please attach your config.log to this bug report.
Here it is: checking whether __ILP32__ is true... no -------------------------------------------------- conftest.c:2:2: error: #error #error ^ -------------------------------------------------- Failed program was: -------------------------------------------------- #if !(__ILP32__) #error #endif -------------------------------------------------- x264 configure script Command line options: "--prefix=/usr" "--libdir=/usr/lib64" "--disable-cli" "--disable-avs" "--disable-lavf" "--disable-swscale" "--disable-ffms" "--disable-gpac" "--enable-pi checking whether x86_64-pc-linux-gnu-gcc works... yes checking whether x86_64-pc-linux-gnu-gcc supports for( int i = 0; i < 9; i++ ); with -std=gnu99... yes checking whether yasm supports vpmovzxwd ymm0, xmm0... yes checking whether x86_64-pc-linux-gnu-gcc supports __asm__("pabsw %xmm0, %xmm0");... yes checking for -mpreferred-stack-boundary=5... yes DIED: endian test failed
This is most likely caused by the x32 patch in the ebuild.
...or the CFLAGS patch.
After I deleted lib32/pkgconfig & co folders owned by not yet re-emerged packages (to -multilib) it rebuilt correctly.
I am sorry, it did not rebuilt correctly. It fails the same way as before. I mixed it with before failing libjpegturbo (which I found is -flto problem).
When the patch is removed the only difference is that config.log not begins with #if !(__ILP32__) #error #endif The rest is the same. When I ran this by hand it not writes anything to output and .o file is created. echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c gcc -O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin conftest.c -c -o conftest.o /root/conftest.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped 0000000000000001 C __gnu_lto_slim 0000000000000001 C __gnu_lto_v1 Without -flto: /root/conftest.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped 0000000000000000 D f 0000000000000010 D i And my final sorry, without -flto -fuse-linker-plugin it compiles fine. Next time I will try to do deeper research before opening a case here. Until authors will count with LTO this have to be built without LTO. Would you like to submit filtering cflags or have I to close this as invalid?
Created attachment 380064 [details, diff] x264-lto.patch Looks like the problem is the assumption that the object file generated by 'gcc -c' will contain the binary representation of the code. This will be true for non-LTO builds or for LTO with -ffat-lto-objects. Since fat objects are disabled starting with GCC 4.9 the grep command is unable to find the expected binary data in the object file, which contains only GIMPLE. There could be several ways to fix this. The attached patch modifies the test to produce a shared object instead of a plain object. This will invoke the linker and is guaranteed to produce a binary object regardless of the used CFLAGS.
yeah, I have the same error with gcc-4.9 and lto
Created attachment 414492 [details, diff] x264-0.0.20151011-lto.patch Compiling without LTO or patching is still needed for x264-0.0-20151010
is this still valid with x264-0.0.20160712?
(In reply to Pacho Ramos from comment #11) > is this still valid with x264-0.0.20160712? That is what I get as an error: [ebuild R ] media-libs/x264-0.0.20160712:0/148::gentoo USE="interlaced threads -10bit -opencl -pic -static-libs" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB >>> Verifying ebuild manifests >>> Emerging (1 of 1) media-libs/x264-0.0.20160712::gentoo * x264-snapshot-20160712-2245.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking x264-snapshot-20160712-2245.tar.bz2 to /tmp/portage/media-libs/x264-0.0.20160712/work >>> Source unpacked in /tmp/portage/media-libs/x264-0.0.20160712/work >>> Preparing source in /tmp/portage/media-libs/x264-0.0.20160712/work/x264-snapshot-20160712-2245 ... >>> Source prepared. >>> Configuring source in /tmp/portage/media-libs/x264-0.0.20160712/work/x264-snapshot-20160712-2245 ... * abi_x86_64.amd64: running multilib-minimal_abi_src_configure endian test failed * ERROR: media-libs/x264-0.0.20160712::gentoo failed (configure phase): * (no error message) * * Call stack: * ebuild.sh, line 115: Called src_configure * environment, line 2951: Called multilib-minimal_src_configure * environment, line 2128: Called multilib_foreach_abi 'multilib-minimal_abi_src_configure' * environment, line 2342: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure' * environment, line 2058: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure' * environment, line 2056: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure' * environment, line 449: Called multilib-minimal_abi_src_configure * environment, line 2122: Called multilib_src_configure * environment, line 2561: Called die * The specific snippet of code: * "${S}/configure" --prefix="${EPREFIX}"/usr --libdir="${EPREFIX}"/usr/$(get_libdir) --disable-cli --disable-avs --disable-lavf --disable-swscale --disable-ffms --disable-gpac --enable-pic --enable-shared --host="${CHOST}" $(usex 10bit "--bit-depth=10" "") $(usex interlaced "" "--disable-interlaced") $(usex opencl "" "--disable-opencl") $(usex static-libs "--enable-static" "") $(usex threads "" "--disable-thread") ${asm_conf} || die * * If you need support, post the output of `emerge --info '=media-libs/x264-0.0.20160712::gentoo'`, * the complete build log and the output of `emerge -pqv '=media-libs/x264-0.0.20160712::gentoo'`. * The complete build log is located at '/var/log/portage/media-libs:x264-0.0.20160712:20170420-131231.log'. * For convenience, a symlink to the build log is located at '/tmp/portage/media-libs/x264-0.0.20160712/temp/build.log'. * The ebuild environment file is located at '/tmp/portage/media-libs/x264-0.0.20160712/temp/environment'. * Working directory: '/tmp/portage/media-libs/x264-0.0.20160712/work/x264-snapshot-20160712-2245-abi_x86_64.amd64' * S: '/tmp/portage/media-libs/x264-0.0.20160712/work/x264-snapshot-20160712-2245' >>> Failed to emerge media-libs/x264-0.0.20160712, Log file: I downloaded the x264-0.0.20151011-lto.patch inside /etc/portage/patches/media-libs/x264, but no luck. I don't even see that the patch is applied.
@Pacho Ramos Ok, I followed what is written in the [1]comments and now it applies the x264-0.0.20151011-lto.patch [1]http://dilfridge.blogspot.gr/2012/04/neat-trick-for-testing-patches-in.html post_src_unpack() { if type epatch_user >& /dev/null; then cd "${S}" epatch_user fi } .... >>> media-libs/x264-0.0.20160712 merged. So, it still works for x264. Should this patch be moved in to portage tree?
=media-libs/x264-0.0.20170701 has --enable-lto in its options. I will test it again shortly. And it seems that it is prepared to detect it, for "$debug" = "no": if [ "$lto" = "auto" ] && [ $compiler = GNU ] && cc_check "" "-flto" ; then lto="yes" CFLAGS="$CFLAGS -flto" LDFLAGS="$LDFLAGS -O3 -flto" fi
Issue with -flto . Should be set in USE flags? But using --enable-lto with -flto produce same error. It relies on configure to setup lto. Needs to be fixed in x264 code. This bug should be CONFIRMED.
Created attachment 523910 [details, diff] x264-0.0.20170701-lto.patch I've successfully used an even simpler patch for media-libs/x264-0.0.20170701. It adds just a "-fno-lto" to the problematic configure test.
Still applies for x264-0.0.20170701, and last patch made it working with clang and LTO.
I had not run into this before, but with the latest patch this problem now happens to me as well
problem happens again with media-libs/x264-0.0.20190214; same patch as 0.0.20170701 allows test to pass.
Can confirm that putting the patch in /etc/portage/patches/media-libs/x264 works on AMD64 with GCC 9.1.0 and x264-20190214.
(In reply to Alexander Miller from comment #16) > Created attachment 523910 [details, diff] [details, diff] > x264-0.0.20170701-lto.patch > > I've successfully used an even simpler patch for > media-libs/x264-0.0.20170701. It adds just a "-fno-lto" to the problematic > configure test. Can you also meanwhile send it to upstream and reference your pull-request or sent patch here? :)
Same issue happens with media-libs/x264-0.0.20190903 Same patch published here fixes it :)
Still happens with latest x264 version and toolchain on arm; can we get the workaround in the tree and poke upstream?
Created attachment 644640 [details, diff] Newer patch to fix LTO configure bug The buggy code in the configure file has been moved some row below.
The LTO problem is still present in x264-0.0.20190903-r1... and the old patch it's not working anymore, due to a change in configure file. I created a newer version of the patch :) x264-0.0.20190903-r1-lto.patch Iade Gesso, PhD (in Computer Science)
The change in the configure file is caused by Sergei's Strings patch, that you can find here https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4531c7dc10670235bb6ff4658eb05f6081d4e205 It also broke gentooLTO's patch. This poses a patch ordering issue. We will probably copy Iade's fix :P
*** Bug 695846 has been marked as a duplicate of this bug. ***
https://code.videolan.org/videolan/x264/-/commit/6bc7fe4f36ea95db77e6df6d76153dd5a2c770a0
This should be fixed in x264-0.0.20220222.