diff --git a/cmake/options/appimage.cmake b/cmake/options/appimage.cmake deleted file mode 100644 index e69de29b..00000000 diff --git a/cmake/options/paths.cmake b/cmake/options/paths.cmake index 7e796f8a..3cde6655 100644 --- a/cmake/options/paths.cmake +++ b/cmake/options/paths.cmake @@ -1,6 +1,5 @@ # Specify Installation Paths set(MCPI_INSTALL_DIR "lib/${MCPI_APP_NAME}") -set(MCPI_BIN_DIR "${MCPI_INSTALL_DIR}/bin") set(MCPI_LEGAL_DIR "${MCPI_INSTALL_DIR}/legal") # For Software Licenses set(MCPI_SDK_DIR "${MCPI_INSTALL_DIR}/sdk") set(MCPI_SDK_LIB_DIR "${MCPI_SDK_DIR}/lib") diff --git a/dependencies/runtime/CMakeLists.txt b/dependencies/runtime/CMakeLists.txt index be6e5806..ba8e24be 100644 --- a/dependencies/runtime/CMakeLists.txt +++ b/dependencies/runtime/CMakeLists.txt @@ -3,10 +3,4 @@ project(runtime) ## Extra Runtime # Build -add_subdirectory(src) - -# RPath -if(TARGET runtime) - set_target_properties(runtime PROPERTIES INSTALL_RPATH "$ORIGIN/../lib/native") - target_link_options(runtime PRIVATE "LINKER:--disable-new-dtags") -endif() \ No newline at end of file +add_subdirectory(src) \ No newline at end of file diff --git a/dependencies/runtime/src b/dependencies/runtime/src index 84e37b57..5d400a2b 160000 --- a/dependencies/runtime/src +++ b/dependencies/runtime/src @@ -1 +1 @@ -Subproject commit 84e37b572b55afb1eaa2ada1e37bc36de1584cfd +Subproject commit 5d400a2b7790f3d99284acb9d44b29012b628943 diff --git a/launcher/src/bootstrap/bootstrap.cpp b/launcher/src/bootstrap/bootstrap.cpp index a62c6751..caea127b 100644 --- a/launcher/src/bootstrap/bootstrap.cpp +++ b/launcher/src/bootstrap/bootstrap.cpp @@ -63,7 +63,7 @@ void bootstrap(const options_t &options) { // Arguments const std::vector args { #ifdef MCPI_BUILD_RUNTIME - "runtime", + binary_directory + "/lib/native/runtime", #endif new_mcpi_exe_path }; diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index a94af371..bd92d49d 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -28,9 +28,6 @@ static void setup_environment(const options_t &options) { bind_to_env(_MCPI_FORCE_HEADLESS_ENV, options.force_headless); bind_to_env(_MCPI_FORCE_NON_HEADLESS_ENV, options.force_non_headless); - // Configure PATH - setup_path(); - // Setup MCPI_HOME setup_home(); // Create If Needed diff --git a/launcher/src/util/env.cpp b/launcher/src/util/env.cpp index 8ca930f1..8a3b778f 100644 --- a/launcher/src/util/env.cpp +++ b/launcher/src/util/env.cpp @@ -6,20 +6,6 @@ #include #include -// $PATH -void setup_path() { - // Get Binary Directory - const std::string binary_directory = get_binary_directory(); - std::string new_path = binary_directory + "/bin"; - // Add Existing PATH - const char *value = getenv("PATH"); - if (value != nullptr && strlen(value) > 0) { - new_path += std::string(":") + value; - } - // Set And Free - set_and_print_env("PATH", new_path.c_str()); -} - // Profile Directory void setup_home() { const char *custom_profile_directory = getenv(MCPI_PROFILE_DIRECTORY_ENV); diff --git a/launcher/src/util/util.h b/launcher/src/util/util.h index e5eeb2c3..1f3d11ed 100644 --- a/launcher/src/util/util.h +++ b/launcher/src/util/util.h @@ -9,7 +9,6 @@ std::string get_binary_directory(); void copy_sdk(const std::string &binary_directory, bool force); -void setup_path(); void setup_home(); bool read_directory(const std::string &path, const std::function &callback, bool allow_nonexistent_dir = false); \ No newline at end of file diff --git a/media-layer/trampoline/CMakeLists.txt b/media-layer/trampoline/CMakeLists.txt index 7b366137..bb789998 100644 --- a/media-layer/trampoline/CMakeLists.txt +++ b/media-layer/trampoline/CMakeLists.txt @@ -6,15 +6,15 @@ set(MEDIA_LAYER_TRAMPOLINE_SRC src/media-layer-core.cpp src/GLESv1_CM.cpp) # Build if(BUILD_NATIVE_COMPONENTS) # Host Component - add_library(media-layer-trampoline src/host/host.cpp ${MEDIA_LAYER_TRAMPOLINE_SRC}) - target_link_libraries(media-layer-trampoline + add_library("${TRAMPOLINE_LIBRARY_NAME}" src/host/host.cpp ${MEDIA_LAYER_TRAMPOLINE_SRC}) + target_link_libraries("${TRAMPOLINE_LIBRARY_NAME}" reborn-util media-layer-core trampoline-headers ) - target_compile_definitions(media-layer-trampoline PRIVATE MEDIA_LAYER_TRAMPOLINE_HOST) + target_compile_definitions("${TRAMPOLINE_LIBRARY_NAME}" PRIVATE MEDIA_LAYER_TRAMPOLINE_HOST) # Install - setup_library(media-layer-trampoline TRUE TRUE) + setup_library("${TRAMPOLINE_LIBRARY_NAME}" TRUE TRUE) elseif(BUILD_ARM_COMPONENTS) # Guest Component add_library(media-layer-core SHARED ${MEDIA_LAYER_TRAMPOLINE_SRC}) diff --git a/media-layer/trampoline/src/guest/guest.h b/media-layer/trampoline/src/guest/guest.h index 7b228d9b..2f5166ee 100644 --- a/media-layer/trampoline/src/guest/guest.h +++ b/media-layer/trampoline/src/guest/guest.h @@ -2,6 +2,9 @@ #include #include +#include + +#include #include "../common/common.h" @@ -36,7 +39,7 @@ inline void _handle_trampoline_arg(unsigned char *&out, const copy_a _handle_trampoline_arg(out, arg.size); // Send Data if (arg.size > 0) { - static bool just_send_pointer = getenv(MCPI_USE_PIPE_TRAMPOLINE_ENV) == nullptr; + static bool just_send_pointer = !is_trampoline_pipe_based(); if (just_send_pointer) { _handle_trampoline_arg(out, uint32_t(arg.data)); } else { @@ -49,19 +52,26 @@ inline void _handle_trampoline_arg(unsigned char *&out, const copy_a __attribute__((unused)) static void _add_to_trampoline_args(__attribute__((unused)) unsigned char *&out) { } template -void _add_to_trampoline_args(unsigned char *&out, const T &first, const Args... args) { +void _add_to_trampoline_args(unsigned char *&out, const T &first, Args&&... args) { _handle_trampoline_arg(out, first); - _add_to_trampoline_args(out, args...); + _add_to_trampoline_args(out, std::forward(args)...); } // Main Trampoline Function template -unsigned int _trampoline(const unsigned int id, const bool allow_early_return, Args... args) { +unsigned int _trampoline(const unsigned int id, const bool allow_early_return, Args&&... args) { + // Create Arguments static unsigned char out[MAX_TRAMPOLINE_ARGS_SIZE]; unsigned char *end = out; - _add_to_trampoline_args(end, args...); + _add_to_trampoline_args(end, std::forward(args)...); const uint32_t length = end - out; - return raw_trampoline(id, allow_early_return, length, out); + // Call + uint32_t ret = 0; + const uint32_t err = raw_trampoline(id, allow_early_return ? nullptr : &ret, length, out); + if (err != 0) { + ERR("Trampoline Error: %u", err); + } + return ret; } #define trampoline(...) _trampoline(_id, ##__VA_ARGS__)