From b43db294ec9088664e4f68b5a3005b709f6ce932 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 1 Apr 2021 20:05:10 -0700 Subject: [PATCH 1/4] Change our compilation visibility to hidden This bloats our compilation with symbols that don't need to be visible --- External/FEXCore/Source/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/External/FEXCore/Source/CMakeLists.txt b/External/FEXCore/Source/CMakeLists.txt index 956a47e03..b7238a0ac 100644 --- a/External/FEXCore/Source/CMakeLists.txt +++ b/External/FEXCore/Source/CMakeLists.txt @@ -266,6 +266,9 @@ function(AddObject Name Type) target_link_libraries(${Name} pthread rt vixl ${LINUX_LIBS} dl) set_target_properties(${Name} PROPERTIES OUTPUT_NAME FEXCore) + set_target_properties(${Name} PROPERTIES C_VISIBILITY_PRESET hidden) + set_target_properties(${Name} PROPERTIES CXX_VISIBILITY_PRESET hidden) + set_target_properties(${Name} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) target_include_directories(${Name} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") @@ -301,6 +304,9 @@ function(AddLibrary Name Type) add_library(${Name} ${Type} $) target_link_libraries(${Name} pthread rt vixl ${LINUX_LIBS} dl) set_target_properties(${Name} PROPERTIES OUTPUT_NAME FEXCore) + set_target_properties(${Name} PROPERTIES C_VISIBILITY_PRESET hidden) + set_target_properties(${Name} PROPERTIES CXX_VISIBILITY_PRESET hidden) + set_target_properties(${Name} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) target_include_directories(${Name} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_include_directories(${Name} PUBLIC "${PROJECT_SOURCE_DIR}/include/") From 235f6fbe396d1041c85c6e49f2547ea617141944 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 1 Apr 2021 20:05:51 -0700 Subject: [PATCH 2/4] Strip symbols and dead sections These are unnecessary and just add some file bloat. Strip them out --- External/FEXCore/Source/CMakeLists.txt | 10 ++++++++++ Source/Tests/CMakeLists.txt | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/External/FEXCore/Source/CMakeLists.txt b/External/FEXCore/Source/CMakeLists.txt index b7238a0ac..a976c4011 100644 --- a/External/FEXCore/Source/CMakeLists.txt +++ b/External/FEXCore/Source/CMakeLists.txt @@ -286,6 +286,7 @@ function(AddObject Name Type) -Werror=implicit-fallthrough -Wno-trigraphs + -ffunction-sections ) if (GCC_COLOR) @@ -311,6 +312,15 @@ function(AddLibrary Name Type) target_include_directories(${Name} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_include_directories(${Name} PUBLIC "${PROJECT_SOURCE_DIR}/include/") target_include_directories(${Name} PUBLIC "${CMAKE_BINARY_DIR}/include/") + + if (CMAKE_BUILD_TYPE MATCHES "RELEASE") + target_link_options(${Name} + PRIVATE + "LINKER:--gc-sections" + "LINKER:--strip-all" + "LINKER:--as-needed" + ) + endif() endfunction() AddObject(${PROJECT_NAME}_object OBJECT) diff --git a/Source/Tests/CMakeLists.txt b/Source/Tests/CMakeLists.txt index 4a46ac30f..c20397891 100644 --- a/Source/Tests/CMakeLists.txt +++ b/Source/Tests/CMakeLists.txt @@ -9,6 +9,15 @@ target_include_directories(FEXLoader PRIVATE ${CMAKE_BINARY_DIR}/generated) target_link_libraries(FEXLoader ${LIBS} LinuxEmulation) +if (CMAKE_BUILD_TYPE MATCHES "RELEASE") + target_link_options(FEXLoader + PRIVATE + "LINKER:--gc-sections" + "LINKER:--strip-all" + "LINKER:--as-needed" + ) +endif() + install(TARGETS FEXLoader RUNTIME DESTINATION bin @@ -68,6 +77,15 @@ target_include_directories(FEXBash PRIVATE ${CMAKE_BINARY_DIR}/generated) target_link_libraries(FEXBash ${LIBS} LinuxEmulation) +if (CMAKE_BUILD_TYPE MATCHES "RELEASE") + target_link_options(FEXBash + PRIVATE + "LINKER:--gc-sections" + "LINKER:--strip-all" + "LINKER:--as-needed" + ) +endif() + install(TARGETS FEXBash RUNTIME DESTINATION bin From 2a4903778956f506e1a91e06093bdfafa5f3edf8 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 1 Apr 2021 20:24:43 -0700 Subject: [PATCH 3/4] update external vixl --- External/vixl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/vixl b/External/vixl index 6d8ced06a..4d6c1d44a 160000 --- a/External/vixl +++ b/External/vixl @@ -1 +1 @@ -Subproject commit 6d8ced06a7e775246c2c16ad07dadf49d7b593ae +Subproject commit 4d6c1d44a59266b94bde7b2dc85efb83aec0a4f7 From 286f103dab96ad44d3d2769d04b7390383812eb8 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 6 Apr 2021 01:01:31 -0700 Subject: [PATCH 4/4] Adds visibility attributes to everything we need to expose --- External/FEXCore/Scripts/json_ir_generator.py | 8 +- .../FEXCore/include/FEXCore/Config/Config.h | 34 ++++----- .../FEXCore/include/FEXCore/Core/Context.h | 74 +++++++++---------- .../FEXCore/include/FEXCore/Core/CoreState.h | 4 +- .../FEXCore/include/FEXCore/Debug/X86Tables.h | 36 ++++----- External/FEXCore/include/FEXCore/IR/IR.h | 4 +- .../FEXCore/include/FEXCore/Utils/ELFLoader.h | 2 +- .../include/FEXCore/Utils/ELFSymbolDatabase.h | 2 +- .../include/FEXCore/Utils/LogManager.h | 10 +-- 9 files changed, 87 insertions(+), 87 deletions(-) diff --git a/External/FEXCore/Scripts/json_ir_generator.py b/External/FEXCore/Scripts/json_ir_generator.py index b5f75c899..e2f54394c 100644 --- a/External/FEXCore/Scripts/json_ir_generator.py +++ b/External/FEXCore/Scripts/json_ir_generator.py @@ -108,10 +108,10 @@ def print_ir_sizes(ops, defines): output_file.write("[[maybe_unused]] static size_t GetSize(IROps Op) { return IRSizes[Op]; }\n\n") - output_file.write("std::string_view const& GetName(IROps Op);\n") - output_file.write("uint8_t GetArgs(IROps Op);\n") - output_file.write("FEXCore::IR::RegisterClassType GetRegClass(IROps Op);\n\n") - output_file.write("bool HasSideEffects(IROps Op);\n") + output_file.write("__attribute__((visibility(\"default\"))) std::string_view const& GetName(IROps Op);\n") + output_file.write("__attribute__((visibility(\"default\"))) uint8_t GetArgs(IROps Op);\n") + output_file.write("__attribute__((visibility(\"default\"))) FEXCore::IR::RegisterClassType GetRegClass(IROps Op);\n\n") + output_file.write("__attribute__((visibility(\"default\"))) bool HasSideEffects(IROps Op);\n") output_file.write("#undef IROP_SIZES\n") output_file.write("#endif\n\n") diff --git a/External/FEXCore/include/FEXCore/Config/Config.h b/External/FEXCore/include/FEXCore/Config/Config.h index 39e8d3c1c..9fc3a6c96 100644 --- a/External/FEXCore/include/FEXCore/Config/Config.h +++ b/External/FEXCore/include/FEXCore/Config/Config.h @@ -54,15 +54,15 @@ namespace Type { #undef P } - std::string GetDataDirectory(); - std::string GetConfigDirectory(bool Global); - std::string GetConfigFileLocation(); - std::string GetApplicationConfig(std::string &Filename, bool Global); + __attribute__((visibility("default"))) std::string GetDataDirectory(); + __attribute__((visibility("default"))) std::string GetConfigDirectory(bool Global); + __attribute__((visibility("default"))) std::string GetConfigFileLocation(); + __attribute__((visibility("default"))) std::string GetApplicationConfig(std::string &Filename, bool Global); using LayerValue = std::list; using LayerOptions = std::unordered_map; - class Layer { + class __attribute__((visibility("default"))) Layer { public: explicit Layer(const LayerType _Type); virtual ~Layer(); @@ -114,24 +114,24 @@ namespace Type { LayerOptions OptionMap; }; - void Initialize(); - void Shutdown(); + __attribute__((visibility("default"))) void Initialize(); + __attribute__((visibility("default"))) void Shutdown(); - void Load(); - void ReloadMetaLayer(); + __attribute__((visibility("default"))) void Load(); + __attribute__((visibility("default"))) void ReloadMetaLayer(); - void AddLayer(std::unique_ptr _Layer); + __attribute__((visibility("default"))) void AddLayer(std::unique_ptr _Layer); - bool Exists(ConfigOption Option); - std::optional All(ConfigOption Option); - std::optional Get(ConfigOption Option); + __attribute__((visibility("default"))) bool Exists(ConfigOption Option); + __attribute__((visibility("default"))) std::optional All(ConfigOption Option); + __attribute__((visibility("default"))) std::optional Get(ConfigOption Option); - void Set(ConfigOption Option, std::string Data); - void Erase(ConfigOption Option); - void EraseSet(ConfigOption Option, std::string Data); + __attribute__((visibility("default"))) void Set(ConfigOption Option, std::string Data); + __attribute__((visibility("default"))) void Erase(ConfigOption Option); + __attribute__((visibility("default"))) void EraseSet(ConfigOption Option, std::string Data); template - class Value { + class __attribute__((visibility("default"))) Value { public: template ::value, int>::type = 0> diff --git a/External/FEXCore/include/FEXCore/Core/Context.h b/External/FEXCore/include/FEXCore/Core/Context.h index e2050ee0c..20c5cc953 100644 --- a/External/FEXCore/include/FEXCore/Core/Context.h +++ b/External/FEXCore/include/FEXCore/Core/Context.h @@ -49,7 +49,7 @@ namespace FEXCore::Context { /** * @brief This initializes internal FEXCore state that is shared between contexts and requires overhead to setup */ - void InitializeStaticTables(OperatingMode Mode = MODE_64BIT); + __attribute__((visibility("default"))) void InitializeStaticTables(OperatingMode Mode = MODE_64BIT); /** * @brief [[threadsafe]] Create a new FEXCore context object @@ -58,7 +58,7 @@ namespace FEXCore::Context { * * @return a new context object */ - FEXCore::Context::Context *CreateNewContext(); + __attribute__((visibility("default"))) FEXCore::Context::Context *CreateNewContext(); /** * @brief Post creation context initialization @@ -68,14 +68,14 @@ namespace FEXCore::Context { * * @return true if we managed to initialize correctly */ - bool InitializeContext(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) bool InitializeContext(FEXCore::Context::Context *CTX); /** * @brief Destroy the context object * * @param CTX */ - void DestroyContext(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void DestroyContext(FEXCore::Context::Context *CTX); /** * @brief Allows setting up in memory code and other things prior to launchign code execution @@ -85,17 +85,17 @@ namespace FEXCore::Context { * * @return true if we loaded code */ - bool InitCore(FEXCore::Context::Context *CTX, FEXCore::CodeLoader *Loader); + __attribute__((visibility("default"))) bool InitCore(FEXCore::Context::Context *CTX, FEXCore::CodeLoader *Loader); - void SetExitHandler(FEXCore::Context::Context *CTX, std::function handler); - std::function GetExitHandler(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void SetExitHandler(FEXCore::Context::Context *CTX, std::function handler); + __attribute__((visibility("default"))) std::function GetExitHandler(FEXCore::Context::Context *CTX); /** * @brief Pauses execution on the CPU core * * Blocks until all threads have paused. */ - void Pause(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void Pause(FEXCore::Context::Context *CTX); /** * @brief Starts (or continues) the CPU core @@ -104,7 +104,7 @@ namespace FEXCore::Context { * Use RunUntilExit() for synchonous executions * */ - void Run(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void Run(FEXCore::Context::Context *CTX); /** * @brief Runs the CPU core until it exits @@ -116,7 +116,7 @@ namespace FEXCore::Context { * * @return The ExitReason for the parentthread. */ - ExitReason RunUntilExit(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) ExitReason RunUntilExit(FEXCore::Context::Context *CTX); /** * @brief Gets the program exit status @@ -126,21 +126,21 @@ namespace FEXCore::Context { * * @return The program exit status */ - int GetProgramStatus(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) int GetProgramStatus(FEXCore::Context::Context *CTX); /** * @brief Tells the core to shutdown * * Blocks until shutdown */ - void Stop(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void Stop(FEXCore::Context::Context *CTX); /** * @brief Executes one instruction * * Returns once execution is complete. */ - void Step(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) void Step(FEXCore::Context::Context *CTX); /** * @brief [[threadsafe]] Returns the ExitReason of the parent thread. Typically used for async result status @@ -149,7 +149,7 @@ namespace FEXCore::Context { * * @return The ExitReason for the parentthread */ - ExitReason GetExitReason(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) ExitReason GetExitReason(FEXCore::Context::Context *CTX); /** * @brief [[theadsafe]] Checks if the Context is either done working or paused(in the case of single stepping) @@ -160,7 +160,7 @@ namespace FEXCore::Context { * * @return true if the core is done or paused */ - bool IsDone(FEXCore::Context::Context *CTX); + __attribute__((visibility("default"))) bool IsDone(FEXCore::Context::Context *CTX); /** * @brief Gets a copy the CPUState of the parent thread @@ -168,7 +168,7 @@ namespace FEXCore::Context { * @param CTX The context that we created * @param State The state object to populate */ - void GetCPUState(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *State); + __attribute__((visibility("default"))) void GetCPUState(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *State); /** * @brief Copies the CPUState provided to the parent thread @@ -176,7 +176,7 @@ namespace FEXCore::Context { * @param CTX The context that we created * @param State The satate object to copy from */ - void SetCPUState(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *State); + __attribute__((visibility("default"))) void SetCPUState(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *State); /** * @brief Allows the frontend to pass in a custom CPUBackend creation factory @@ -186,7 +186,7 @@ namespace FEXCore::Context { * @param CTX The context that we created * @param Factory The factory that the context will call if the DefaultCore config ise set to CUSTOM */ - void SetCustomCPUBackendFactory(FEXCore::Context::Context *CTX, CustomCPUFactoryType Factory); + __attribute__((visibility("default"))) void SetCustomCPUBackendFactory(FEXCore::Context::Context *CTX, CustomCPUFactoryType Factory); /** * @brief Sets up memory regions on the guest for mirroring within the guest's VM space @@ -197,7 +197,7 @@ namespace FEXCore::Context { * * @return true when successfully mapped. false if there was an error adding */ - bool AddVirtualMemoryMapping(FEXCore::Context::Context *CTX, uint64_t VirtualAddress, uint64_t PhysicalAddress, uint64_t Size); + __attribute__((visibility("default"))) bool AddVirtualMemoryMapping(FEXCore::Context::Context *CTX, uint64_t VirtualAddress, uint64_t PhysicalAddress, uint64_t Size); /** * @brief Allows the frontend to set a custom syscall handler @@ -207,26 +207,26 @@ namespace FEXCore::Context { * @param Syscall Which syscall ID to install a visitor to * @param Visitor The Visitor to install */ - void RegisterExternalSyscallVisitor(FEXCore::Context::Context *CTX, uint64_t Syscall, FEXCore::HLE::SyscallVisitor *Visitor); + __attribute__((visibility("default"))) void RegisterExternalSyscallVisitor(FEXCore::Context::Context *CTX, uint64_t Syscall, FEXCore::HLE::SyscallVisitor *Visitor); - void HandleCallback(FEXCore::Context::Context *CTX, uint64_t RIP); + __attribute__((visibility("default"))) void HandleCallback(FEXCore::Context::Context *CTX, uint64_t RIP); - void RegisterHostSignalHandler(FEXCore::Context::Context *CTX, int Signal, HostSignalDelegatorFunction Func); - void RegisterFrontendHostSignalHandler(FEXCore::Context::Context *CTX, int Signal, HostSignalDelegatorFunction Func); + __attribute__((visibility("default"))) void RegisterHostSignalHandler(FEXCore::Context::Context *CTX, int Signal, HostSignalDelegatorFunction Func); + __attribute__((visibility("default"))) void RegisterFrontendHostSignalHandler(FEXCore::Context::Context *CTX, int Signal, HostSignalDelegatorFunction Func); - FEXCore::Core::InternalThreadState* CreateThread(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *NewThreadState, uint64_t ParentTID); - void InitializeThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); - void RunThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); - void StopThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); - void DestroyThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); - void CleanupAfterFork(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); - void SetSignalDelegator(FEXCore::Context::Context *CTX, FEXCore::SignalDelegator *SignalDelegation); - void SetSyscallHandler(FEXCore::Context::Context *CTX, FEXCore::HLE::SyscallHandler *Handler); - FEXCore::CPUID::FunctionResults RunCPUIDFunction(FEXCore::Context::Context *CTX, uint32_t Function, uint32_t Leaf); + __attribute__((visibility("default"))) FEXCore::Core::InternalThreadState* CreateThread(FEXCore::Context::Context *CTX, FEXCore::Core::CPUState *NewThreadState, uint64_t ParentTID); + __attribute__((visibility("default"))) void InitializeThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); + __attribute__((visibility("default"))) void RunThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); + __attribute__((visibility("default"))) void StopThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); + __attribute__((visibility("default"))) void DestroyThread(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); + __attribute__((visibility("default"))) void CleanupAfterFork(FEXCore::Context::Context *CTX, FEXCore::Core::InternalThreadState *Thread); + __attribute__((visibility("default"))) void SetSignalDelegator(FEXCore::Context::Context *CTX, FEXCore::SignalDelegator *SignalDelegation); + __attribute__((visibility("default"))) void SetSyscallHandler(FEXCore::Context::Context *CTX, FEXCore::HLE::SyscallHandler *Handler); + __attribute__((visibility("default"))) FEXCore::CPUID::FunctionResults RunCPUIDFunction(FEXCore::Context::Context *CTX, uint32_t Function, uint32_t Leaf); - void AddNamedRegion(FEXCore::Context::Context *CTX, uintptr_t Base, uintptr_t Length, uintptr_t Offset, const std::string& Name); - void RemoveNamedRegion(FEXCore::Context::Context *CTX, uintptr_t Base, uintptr_t Length); - void SetAOTIRLoader(FEXCore::Context::Context *CTX, std::function(const std::string&)> CacheReader); - bool WriteAOTIR(FEXCore::Context::Context *CTX, std::function(const std::string&)> CacheWriter); - void FlushCodeRange(FEXCore::Core::InternalThreadState *Thread, uint64_t Start, uint64_t Length); + __attribute__((visibility("default"))) void AddNamedRegion(FEXCore::Context::Context *CTX, uintptr_t Base, uintptr_t Length, uintptr_t Offset, const std::string& Name); + __attribute__((visibility("default"))) void RemoveNamedRegion(FEXCore::Context::Context *CTX, uintptr_t Base, uintptr_t Length); + __attribute__((visibility("default"))) void SetAOTIRLoader(FEXCore::Context::Context *CTX, std::function(const std::string&)> CacheReader); + __attribute__((visibility("default"))) bool WriteAOTIR(FEXCore::Context::Context *CTX, std::function(const std::string&)> CacheWriter); + __attribute__((visibility("default"))) void FlushCodeRange(FEXCore::Core::InternalThreadState *Thread, uint64_t Start, uint64_t Length); } diff --git a/External/FEXCore/include/FEXCore/Core/CoreState.h b/External/FEXCore/include/FEXCore/Core/CoreState.h index a3884f4c8..a6e81c36a 100644 --- a/External/FEXCore/include/FEXCore/Core/CoreState.h +++ b/External/FEXCore/include/FEXCore/Core/CoreState.h @@ -51,6 +51,6 @@ namespace FEXCore::Core { constexpr uint64_t PAGE_SIZE = 4096; - std::string_view const& GetFlagName(unsigned Flag); - std::string_view const& GetGRegName(unsigned Reg); + __attribute__((visibility("default"))) std::string_view const& GetFlagName(unsigned Flag); + __attribute__((visibility("default"))) std::string_view const& GetGRegName(unsigned Reg); } diff --git a/External/FEXCore/include/FEXCore/Debug/X86Tables.h b/External/FEXCore/include/FEXCore/Debug/X86Tables.h index c54a88097..0499927af 100644 --- a/External/FEXCore/include/FEXCore/Debug/X86Tables.h +++ b/External/FEXCore/include/FEXCore/Debug/X86Tables.h @@ -455,29 +455,29 @@ constexpr size_t MAX_XOP_GROUP_TABLE_SIZE = (1 << 6); constexpr size_t MAX_EVEX_TABLE_SIZE = 256; -extern X86InstInfo BaseOps[MAX_PRIMARY_TABLE_SIZE]; -extern X86InstInfo SecondBaseOps[MAX_SECOND_TABLE_SIZE]; -extern X86InstInfo RepModOps[MAX_REP_MOD_TABLE_SIZE]; -extern X86InstInfo RepNEModOps[MAX_REPNE_MOD_TABLE_SIZE]; -extern X86InstInfo OpSizeModOps[MAX_OPSIZE_MOD_TABLE_SIZE]; -extern X86InstInfo PrimaryInstGroupOps[MAX_INST_GROUP_TABLE_SIZE]; -extern X86InstInfo SecondInstGroupOps[MAX_INST_SECOND_GROUP_TABLE_SIZE]; -extern X86InstInfo SecondModRMTableOps[MAX_SECOND_MODRM_TABLE_SIZE]; -extern X86InstInfo X87Ops[MAX_X87_TABLE_SIZE]; -extern X86InstInfo DDDNowOps[MAX_3DNOW_TABLE_SIZE]; -extern X86InstInfo H0F38TableOps[MAX_0F_38_TABLE_SIZE]; -extern X86InstInfo H0F3ATableOps[MAX_0F_3A_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo BaseOps[MAX_PRIMARY_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo SecondBaseOps[MAX_SECOND_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo RepModOps[MAX_REP_MOD_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo RepNEModOps[MAX_REPNE_MOD_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo OpSizeModOps[MAX_OPSIZE_MOD_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo PrimaryInstGroupOps[MAX_INST_GROUP_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo SecondInstGroupOps[MAX_INST_SECOND_GROUP_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo SecondModRMTableOps[MAX_SECOND_MODRM_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo X87Ops[MAX_X87_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo DDDNowOps[MAX_3DNOW_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo H0F38TableOps[MAX_0F_38_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo H0F3ATableOps[MAX_0F_3A_TABLE_SIZE]; // VEX -extern X86InstInfo VEXTableOps[MAX_VEX_TABLE_SIZE]; -extern X86InstInfo VEXTableGroupOps[MAX_VEX_GROUP_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo VEXTableOps[MAX_VEX_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo VEXTableGroupOps[MAX_VEX_GROUP_TABLE_SIZE]; // XOP -extern X86InstInfo XOPTableOps[MAX_XOP_TABLE_SIZE]; -extern X86InstInfo XOPTableGroupOps[MAX_XOP_GROUP_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo XOPTableOps[MAX_XOP_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo XOPTableGroupOps[MAX_XOP_GROUP_TABLE_SIZE]; // EVEX -extern X86InstInfo EVEXTableOps[MAX_EVEX_TABLE_SIZE]; +extern __attribute__((visibility("default"))) X86InstInfo EVEXTableOps[MAX_EVEX_TABLE_SIZE]; -void InitializeInfoTables(Context::OperatingMode Mode); +__attribute__((visibility("default"))) void InitializeInfoTables(Context::OperatingMode Mode); } diff --git a/External/FEXCore/include/FEXCore/IR/IR.h b/External/FEXCore/include/FEXCore/IR/IR.h index feb013285..b2d0a4fd6 100644 --- a/External/FEXCore/include/FEXCore/IR/IR.h +++ b/External/FEXCore/include/FEXCore/IR/IR.h @@ -465,8 +465,8 @@ public: class IRListView; class IREmitter; -void Dump(std::stringstream *out, IRListView const* IR, IR::RegisterAllocationData *RAData); -IREmitter* Parse(std::istream *in); +__attribute__((visibility("default"))) void Dump(std::stringstream *out, IRListView const* IR, IR::RegisterAllocationData *RAData); +__attribute__((visibility("default"))) IREmitter* Parse(std::istream *in); template inline uint32_t NodeWrapperBase::ID() const { return NodeOffset / sizeof(IR::OrderedNode); } diff --git a/External/FEXCore/include/FEXCore/Utils/ELFLoader.h b/External/FEXCore/include/FEXCore/Utils/ELFLoader.h index ce8f48a31..8b7dbfa71 100644 --- a/External/FEXCore/include/FEXCore/Utils/ELFLoader.h +++ b/External/FEXCore/include/FEXCore/Utils/ELFLoader.h @@ -28,7 +28,7 @@ struct ELFSymbol { char const *Name; }; -class ELFContainer { +class __attribute__((visibility("default"))) ELFContainer { public: ELFContainer(std::string const &Filename, std::string const &RootFS, bool CustomInterpreter); ~ELFContainer(); diff --git a/External/FEXCore/include/FEXCore/Utils/ELFSymbolDatabase.h b/External/FEXCore/include/FEXCore/Utils/ELFSymbolDatabase.h index 785506b9b..0972ae26f 100644 --- a/External/FEXCore/include/FEXCore/Utils/ELFSymbolDatabase.h +++ b/External/FEXCore/include/FEXCore/Utils/ELFSymbolDatabase.h @@ -4,7 +4,7 @@ #include namespace ELFLoader { -class ELFSymbolDatabase final { +class __attribute__((visibility("default"))) ELFSymbolDatabase final { public: ELFSymbolDatabase(::ELFLoader::ELFContainer *file); ~ELFSymbolDatabase(); diff --git a/External/FEXCore/include/FEXCore/Utils/LogManager.h b/External/FEXCore/include/FEXCore/Utils/LogManager.h index ab8b3e09f..47cb3db5b 100644 --- a/External/FEXCore/include/FEXCore/Utils/LogManager.h +++ b/External/FEXCore/include/FEXCore/Utils/LogManager.h @@ -18,8 +18,8 @@ constexpr DebugLevels MSG_LEVEL = INFO; namespace Throw { using ThrowHandler = void(*)(char const *Message); -void InstallHandler(ThrowHandler Handler); -void UnInstallHandlers(); +__attribute__((visibility("default"))) void InstallHandler(ThrowHandler Handler); +__attribute__((visibility("default"))) void UnInstallHandlers(); [[noreturn]] void M(const char *fmt, va_list args); @@ -40,10 +40,10 @@ static inline void A(bool, const char*, ...) {} namespace Msg { using MsgHandler = void(*)(DebugLevels Level, char const *Message); -void InstallHandler(MsgHandler Handler); -void UnInstallHandlers(); +__attribute__((visibility("default"))) void InstallHandler(MsgHandler Handler); +__attribute__((visibility("default"))) void UnInstallHandlers(); -void M(DebugLevels Level, const char *fmt, va_list args); +__attribute__((visibility("default"))) void M(DebugLevels Level, const char *fmt, va_list args); #if defined(ASSERTIONS_ENABLED) && ASSERTIONS_ENABLED static inline void A(const char *fmt, ...) {