Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFMS2 can't be build because of relocation error #410

Closed
Josch600 opened this issue Feb 13, 2023 · 3 comments
Closed

FFMS2 can't be build because of relocation error #410

Josch600 opened this issue Feb 13, 2023 · 3 comments

Comments

@Josch600
Copy link

Hi,
on Ubuntu 22.04 I build ffmpeg using the following commands without error:

git clone https://git.videolan.org/git/ffmpeg.git
cd ffmpeg
./configure --prefix=$HOME/ffmpeg_build --enable-gpl --enable-version3 \
    --disable-doc --disable-debug --enable-pic --enable-avisynth && \
    make -j$(nproc) && \
    make install

Afterwards I tried to build ffms2 using these commands:

git clone https://github.com/ffms/ffms2 && \
cd ffms2
PKG_CONFIG_PATH=$HOME/ffmpeg_build/lib/pkgconfig \
    CPPFLAGS="-I/usr/local/include/avisynth" \
    ./autogen.sh --enable-shared --enable-avisynth && \
make -j$(nproc) && \
    sudo checkinstall --pkgname=ffms2 --pkgversion="1:$(./version.sh)-git" \
    --backup=no --deldoc=yes --delspec=yes --deldesc=yes --strip=yes --stripso=yes \
    --addso=yes --fstrans=no --default

This resulted in the following errors:

/usr/bin/ld: /home/joerg/ffmpeg_build/lib/libswscale.a(swscale.o): warning: relocation against `ff_M24B' in read-only section `.text'
/usr/bin/ld: /home/joerg/ffmpeg_build/lib/libavcodec.a(vc1dsp_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pw_9' 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
make: *** [Makefile:652: src/core/libffms2.la] Fehler 1

I also tried the option --extra-cflags="-fPIC" instead of --enable-pic while building ffmpeg with the same result. I don't know what to do further. Any help is greatly appreciated.

@dwbuiten
Copy link
Member

FFmpeg needs to be built as shared if you're going to build FFMS2 as shared.

@qyot27
Copy link
Contributor

qyot27 commented Feb 14, 2023

Using a static FFmpeg requires passing LDFLAGS="-Wl,-Bsymbolic" when configuring FFMS2.

While this doesn't affect avs2yuv, the issue is that the shared library dependency loop on FFmpeg can cause anything from no status output to a deadlock when opening an FFMS2 (or LSMASHSource) using script in a shared build of FFmpeg. Either you have to corral two separate sets of shared libraries that don't collide with each other, or one can be shared and one static, or both are static (or even the same build).

@Josch600
Copy link
Author

Thanks, this worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants