Fix ARM32 Support

This commit is contained in:
TheBrokenRail 2022-03-12 22:52:58 -05:00
parent e319d46ea0
commit 9f63fa712f
7 changed files with 36 additions and 16 deletions

@ -1 +1 @@
Subproject commit 4663a8656d8c12be00286ee10aae2ff55ff589af Subproject commit b01f0001eae0b01f9de2bba3d1b93c386b298c0d

View File

@ -25,8 +25,12 @@ char *get_full_library_search_path() {
} }
// Interpret // Interpret
if (str.size() >= 2 && str[0] != '\t' && str[str.size() - 1] == ':') { if (str.size() >= 2 && str[0] != '\t' && str[str.size() - 1] == ':') {
// Blacklist RPI Legacy GL Drivers
#define RPI_LEGACY_GL_PATH "/opt/vc"
if (str.rfind(RPI_LEGACY_GL_PATH ":", 0) != 0 && str.rfind(RPI_LEGACY_GL_PATH "/", 0) != 0) {
output.append(str); output.append(str);
} }
}
} else { } else {
running = 0; running = 0;
} }
@ -37,8 +41,10 @@ char *get_full_library_search_path() {
output.pop_back(); output.pop_back();
} }
// Close Process // Close Process
int ret = WEXITSTATUS(pclose(file)); int ret = pclose(file);
if (ret != 0) { if (ret == -1) {
ERR("ldconfig Failed: %s", strerror(errno));
} else if (ret != 0) {
ERR("ldconfig Failed: Exit Code: %i", ret); ERR("ldconfig Failed: Exit Code: %i", ret);
} }
// Return // Return

View File

@ -1,6 +1,6 @@
project(media-layer-stubs) project(media-layer-stubs)
# Add GLES Stubs For Linking # Add GLES1 Stubs For Linking
add_library(GLESv1_CM SHARED src/GLESv1_CM.c) add_library(GLESv1_CM SHARED src/GLESv1_CM.c)
target_link_libraries(GLESv1_CM media-layer-headers) target_link_libraries(GLESv1_CM media-layer-headers)
set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1") set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1")
@ -27,17 +27,11 @@ if(BUILD_ARM_COMPONENTS)
install(TARGETS EGL X11 DESTINATION "${MCPI_FALLBACK_LIB_DIR}") # Place At The End Of LD_LIBRARY_PATH install(TARGETS EGL X11 DESTINATION "${MCPI_FALLBACK_LIB_DIR}") # Place At The End Of LD_LIBRARY_PATH
endif() endif()
# Install GLESv1_CM Stubs In Server Mode # Install Fake GLESv1_CM Stubs In Server Mode
if(MCPI_HEADLESS_MODE) if(MCPI_HEADLESS_MODE)
install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}")
endif() endif()
# MCPI Depends On GLESv2, But Uses GLESv1_CM # Redirect MCPI To Correct Libraries
install_symlink("libGLESv1_CM.so.1" "${MCPI_LIB_DIR}/libGLESv2.so") add_subdirectory(redirect)
# Prevent MCPI From Linking To The Legacy GL Driver When Directly Linking To GL (RPI-Specific)
if(NOT MCPI_HEADLESS_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() endif()

View File

@ -0,0 +1,18 @@
project(media-layer-stubs-redirect)
# MCPI Depends On GLESv2, But Uses GLESv1_CM
add_library(GLESv2_redirect SHARED src/nop.c)
target_link_libraries(GLESv2_redirect GLESv1_CM)
target_link_options(GLESv2_redirect PRIVATE "-Wl,--no-as-needed")
set_target_properties(GLESv2_redirect PROPERTIES OUTPUT_NAME "GLESv2")
install(TARGETS GLESv2_redirect DESTINATION "${MCPI_LIB_DIR}")
# MCPI links to libEGL.so instead of libEGL.so.1, this creates a fake libEGL.so which redirects it to the correct libEGL.so.1.
# This is only needed on configurations that don't generate their own libEGL.so.
if(NOT MCPI_HEADLESS_MODE AND NOT MCPI_USE_MEDIA_LAYER_PROXY)
add_library(EGL_redirect SHARED src/nop.c)
target_link_libraries(EGL_redirect EGL)
target_link_options(EGL_redirect PRIVATE "-Wl,--no-as-needed")
set_target_properties(EGL_redirect PROPERTIES OUTPUT_NAME "EGL")
install(TARGETS EGL_redirect DESTINATION "${MCPI_LIB_DIR}")
endif()

View File

@ -23,7 +23,6 @@ const version = fs.readFileSync('VERSION', 'utf8').trim();
// Packages/Dependencies // Packages/Dependencies
const packages = [ const packages = [
'libc6', 'libc6',
'libc-bin',
'libstdc++6' 'libstdc++6'
]; ];
if (mode === 'client') { if (mode === 'client') {
@ -132,7 +131,9 @@ const runtime = {
`usr/lib/${name}/minecraft-pi`, `usr/lib/${name}/minecraft-pi`,
`usr/lib/${name}/**/*.so`, `usr/lib/${name}/**/*.so`,
'usr/arm-linux-gnueabihf/lib' 'usr/arm-linux-gnueabihf/lib'
] : undefined ] : undefined,
// libapprun_hooks.so Is Buggy And Unneeded
no_hooks: true
}; };
// AppDir // AppDir

View File

@ -88,6 +88,7 @@ fi
queue_pkg \ queue_pkg \
python3-pip \ python3-pip \
python3-setuptools \ python3-setuptools \
python3-wheel \
patchelf \ patchelf \
desktop-file-utils \ desktop-file-utils \
libgdk-pixbuf2.0-dev \ libgdk-pixbuf2.0-dev \