Skip to content

Commit

Permalink
Explicitly force default visibility for llvm::ErrorInfoBase
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Dec 7, 2023
1 parent b673be6 commit 4ac8e22
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ffi/memorymanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@

#pragma once

// Force default visibility of the llvm::ErrorInfoBase class. The conda
// compilers use the -fvisibility-inlines-hidden flag, which seems to
// erroneously result in ErrorInfoBase::isA() being hidden (and not exported) on
// PowerPC. The reason for this is not conclusively known, but the circumstances
// appear similar to those reported in GCC Bug 45065
// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45066) - ErrorInfoBase has
// both a template and non-template version, and the non-template version is
// overridden by the derived class ErrorInfo; the template vs. non-template
// versions may have different inlining decisions applied, and this could create
// a similar circumstance to that described in the bug.
//
// The workaround here adds the default visiblity attribute to ErrorInfoBase
// before its definition, which precludes it from being inferred to be hidden
// later on.
#if not defined(_MSC_VER)
namespace llvm {
class __attribute__((visibility("default"))) ErrorInfoBase;
}
#endif

#include "core.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
Expand Down

0 comments on commit 4ac8e22

Please sign in to comment.