Opened 9 years ago

Closed 8 years ago

#1695 closed defect (wontfix)

Cannot compile with gcc's -flto CFLAGS

Reported by: bugzilla.mplayerhq.hu@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

I tried to compile mplayer with -flto but failed. After some digging, I found that config.h generated some warnings and the compilation choked a bit later. It seems that LTO messes with the "extern symbol prefix" detection during ./configure, and although I have no idea what I'm talking about, I found that patching the generated config.h would allow the compilation to complete successfully.

I don't know whether it's a GCC bug or something with MPlayer's build system. Please tell me if I have to file a bug with the GCC guys. Same if you need any information I neglected to post, thanks.

# gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1-pre9999/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.1-pre9999/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.1_pre9999/work/gcc-4.5.1-9999/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.1-pre9999 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1-pre9999/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1-pre9999 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1-pre9999/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.1-pre9999/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1-pre9999/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --disable-libmudflap --disable-libssp --disable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.1-pre9999/python --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo SVN' --enable-lto --disable-checking
Thread model: posix
gcc version 4.5.1-pre9999 20100506 (prerelease) rev. 159094 (Gentoo SVN)

Attachments (3)

fix-config.patch (445 bytes) - added by bugzilla.mplayerhq.hu@… 9 years ago.
Quick-n-dirty fix for my config.h
config.h (32.7 KB) - added by bugzilla.mplayerhq.hu@… 9 years ago.
The generated config.h, which doesn't work
configure.log (116.1 KB) - added by bugzilla.mplayerhq.hu@… 9 years ago.
configure.log

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by bugzilla.mplayerhq.hu@…

Quick-n-dirty fix for my config.h

comment:1 Changed 9 years ago by bugzilla.mplayerhq.hu@…

Changed 9 years ago by bugzilla.mplayerhq.hu@…

The generated config.h, which doesn't work

comment:2 Changed 9 years ago by bugzilla.mplayerhq.hu@…

Changed 9 years ago by bugzilla.mplayerhq.hu@…

configure.log

comment:3 Changed 9 years ago by bugzilla.mplayerhq.hu@…

comment:4 Changed 9 years ago by diego@…

  • attachments.ispatch changed from 0 to 1
  • attachments.mimetype changed from application/octet-stream to text/plain

comment:5 Changed 9 years ago by diego@…

  • attachments.mimetype changed from application/octet-stream to text/plain

comment:6 Changed 9 years ago by diego@…

  • attachments.mimetype changed from application/octet-stream to text/plain

comment:7 Changed 8 years ago by diego@…

  • rep_platform changed from PC (x86_64) to PC (x86)
  • Resolution set to wontfix
  • Status changed from new to closed

I just found a suitable workaround for configure, but mp3lib fails to compile with -flto and there are multiple linking errors regarding vf_fspp. If/when mp3lib is removed and somebody finds the time and motivation to address the linking errors this can be revisited.

The relevant configure change is just

-sym=$($_nm -P -g $TMPEXE)
+sym=$($_nm -P -g $TMPEXE | tail -n 1)

in the extern prefix check.

Note: See TracTickets for help on using tickets.