Merge branch 'master' of https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn
This commit is contained in:
commit
c433efaa61
|
@ -11,14 +11,6 @@ if(MCPI_IS_FLATPAK_BUILD)
|
||||||
set(QEMU_PATCH "sed" "-i" "s/libdrm/libdrm-dis/g" "<SOURCE_DIR>/meson.build")
|
set(QEMU_PATCH "sed" "-i" "s/libdrm/libdrm-dis/g" "<SOURCE_DIR>/meson.build")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Inherit Make Jobserver ()If Present)
|
|
||||||
include(ProcessorCount)
|
|
||||||
ProcessorCount(NPROC)
|
|
||||||
set(MAKE "make" "-j${NPROC}")
|
|
||||||
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
|
||||||
set(MAKE "$(MAKE)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(PKGCONFIG_ENV "")
|
set(PKGCONFIG_ENV "")
|
||||||
|
@ -41,7 +33,7 @@ ExternalProject_Add(qemu
|
||||||
"--target-list=arm-linux-user"
|
"--target-list=arm-linux-user"
|
||||||
"--without-default-features"
|
"--without-default-features"
|
||||||
USES_TERMINAL_CONFIGURE TRUE
|
USES_TERMINAL_CONFIGURE TRUE
|
||||||
BUILD_COMMAND ${MAKE} "qemu-arm"
|
BUILD_COMMAND ninja "qemu-arm"
|
||||||
USES_TERMINAL_BUILD TRUE
|
USES_TERMINAL_BUILD TRUE
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
TEST_COMMAND ""
|
TEST_COMMAND ""
|
||||||
|
|
|
@ -13,10 +13,12 @@
|
||||||
|
|
||||||
// Load Symbol From ELF File
|
// Load Symbol From ELF File
|
||||||
static void load_symbol(const char *source, const char *name, std::function<void(const unsigned char *, uint32_t)> callback) {
|
static void load_symbol(const char *source, const char *name, std::function<void(const unsigned char *, uint32_t)> callback) {
|
||||||
static std::unique_ptr<LIEF::ELF::Binary> binary = NULL;
|
static std::unordered_map<std::string, std::unique_ptr<LIEF::ELF::Binary>> sources = {};
|
||||||
if (binary == NULL) {
|
std::string cpp_source = source;
|
||||||
binary = LIEF::ELF::Parser::parse(source);
|
if (sources.count(cpp_source) == 0) {
|
||||||
|
sources[cpp_source] = LIEF::ELF::Parser::parse(source);
|
||||||
}
|
}
|
||||||
|
std::unique_ptr<LIEF::ELF::Binary> &binary = sources[cpp_source];
|
||||||
const LIEF::ELF::Symbol *symbol = binary->get_dynamic_symbol(name);
|
const LIEF::ELF::Symbol *symbol = binary->get_dynamic_symbol(name);
|
||||||
if (symbol != NULL) {
|
if (symbol != NULL) {
|
||||||
LIEF::span<const uint8_t> data = binary->get_content_from_virtual_address(symbol->value(), symbol->size(), LIEF::Binary::VA_TYPES::VA);
|
LIEF::span<const uint8_t> data = binary->get_content_from_virtual_address(symbol->value(), symbol->size(), LIEF::Binary::VA_TYPES::VA);
|
||||||
|
|
Loading…
Reference in New Issue