Сборка osg с плагином ffmeg - PullRequest
0 голосов
/ 11 мая 2018

Я пытаюсь собрать OpenSceneGraph (OSG) с плагином FFMPEG. Использование:

  • CentOS 7.2 64-битная
  • GCC 4.8.5
  • ОСГ 3.4.0
  • FFMPEG 2.8

С FFMPEG, I ./configure без параметров, make и make install. В ОСГ я cmake . и make. Я получаю это:

Linking CXX shared module ../../../lib/osgPlugins-3.4.0/osgdb_ffmpeg.so
/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against symbol `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libavformat.a(amr.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
...(and a ton of others like this)

Итак, я возвращаюсь к FFMPEG и ./configure --enable-pic. От --help:

  --enable-pic             build position-independent code

make clean, make и make install.

Затем я иду в OSG и make и получаю гораздо меньше, но все равно получаю один:

Linking CXX shared module ../../../lib/osgPlugins-3.4.0/osgdb_ffmpeg.so
/usr/bin/ld: /usr/local/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

Я провел некоторое исследование о том, как определить, построен ли объект с помощью PIC, и обнаружил:

terminal-> readelf --relocs ./libavcodec/x86/vc1dsp_mmx.o | egrep '(GOT|PLT|JU?MP_SLOT)'

000000000ea6  007300000004 R_X86_64_PLT32    0000000000000000 ff_avg_pixels16_mmx - 4
000000000eb6  007400000004 R_X86_64_PLT32    0000000000000000 ff_avg_pixels8_mmx - 4
000000000ec6  007500000004 R_X86_64_PLT32    0000000000000000 ff_put_pixels16_mmx - 4
000000000ed6  007600000004 R_X86_64_PLT32    0000000000000000 ff_put_pixels8_mmx - 4

Когда я собираю без --enable-pic, предыдущая команда ничего не возвращает.

Для libavcodec.a я сделал nm, чтобы найти этот символ ff_pw_9, и нашел следующие ссылки:

constants.o:
...
00000000000002d0 R ff_pw_9
...

vc1dsp_mmx.o:
...
                 U ff_pw_9
...

vp8dsp_loopfilter.o:
...
                 U ff_pw_9
...

Что мне здесь не хватает?

...