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 e2784e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Build
working-directory: build
run: |
make -j3
make -j3 VERBOSE=1
- name: Run unit tests
working-directory: build
Expand Down
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 e2784e6

Please sign in to comment.