Skip to content

Commit 3a0dc4f

Browse files
drodriguezfacebook-github-bot
authored andcommitted
Try to workaround LLD for Mach-O exports trie generation error
Summary: There seems to be some kind of exports trie generation error under some circumstances for the library `header_client_channel`. LLD seems to generate a malformed exports trie for it, as one can verify using `llvm-objdump`. ``` llvm-objdump: error: 'buck-out/v2/gen/fbcode/4dabced598179ca5/thrift/lib/cpp2/async/__header_client_channel__/libheader_client_channel-2ed4355.dylib': truncated or malformed object (loop in childern in export trie data at node: 0x5f back to node: 0x13b2) ``` Adding this extra variable should not really affect the export trie (it is not used anywhere, so it is not exported), but it seems to avoid the input values that seems to create an invalid trie. Reviewed By: narissiam Differential Revision: D79464659 fbshipit-source-id: 6fe43ccfc8a8436ca8d949e2124da48cbc8c7832
1 parent b0751ad commit 3a0dc4f

File tree

1 file changed

+4
-0
lines changed
  • third-party/thrift/src/thrift/lib/cpp2/type

1 file changed

+4
-0
lines changed

third-party/thrift/src/thrift/lib/cpp2/type/Protocol.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class Protocol : public detail::Wrap<ProtocolUnion, union_t<ProtocolUnion>> {
111111
// Raises std::invalid_argument on failure.
112112
void validateProtocol(const Protocol& protocol);
113113

114+
// FIXME(T232815335): Need a dummy (unused) variable to fix the exports trie
115+
// generation bug of LLD for Mach-O
116+
inline const void* kDummy = &kDummy;
117+
114118
FOLLY_PUSH_WARNING
115119
FOLLY_CLANG_DISABLE_WARNING("-Wglobal-constructors")
116120
inline const Protocol kNoProtocol = {};

0 commit comments

Comments
 (0)