Skip to content

Commit

Permalink
Add -Bsymbolic
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist committed Sep 19, 2023
1 parent c0ed4de commit b9bdd54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ elseif(BUILD_COMPILER STREQUAL "msvc")
endif()
endif()

# When statically linking to ffmpeg, we're getting linker errors like this one:
# relocation R_386_32 cannot be used against local symbol; recompile with -fPIC
# And I was unable to figure out how to fix these at the ffmpeg side. The errors pop up when building for Android, and
# when linking with lld on Linux for x86. So we use this workaround:
# https://github.com/google/ExoPlayer/issues/9933#issuecomment-1029775358.
if(OE_USE_PREBUILT_DEPENDENCIES AND (BUILD_PLATFORM STREQUAL "android" OR BUILD_PLATFORM STREQUAL "linux"))
add_link_options("-Wl,-Bsymbolic")
endif()

resolve_dependencies()

add_subdirectory(thirdparty)
Expand Down

0 comments on commit b9bdd54

Please sign in to comment.