rprichard updated this revision to Diff 321701. rprichard added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Just fix ELF and leave Mach-O as-is. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93003/new/ https://reviews.llvm.org/D93003 Files: clang/cmake/caches/Fuchsia-stage2.cmake libunwind/CMakeLists.txt libunwind/src/CMakeLists.txt libunwind/src/assembly.h libunwind/src/config.h
Index: libunwind/src/config.h =================================================================== --- libunwind/src/config.h +++ libunwind/src/config.h @@ -52,7 +52,7 @@ #endif #endif -#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS) +#if defined(_LIBUNWIND_HIDE_SYMBOLS) #define _LIBUNWIND_EXPORT #define _LIBUNWIND_HIDDEN #else Index: libunwind/src/assembly.h =================================================================== --- libunwind/src/assembly.h +++ libunwind/src/assembly.h @@ -87,17 +87,23 @@ #else #define SYMBOL_IS_FUNC(name) .type name,@function #endif +#if defined(_LIBUNWIND_HIDE_SYMBOLS) +#define EXPORT_SYMBOL(name) .hidden name +#else #define EXPORT_SYMBOL(name) +#endif #define HIDDEN_SYMBOL(name) .hidden name #define WEAK_SYMBOL(name) .weak name #if defined(__hexagon__) -#define WEAK_ALIAS(name, aliasname) \ - WEAK_SYMBOL(aliasname) SEPARATOR \ +#define WEAK_ALIAS(name, aliasname) \ + EXPORT_SYMBOL(SYMBOL_NAME(aliasname)) SEPARATOR \ + WEAK_SYMBOL(SYMBOL_NAME(aliasname)) SEPARATOR \ .equiv SYMBOL_NAME(aliasname), SYMBOL_NAME(name) #else #define WEAK_ALIAS(name, aliasname) \ - WEAK_SYMBOL(aliasname) SEPARATOR \ + EXPORT_SYMBOL(SYMBOL_NAME(aliasname)) SEPARATOR \ + WEAK_SYMBOL(SYMBOL_NAME(aliasname)) SEPARATOR \ SYMBOL_NAME(aliasname) = SYMBOL_NAME(name) #endif @@ -119,7 +125,7 @@ .section .drectve,"yn" SEPARATOR \ .ascii "-export:", #name, "\0" SEPARATOR \ .text -#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS) +#if defined(_LIBUNWIND_HIDE_SYMBOLS) #define EXPORT_SYMBOL(name) #else #define EXPORT_SYMBOL(name) EXPORT_SYMBOL2(name) Index: libunwind/src/CMakeLists.txt =================================================================== --- libunwind/src/CMakeLists.txt +++ libunwind/src/CMakeLists.txt @@ -160,11 +160,11 @@ LINKER_LANGUAGE C OUTPUT_NAME "unwind") - if(LIBUNWIND_HERMETIC_STATIC_LIBRARY) + if(LIBUNWIND_HIDE_SYMBOLS) append_flags_if_supported(UNWIND_STATIC_LIBRARY_FLAGS -fvisibility=hidden) append_flags_if_supported(UNWIND_STATIC_LIBRARY_FLAGS -fvisibility-global-new-delete-hidden) target_compile_options(unwind_static PRIVATE ${UNWIND_STATIC_LIBRARY_FLAGS}) - target_compile_definitions(unwind_static PRIVATE _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS) + target_compile_definitions(unwind_static PRIVATE _LIBUNWIND_HIDE_SYMBOLS) endif() list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_static") Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -101,7 +101,7 @@ message(FATAL_ERROR "LIBUNWIND_BUILD_32_BITS=ON is not supported on this platform.") endif() -option(LIBUNWIND_HERMETIC_STATIC_LIBRARY +option(LIBUNWIND_HIDE_SYMBOLS "Do not export any symbols from the static library." OFF) #=============================================================================== @@ -320,7 +320,7 @@ # Disable DLL annotations on Windows for static builds. if (WIN32 AND LIBUNWIND_ENABLE_STATIC AND NOT LIBUNWIND_ENABLE_SHARED) - add_definitions(-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS) + add_definitions(-D_LIBUNWIND_HIDE_SYMBOLS) endif() if (LIBUNWIND_HAS_COMMENT_LIB_PRAGMA) Index: clang/cmake/caches/Fuchsia-stage2.cmake =================================================================== --- clang/cmake/caches/Fuchsia-stage2.cmake +++ clang/cmake/caches/Fuchsia-stage2.cmake @@ -179,7 +179,7 @@ set(RUNTIMES_${target}-unknown-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") set(RUNTIMES_${target}-unknown-fuchsia_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "") set(RUNTIMES_${target}-unknown-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") - set(RUNTIMES_${target}-unknown-fuchsia_LIBUNWIND_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "") + set(RUNTIMES_${target}-unknown-fuchsia_LIBUNWIND_HIDE_SYMBOLS ON CACHE BOOL "") set(RUNTIMES_${target}-unknown-fuchsia_LIBUNWIND_INSTALL_STATIC_LIBRARY OFF CACHE BOOL "") set(RUNTIMES_${target}-unknown-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") set(RUNTIMES_${target}-unknown-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits