Opened 15 years ago
Closed 13 years ago
#1695 closed defect (wontfix)
Cannot compile with gcc's -flto CFLAGS
Reported by: | Owned by: | ||
---|---|---|---|
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)
Change History (10)
by , 15 years ago
Attachment: | fix-config.patch added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
comment:3 by , 15 years ago
comment:4 by , 15 years ago
attachments.ispatch: | 0 → 1 |
---|---|
attachments.mimetype: | application/octet-stream → text/plain |
comment:5 by , 15 years ago
attachments.mimetype: | application/octet-stream → text/plain |
---|
comment:6 by , 15 years ago
attachments.mimetype: | application/octet-stream → text/plain |
---|
comment:7 by , 13 years ago
rep_platform: | PC (x86_64) → PC (x86) |
---|---|
Resolution: | → wontfix |
Status: | new → 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.
Quick-n-dirty fix for my config.h