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
$<TARGET_FILE:${PROJECT_NAME}_static>)
if(NOT APPLE)
if(APPLE)
target_link_options(
${PROJECT_NAME} PRIVATE
"LINKER:-export-symbols=${CMAKE_CURRENT_SOURCE_DIR}/linker.map")
${PROJECT_NAME}
PRIVATE
"LINKER:-no_weak_exports,-exported_symbols_list,${CMAKE_SOURCE_DIR}/symbols.txt"
)
endif()
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 {
@@ -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 =
node->entryPresent
? std::max(node->entry.pointVersion, node->entry.rangeVersion)