Opened 14 years ago

Closed 12 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: no Analyzed by developer: no

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@… 14 years ago.
Quick-n-dirty fix for my config.h
config.h (32.7 KB ) - added by bugzilla.mplayerhq.hu@… 14 years ago.
The generated config.h, which doesn't work
configure.log (116.1 KB ) - added by bugzilla.mplayerhq.hu@… 14 years ago.
configure.log

Download all attachments as: .zip

Change History (10)

by bugzilla.mplayerhq.hu@…, 14 years ago

Attachment: fix-config.patch added

Quick-n-dirty fix for my config.h

comment:1 by bugzilla.mplayerhq.hu@…, 14 years ago

by bugzilla.mplayerhq.hu@…, 14 years ago

Attachment: config.h added

The generated config.h, which doesn't work

comment:2 by bugzilla.mplayerhq.hu@…, 14 years ago

by bugzilla.mplayerhq.hu@…, 14 years ago

Attachment: configure.log added

configure.log

comment:3 by bugzilla.mplayerhq.hu@…, 14 years ago

comment:4 by diego@…, 14 years ago

attachments.ispatch: 01
attachments.mimetype: application/octet-streamtext/plain

comment:5 by diego@…, 14 years ago

attachments.mimetype: application/octet-streamtext/plain

comment:6 by diego@…, 14 years ago

attachments.mimetype: application/octet-streamtext/plain

comment:7 by diego@…, 12 years ago

rep_platform: PC (x86_64)PC (x86)
Resolution: wontfix
Status: newclosed

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.