Skip to content

Commit

Permalink
src: fix clang 14 linker error
Browse files Browse the repository at this point in the history
Compiling with clang 14 on Ubuntu was failing with the following error:

```bash
$ CXX=clang++ CC=clang ./configure --ninja
$ make
<snip>
[7/14] LINK cctest
FAILED: cctest
clang++ <snip>
/usr/bin/ld: obj/src/inspector/libnode.node_string.o: in function `node::inspector::protocol::StringUtil::StringViewToUtf8[abi:cxx11](v8_inspector::StringView)':
node_string.cc:(.text+0x2ce): undefined reference to `node::MaybeStackBuffer<char, 1024ul>::AllocateSufficientStorage(unsigned long)'
/usr/bin/ld: obj/src/inspector/libnode.node_string.o: in function `node::inspector::protocol::StringUtil::fromUTF16[abi:cxx11](unsigned short const*, unsigned long)':
node_string.cc:(.text+0xad9): undefined reference to `node::MaybeStackBuffer<char, 1024ul>::AllocateSufficientStorage(unsigned long)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

I bisected it to the referenced PR. This change includes the header file
which defines `node::MaybeStackBuffer::AllocateSufficientStorage`.

Refs: #46817
  • Loading branch information
kvakil committed Mar 13, 2023
1 parent 2660a32 commit 2e94690
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/inspector/node_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "node/inspector/protocol/Protocol.h"
#include "node_util.h"
#include "simdutf.h"
#include "util-inl.h"

namespace node {
namespace inspector {
Expand Down

0 comments on commit 2e94690

Please sign in to comment.