Opened 11 years ago

Closed 10 years ago

#2941 closed defect (fixed)

Impossible to compile with Graphite / LTO / OpenMP optimizations

Reported by: Decedion Owned by:
Priority: normal Component: build system
Version: git-master Keywords: gcc
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Ubuntu 13.04 64 bits

$ gcc -v
Usando especificaciones internas.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Objetivo: x86_64-linux-gnu
Configurado con: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Modelo de hilos: posix
gcc versión 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) 
$ apt-cache policy binutils-gold
binutils-gold:
  Instalados: 2.23.2-2ubuntu1
  Candidato:  2.23.2-2ubuntu1
  Tabla de versión:
 *** 2.23.2-2ubuntu1 0
        500 http://ubuntu.grn.cat/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status

$ ll /usr/bin/ld
lrwxrwxrwx 1 root root 7 abr 16 09:06 /usr/bin/ld -> ld.gold*

I have used this guide: http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

I'm trying to compile with Graphite/LTO/OpenMP optimizations but it shows errors in link phase:

.........
LD	ffmpeg_g
/tmp/ccA0STuu.ltrans0.ltrans.o:ccA0STuu.ltrans0.o:function decode_cabac_residual_nondc_internal.414259: error: undefined reference to 'ff_h264_cabac_tables'
/tmp/ccA0STuu.ltrans0.ltrans.o:ccA0STuu.ltrans0.o:function decode_cabac_residual_nondc_internal.414259: error: undefined reference to 'ff_h264_cabac_tables'
/tmp/ccA0STuu.ltrans0.ltrans.o:ccA0STuu.ltrans0.o:function decode_cabac_residual_nondc_internal.414259: error: undefined reference to 'ff_h264_cabac_tables'
/tmp/ccA0STuu.ltrans0.ltrans.o:ccA0STuu.ltrans0.o:function decode_cabac_residual_nondc_internal.414259: error: undefined reference to 'ff_h264_cabac_tables'
/tmp/ccA0STuu.ltrans1.ltrans.o:ccA0STuu.ltrans1.o:function put_cavs_qpel8_mc01_mmxext.680404: error: undefined reference to 'ff_pw_42'
/tmp/ccA0STuu.ltrans1.ltrans.o:ccA0STuu.ltrans1.o:function put_cavs_qpel8_mc01_mmxext.680404: error: undefined reference to 'ff_pw_42'
/tmp/ccA0STuu.ltrans1.ltrans.o:ccA0STuu.ltrans1.o:function put_cavs_qpel8_mc01_mmxext.680404: error: undefined reference to 'ff_pw_42'
/tmp/ccA0STuu.ltrans1.ltrans.o:ccA0STuu.ltrans1.o:function put_cavs_qpel8_mc01_mmxext.680404: error: undefined reference to 'ff_pw_42'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w04'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w04'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w05'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w20'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w04'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w04'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w05'
/tmp/ccA0STuu.ltrans3.ltrans.o:ccA0STuu.ltrans3.o:function postProcess_MMX.684606: error: undefined reference to 'w20'
/tmp/ccA0STuu.ltrans4.ltrans.o:ccA0STuu.ltrans4.o:function sad8_xy2_mmxext.627031: error: undefined reference to 'bone'
/tmp/ccA0STuu.ltrans4.ltrans.o:ccA0STuu.ltrans4.o:function sad16_xy2_mmxext.627059: error: undefined reference to 'bone'
.........

I've done several tests, all fail:

$ ./configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libspeex --enable-librtmp --disable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags="-L/usr/local/lib" --disable-debug --disable-ffplay --disable-ffprobe --disable-ffserver

Environment FLAGS:

CFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
CXXFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
LDFLAGS=-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -lgomp -m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w

$ ./configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libspeex --enable-librtmp --disable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags="-L/usr/local/lib" --disable-debug --disable-ffplay --disable-ffprobe --disable-ffserver --enable-lto

Without any environment FLAGS.

$ ./configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libspeex --enable-librtmp --disable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags="-L/usr/local/lib" --disable-debug --disable-ffplay --disable-ffprobe --disable-ffserver --enable-lto

Environment FLAGS:

CFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
CXXFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
LDFLAGS=-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -lgomp -m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w

$ ./configure --enable-lto

Environment FLAGS:

CFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
CXXFLAGS=-m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w
LDFLAGS=-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -lgomp -m64 -fPIC -pipe -march=native -mtune=native -Ofast -flto=9 -fuse-linker-plugin -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -funroll-loops -ftree-vectorize -fgraphite-identity -fopenmp -floop-parallelize-all -fivopts -w

$ ./configure --enable-lto

Without any environment FLAGS.

Attachments (10)

config.1.log (325.1 KB ) - added by Decedion 11 years ago.
make.1.log (63.0 KB ) - added by Decedion 11 years ago.
config.2.log (245.1 KB ) - added by Decedion 11 years ago.
make.2.log (198.7 KB ) - added by Decedion 11 years ago.
config.3.log (334.9 KB ) - added by Decedion 11 years ago.
make.3.log (63.0 KB ) - added by Decedion 11 years ago.
config.4.log (301.8 KB ) - added by Decedion 11 years ago.
make.4.log (79.6 KB ) - added by Decedion 11 years ago.
config.5.log (222.1 KB ) - added by Decedion 11 years ago.
make.5.log (372.0 KB ) - added by Decedion 11 years ago.

Change History (15)

by Decedion, 11 years ago

Attachment: config.1.log added

by Decedion, 11 years ago

Attachment: make.1.log added

by Decedion, 11 years ago

Attachment: config.2.log added

by Decedion, 11 years ago

Attachment: make.2.log added

by Decedion, 11 years ago

Attachment: config.3.log added

by Decedion, 11 years ago

Attachment: make.3.log added

by Decedion, 11 years ago

Attachment: config.4.log added

by Decedion, 11 years ago

Attachment: make.4.log added

by Decedion, 11 years ago

Attachment: config.5.log added

by Decedion, 11 years ago

Attachment: make.5.log added

in reply to:  description ; comment:1 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegundetermined
Reproduced by developer: set
Status: newopen

Replying to decedion:

$ ./configure --enable-lto

Without any environment FLAGS.

Workaround is to use $ ./configure --enable-lto --disable-inline-asm
Don't forget to do extensive performance testing before actually using such a binary!

I suspect you are on your own concerning the builds with environment variables set.

in reply to:  1 ; comment:2 by Decedion, 11 years ago

'Replying to cehoyos:

Workaround is to use $ ./configure --enable-lto --disable-inline-asm

Ok, it works. I have compiled it with my FLAGS and "--enable-lto --disable-inline-asm".

I suspect you are on your own concerning the builds with environment variables set.

I don't understand what do you mean.

comment:3 by Decedion, 11 years ago

It creates two executables: ffmpeg and ffmpeg_g. What is ffmpeg_g?

in reply to:  2 comment:4 by Carl Eugen Hoyos, 11 years ago

Replying to decedion:

Replying to cehoyos:

I suspect you are on your own concerning the builds with environment variables set.

I don't understand what do you mean.

The FFmpeg configure script should allow you to set all required options, if this does not work, please file an enhancement request. Afaict, you don't get support if you set environment variables and that makes your compile fail.

ffmpeg_g is the unstripped binary for debugging.

Allow me to repeat that I expect --enable-lto to have a negative impact on performance, at least for some use cases.

comment:5 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedbuild system
Keywords: gcc added
Resolution: fixed
Status: openclosed

Should be fixed in a64df19c

Note: See TracTickets for help on using tickets.