[llvm] Add symbol visibility macros to abi-breaking.h.cmake (PR #110898)
Thomas Fransham via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 10:25:50 PDT 2024
https://github.com/fsfod created https://github.com/llvm/llvm-project/pull/110898
Annotating these symbols will fix missing symbols errors for Bugpoint when when the default symbol visibility is set to hidden for LLVM.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
>From d6e3928e7435677791b0880534c35519f3d1149b Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 12 Oct 2023 00:30:28 +0000
Subject: [PATCH] Add symbol visibility macros to abi-breaking.h.cmake
Annotating these symbols will fix missing symbols errors for Bugpoint when
when the default symbol visibility is set to hidden for LLVM.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
---
llvm/include/llvm/Config/abi-breaking.h.cmake | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/Config/abi-breaking.h.cmake b/llvm/include/llvm/Config/abi-breaking.h.cmake
index 2d27e02b1d5457..81495f0569752c 100644
--- a/llvm/include/llvm/Config/abi-breaking.h.cmake
+++ b/llvm/include/llvm/Config/abi-breaking.h.cmake
@@ -12,6 +12,8 @@
#ifndef LLVM_ABI_BREAKING_CHECKS_H
#define LLVM_ABI_BREAKING_CHECKS_H
+#include "llvm/Support/Compiler.h"
+
/* Define to enable checks that alter the LLVM C++ ABI */
#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
@@ -43,12 +45,12 @@
#endif
namespace llvm {
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
-extern int EnableABIBreakingChecks;
+LLVM_ABI extern int EnableABIBreakingChecks;
LLVM_HIDDEN_VISIBILITY
__attribute__((weak)) int *VerifyEnableABIBreakingChecks =
&EnableABIBreakingChecks;
#else
-extern int DisableABIBreakingChecks;
+LLVM_ABI extern int DisableABIBreakingChecks;
LLVM_HIDDEN_VISIBILITY
__attribute__((weak)) int *VerifyDisableABIBreakingChecks =
&DisableABIBreakingChecks;
More information about the llvm-commits
mailing list