Try exported symbols list for Apple

visibility annotations seem to be working for gcc
This commit is contained in:
2024-01-24 15:18:00 -08:00
parent ae528d3f81
commit d76ac2a254
2 changed files with 7 additions and 5 deletions

View File

@@ -61,10 +61,12 @@ add_custom_command(
${CMAKE_OBJCOPY} --keep-global-symbols=${CMAKE_SOURCE_DIR}/symbols.txt ${CMAKE_OBJCOPY} --keep-global-symbols=${CMAKE_SOURCE_DIR}/symbols.txt
$<TARGET_FILE:${PROJECT_NAME}_static>) $<TARGET_FILE:${PROJECT_NAME}_static>)
if(NOT APPLE) if(APPLE)
target_link_options( target_link_options(
${PROJECT_NAME} PRIVATE ${PROJECT_NAME}
"LINKER:-export-symbols=${CMAKE_CURRENT_SOURCE_DIR}/linker.map") PRIVATE
"LINKER:-no_weak_exports,-exported_symbols_list,${CMAKE_SOURCE_DIR}/symbols.txt"
)
endif() endif()
set(TEST_FLAGS -Wall -Wextra -Wpedantic -Wunreachable-code -UNDEBUG) set(TEST_FLAGS -Wall -Wextra -Wpedantic -Wunreachable-code -UNDEBUG)

View File

@@ -1305,7 +1305,7 @@ void printLogical(std::string &result, Node *node) {
} }
} }
void debugPrintDot(FILE *file, Node *node) { [[maybe_unused]] void debugPrintDot(FILE *file, Node *node) {
struct DebugDotPrinter { struct DebugDotPrinter {
@@ -1353,7 +1353,7 @@ void checkParentPointers(Node *node, bool &success) {
} }
} }
int64_t checkMaxVersion(Node *node, bool &success) { [[maybe_unused]] int64_t checkMaxVersion(Node *node, bool &success) {
int64_t expected = int64_t expected =
node->entryPresent node->entryPresent
? std::max(node->entry.pointVersion, node->entry.rangeVersion) ? std::max(node->entry.pointVersion, node->entry.rangeVersion)