Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650460 - media-libs/avidemux-core-2.7.0 fails to build with -flto: relocation R_X86_64_PC32 against undefined symbol `bF8' can not be used when making a shared object; recompile with -fPIC
Summary: media-libs/avidemux-core-2.7.0 fails to build with -flto: relocation R_X86_64...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2018-03-14 02:46 UTC by Alexander Miller
Modified: 2023-07-05 12:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
avidemux-core-2.7.0-bundled-ffmpeg-lto-fix.patch (avidemux-core-2.7.0-lto-workaround-ffmpeg.patch,937 bytes, patch)
2018-03-14 02:46 UTC, Alexander Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Miller 2018-03-14 02:46:31 UTC
Created attachment 523838 [details, diff]
avidemux-core-2.7.0-bundled-ffmpeg-lto-fix.patch

With LTO the build of media-libs/avidemux-core-2.7.0 fails when linking the libraries of the bundled ffmpeg. Here are the errors from the build log:

LD      libpostproc/libADM6postproc.so.54
LD      libavcodec/libADM6avcodec.so.57
LD      libswscale/libADM6swscale.so.4
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/portage/media-libs/avidemux-core-2.7.0/temp/ccgANYtl.ltrans1.ltrans.o: warning: relocation against `pb_03' in readonly section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/portage/media-libs/avidemux-core-2.7.0/temp/ccgANYtl.ltrans6.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `bF8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
gmake[3]: *** [/tmp/portage/media-libs/avidemux-core-2.7.0/work/avidemux-core-2.7.0_build/ffmpeg/source/library.mak:94: libswscale/libADM6swscale.so.4] Error 1
gmake[3]: *** Waiting for unfinished jobs....
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/portage/media-libs/avidemux-core-2.7.0/temp/cca1w2es.ltrans29.ltrans.o: warning: relocation against `pd_1' in readonly section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/portage/media-libs/avidemux-core-2.7.0/temp/cca1w2es.ltrans7.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
gmake[3]: *** [/tmp/portage/media-libs/avidemux-core-2.7.0/work/avidemux-core-2.7.0_build/ffmpeg/source/library.mak:94: libavcodec/libADM6avcodec.so.57] Error 1
gmake[3]: Leaving directory '/tmp/portage/media-libs/avidemux-core-2.7.0/work/avidemux-core-2.7.0_build/ffmpeg/build'
make[2]: *** [CMakeFiles/libavutil_dummy.dir/build.make:61: CMakeFiles/libavutil_dummy] Error 2
make[2]: Leaving directory '/tmp/portage/media-libs/avidemux-core-2.7.0/work/avidemux-core-2.7.0_build'
make[1]: *** [CMakeFiles/Makefile2:71: CMakeFiles/libavutil_dummy.dir/all] Error 2
make[1]: Leaving directory '/tmp/portage/media-libs/avidemux-core-2.7.0/work/avidemux-core-2.7.0_build'
make: *** [Makefile:133: all] Error 2
 * ERROR: media-libs/avidemux-core-2.7.0::gentoo failed (compile phase):
 *   emake failed

These errors are due to using direct symbol references in inline asm (which are not visible to the compiler). Disabling those direct symbol refs in the bundled ffmpeg's configure fixes the build. The attached patch accomplishes this by creating a patch which is applied by avidemux-core's build system to the bundled ffmpeg sources.
Comment 1 Kostadin Shishmanov 2023-07-05 12:00:10 UTC
Can't reproduce this with media-libs/avidemux-core-2.8.1-r1 and gcc (Gentoo 13.1.1_p20230527 p3) 13.1.1 20230527