From 8f782099dac9565f3c04a688f18148805ea00d85 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Mon, 5 Jul 2021 19:40:43 -0400 Subject: [PATCH] Fix Library Loading On ARM 32-Bit Systems --- VERSION | 2 +- docs/CHANGELOG.md | 3 +++ launcher/src/bootstrap.c | 4 ---- media-layer/CMakeLists.txt | 5 ----- media-layer/core/CMakeLists.txt | 5 +++++ media-layer/stubs/CMakeLists.txt | 18 ++++++++++-------- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/VERSION b/VERSION index 3e3c2f1e..eca07e4c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.1 +2.1.2 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a00c8709..fecf6461 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +**2.1.2** +* Fix Library Loading On ARM 32-Bit Systems + **2.1.1** * Fix Symlink Code diff --git a/launcher/src/bootstrap.c b/launcher/src/bootstrap.c index 3921fe24..187060d8 100644 --- a/launcher/src/bootstrap.c +++ b/launcher/src/bootstrap.c @@ -143,10 +143,6 @@ void bootstrap(int argc, char *argv[]) { string_append(&new_ld_path, ":%s", value); } } - // Load ARM Libraries -#ifdef __ARM_ARCH - string_append(&new_ld_path, "%s", ":/usr/lib/arm-linux-gnueabihf:/usr/arm-linux-gnueabihf/lib"); -#endif // Add Full Library Search Path { char *value = get_full_library_search_path(); diff --git a/media-layer/CMakeLists.txt b/media-layer/CMakeLists.txt index 1b9a49c5..a0812e2d 100644 --- a/media-layer/CMakeLists.txt +++ b/media-layer/CMakeLists.txt @@ -27,8 +27,3 @@ add_subdirectory(stubs) # Add Extras add_subdirectory(extras) - -# Add Symlinks So MCPI Can Locate Libraries -if(BUILD_ARM_COMPONENTS) - install_symlink("libmedia-layer-core.so" "${MCPI_LIB_DIR}/libSDL-1.2.so.0") -endif() diff --git a/media-layer/core/CMakeLists.txt b/media-layer/core/CMakeLists.txt index 30b5b69c..b54baa9f 100644 --- a/media-layer/core/CMakeLists.txt +++ b/media-layer/core/CMakeLists.txt @@ -27,3 +27,8 @@ if(TARGET media-layer-core) target_link_libraries(media-layer-core "${FREEIMAGE_LIBRARY}" GLESv1_CM glfw) endif() endif() + +# Add Symlinks So MCPI Can Locate Libraries +if(BUILD_ARM_COMPONENTS) + install_symlink("libmedia-layer-core.so" "${MCPI_LIB_DIR}/libSDL-1.2.so.0") +endif() diff --git a/media-layer/stubs/CMakeLists.txt b/media-layer/stubs/CMakeLists.txt index f5f029ee..f14602e9 100644 --- a/media-layer/stubs/CMakeLists.txt +++ b/media-layer/stubs/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(GLESv1_CM SHARED src/GLESv1_CM.c) target_link_libraries(GLESv1_CM media-layer-headers) set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1") +# Stubs Only Needed For ARM if(BUILD_ARM_COMPONENTS) # Stub RPI-Specific Graphics add_library(bcm_host SHARED src/bcm_host.c) @@ -14,6 +15,7 @@ if(BUILD_ARM_COMPONENTS) # Stub EGL add_library(EGL SHARED src/EGL.c) target_link_libraries(EGL reborn-headers media-layer-headers) + set_target_properties(EGL PROPERTIES SOVERSION "1") # Stub X11 add_library(X11 SHARED src/X11.c) target_link_libraries(X11 reborn-headers media-layer-headers) @@ -30,12 +32,12 @@ if(BUILD_ARM_COMPONENTS) install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") endif() - # Add NOP GLESv2 That Dpends On Actual GLESv1_CM (This Cannot Be A Symlink Because The Location Of GLESv1_CM Is Dynamic) - add_library(GLESv2 SHARED src/nop.c) - target_compile_options(GLESv2 PRIVATE -w) - target_link_libraries(GLESv2 GLESv1_CM) - # Force Link - target_link_options(GLESv2 PRIVATE "-Wl,--no-as-needed") - # Install - install(TARGETS GLESv2 DESTINATION "${MCPI_LIB_DIR}") + # MCPI Depends On GLESv2, But Uses GLESv1_CM + install_symlink("libGLESv1_CM.so.1" "${MCPI_LIB_DIR}/libGLESv2.so") + # Prevent MCPI From Linking To The Legacy GL Driver When Directly Linking To GL + if(NOT MCPI_SERVER_MODE AND NOT MCPI_USE_MEDIA_LAYER_PROXY) + # Symlinks + install_symlink("/usr/lib/arm-linux-gnueabihf/libEGL.so.1" "${MCPI_LIB_DIR}/libEGL.so") + install_symlink("/usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so.1" "${MCPI_LIB_DIR}/libGLESv1_CM.so.1") + endif() endif()