News:

--

Main Menu

Fedora Rawhide 2.7.6 build failure

Started by hobbes1069, August 03, 2020, 01:52:13 PM

Previous topic - Next topic

hobbes1069

While trying to rebuild avidemux from RPM Fusion I'm now getting a compile error with the builtin ffmpeg:


/usr/bin/ld: /tmp/libADM6postproc.so.55.PucAE9.ltrans0.ltrans.o: warning: relocation against `w04' in read-only section `.text'
/usr/bin/ld: /tmp/libADM6postproc.so.55.PucAE9.ltrans0.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `w05' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
gmake[3]: *** [/builddir/build/BUILD/avidemux_2.7.6/x86_64-redhat-linux-gnu/ffmpeg/source/ffbuild/library.mak:103: libpostproc/libADM6postproc.so.55] Error 1


I've noticed for years that the builtin ffmpeg doesn't respect the build flags passed to avidemux CMake but it hasn't been a problem until today. I poked around the source but I can't find exactly how/where ffmpeg gets built. I tried looking for "external_project..." which would be the typical method of building an external project within CMake.

Tips?

Thanks,
Richard

eumagga0x2a

Indeed, whatever is passed as value of CMAKE_C_FLAGS on cmake command line doesn't survive till it is consumed by ADM_FF_SET_EXTRA_FLAGS from cmake/admFFmpegBuild_helpers.cmake. If it helps, you can pass arbitrary options to ffmpeg configure as FF_FLAGS like e.g.

%cmake3 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
       -DVERBOSE=1 \
       -DFF_FLAGS="--extra-cflags=\"-fPIC -fstack-reuse=all\"" \
       ../avidemux_core


Regarding the linker error, I wonder whether dropping

export LDFLAGS="-lc -Wl,--as-needed"

from the spec file might help. Regarding advice to add -fPIC, config.mak from build_core/ffmpeg/build/ffbuild/ at least on Fedora 32 confirms that -fPIC is present in CFLAGS.

FFmpeg build is triggered by inclusion of admFFmpegBuild in avidemux_core/CMakeLists.txt, which in turn includes admFFmpegBuild_native with the most stuff coming from admFFmpegUtil.cmake and admFFmpegBuild_helpers.cmake.