Skip to content

Commit 76e4503

Browse files
committed
Revert "Export std hash template specializations from dylibs (#7618)"
This reverts commit 1625f5b.
1 parent cc1cc3d commit 76e4503

File tree

4 files changed

+9
-34
lines changed

4 files changed

+9
-34
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,6 @@ if(BUILD_STATIC_LIB)
462462
else()
463463
message(STATUS "Building libbinaryen as shared library.")
464464
add_library(binaryen SHARED)
465-
if(LINUX)
466-
# Disable interposition and resolve Binaryen symbols locally.
467-
add_link_flag("-Bsymbolic")
468-
endif()
469465
endif()
470466
target_link_libraries(binaryen Threads::Threads)
471467
if(BUILD_LLVM_DWARF)

src/compiler-support.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,4 @@
3131
#define WASM_BUILTIN_UNREACHABLE __assume(false)
3232
#endif
3333

34-
// Forces symbols to be exported from libbinaryen dynamic library. Currently
35-
// we are just using the default flags, causing most of our symbols to have
36-
// "default" visibility, meaning they can all be used from the tool sources.
37-
// However a recent libc++ change caused functions declared in namespace std
38-
// (e.g. hash template specializations) to have hidden visibility, inherited.
39-
// from the namespece (see https://github.com/llvm/llvm-project/pull/131156).
40-
// So this macro forces them to be exported. Currently it is only applied to
41-
// the hash specializations that are defined in libbinaryen and used in the
42-
// tool code. In the future if we want to compile libbinaryen with
43-
// -fvisibility-hidden or use a DLL on Windows, we'll need
44-
// to explicitly annotate everything we want to export. But that's probably
45-
// only useful if we want external users to link against libbinaryen.so
46-
// (currently we don't; it's only used to reduce our install size).
47-
#if defined(__ELF__) || defined(__MACH__)
48-
#define DLLEXPORT [[gnu::visibility("default")]]
49-
#else
50-
#define DLLEXPORT
51-
#endif
52-
5334
#endif // wasm_compiler_support_h

src/wasm-type-shape.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <functional>
2121
#include <vector>
2222

23-
#include "compiler-support.h"
2423
#include "wasm-features.h"
2524
#include "wasm-type.h"
2625

@@ -75,7 +74,7 @@ namespace std {
7574

7675
template<> class hash<wasm::RecGroupShape> {
7776
public:
78-
DLLEXPORT size_t operator()(const wasm::RecGroupShape& shape) const;
77+
size_t operator()(const wasm::RecGroupShape& shape) const;
7978
};
8079

8180
} // namespace std

src/wasm-type.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <variant>
2626
#include <vector>
2727

28-
#include "compiler-support.h"
2928
#include "support/index.h"
3029
#include "support/name.h"
3130
#include "support/parent_index_iterator.h"
@@ -1006,35 +1005,35 @@ namespace std {
10061005

10071006
template<> class hash<wasm::Type> {
10081007
public:
1009-
DLLEXPORT size_t operator()(const wasm::Type&) const;
1008+
size_t operator()(const wasm::Type&) const;
10101009
};
10111010
template<> class hash<wasm::Signature> {
10121011
public:
1013-
DLLEXPORT size_t operator()(const wasm::Signature&) const;
1012+
size_t operator()(const wasm::Signature&) const;
10141013
};
10151014
template<> class hash<wasm::Continuation> {
10161015
public:
1017-
DLLEXPORT size_t operator()(const wasm::Continuation&) const;
1016+
size_t operator()(const wasm::Continuation&) const;
10181017
};
10191018
template<> class hash<wasm::Field> {
10201019
public:
1021-
DLLEXPORT size_t operator()(const wasm::Field&) const;
1020+
size_t operator()(const wasm::Field&) const;
10221021
};
10231022
template<> class hash<wasm::Struct> {
10241023
public:
1025-
DLLEXPORT size_t operator()(const wasm::Struct&) const;
1024+
size_t operator()(const wasm::Struct&) const;
10261025
};
10271026
template<> class hash<wasm::Array> {
10281027
public:
1029-
DLLEXPORT size_t operator()(const wasm::Array&) const;
1028+
size_t operator()(const wasm::Array&) const;
10301029
};
10311030
template<> class hash<wasm::HeapType> {
10321031
public:
1033-
DLLEXPORT size_t operator()(const wasm::HeapType&) const;
1032+
size_t operator()(const wasm::HeapType&) const;
10341033
};
10351034
template<> class hash<wasm::RecGroup> {
10361035
public:
1037-
DLLEXPORT size_t operator()(const wasm::RecGroup&) const;
1036+
size_t operator()(const wasm::RecGroup&) const;
10381037
};
10391038

10401039
} // namespace std

0 commit comments

Comments
 (0)