1

Searching about shows this error in a number of mailing lists, but neither a general solution nor explanation is forthcoming.

What does illegal text-relocoation (direct reference) to (global,weak) mean and how can it be resolved.

Specifically, I have built ffmpeg-2.5.2 using this script. When building XCode tests that use it, there is the following error:

ld: illegal text-relocoation (direct reference) to (global,weak)
    _ff_h264_cabac_tables in <...>/myLib.a(cabac.o)
    from _ff_h264_decode_mb_cabac in <...>/myLib.a(h264_cabac.o)
    for architecture i386

Does this require compiler/linker options to fix, or some kind of code change?

OrangeDog
  • 36,653
  • 12
  • 122
  • 207

1 Answers1

5

Adding -read_only_relocs suppress to the app's linker flags allows a successful build.

OrangeDog
  • 36,653
  • 12
  • 122
  • 207
  • 1
    I got `-read_only_relocs and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together` what can you do when you need to use bitcode? – Kyle Redfearn Jun 19 '17 at 22:52