Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failure: error: undefined symbol: sf_parser_init #54195

Open
orbea opened this issue Aug 4, 2024 · 3 comments
Open

Build Failure: error: undefined symbol: sf_parser_init #54195

orbea opened this issue Aug 4, 2024 · 3 comments
Labels
build Issues and PRs related to build files or the CI. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Comments

@orbea
Copy link

orbea commented Aug 4, 2024

Version

d172da8

Platform

Linux gentoo 6.6.43-x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 30 12:29:53 PDT 2024 x86_64 AMD Ryzen 9 7900X 12-Core Processor AuthenticAMD GNU/Linux

Subsystem

ngtcp2

What steps will reproduce the bug?

Compile node, some configurations may avoid this issue somehow?

How often does it reproduce? Is there a required condition?

Always on affected systems.

What is the expected behavior? Why is that the expected behavior?

The compile should succeed without undefined references.

What do you see instead?

The build fails with an undefined reference to sf_parser_dict when compiling node_mksnapshot.

ninja: job failed: clang++ -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed --rtlib=libgcc --unwindlib=libgcc -pthread -rdynamic -Wl,-z,noexecstack -Wl,--whole-archive obj/tools/v8_gypfiles/libv8_snapshot.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,-z,now -Wl,--whole-archive,obj/deps/openssl/libopenssl.a -Wl,--no-whole-archive -m64 -o node_mksnapshot -Wl,--start-group obj/src/node_mksnapshot.node_snapshot_stub.o obj/tools/snapshot/node_mksnapshot.node_mksnapshot.o obj/libnode.a obj/deps/histogram/libhistogram.a obj/deps/sqlite/libsqlite.a obj/deps/ada/libada.a obj/deps/nbytes/libnbytes.a obj/deps/simdjson/libsimdjson.a obj/deps/simdutf/libsimdutf.a obj/deps/ncrypto/libncrypto.a obj/tools/v8_gypfiles/libv8_snapshot.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/deps/llhttp/libllhttp.a obj/deps/uvwasi/libuvwasi.a obj/deps/openssl/libopenssl.a obj/deps/ngtcp2/libnghttp3.a obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_abseil.a obj/tools/v8_gypfiles/libv8_zlib.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_turboshaft.a obj/tools/v8_gypfiles/libv8_initializers.a obj/tools/v8_gypfiles/libv8_initializers_slow.a obj/deps/ngtcp2/libngtcp2.a  -lz -luv -lsimdjson -lbrotlidec -lbrotlienc -lcares -lnghttp2 -lngtcp2 -lsqlite3 -licui18n -licuuc -licudata -latomic -ldl -Wl,--end-group
ld.lld: error: undefined symbol: sf_parser_init
>>> referenced by nghttp3_http.c
>>>               nghttp3/lib/nghttp3.nghttp3_http.o:(nghttp3_http_parse_priority) in archive obj/deps/ngtcp2/libnghttp3.a

ld.lld: error: undefined symbol: sf_parser_dict
>>> referenced by nghttp3_http.c
>>>               nghttp3/lib/nghttp3.nghttp3_http.o:(nghttp3_http_parse_priority) in archive obj/deps/ngtcp2/libnghttp3.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: subcommands failed

Additional information

The missing function is in deps/ngtcp2/nghttp3/lib/sfparse.c

void sf_parser_init(sf_parser *sfp, const uint8_t *data, size_t datalen) {
if (datalen == 0) {
sfp->pos = sfp->end = NULL;
} else {
sfp->pos = data;
sfp->end = data + datalen;
}
sfp->state = SF_STATE_INITIAL;
}

This file is commented in deps/ngtcp2/ngtcp2.gyp.

# sfparse is also used by nghttp2 and is included by nghttp2.gyp
# 'nghttp3/lib/sfparse.c'

The simple solution would be to uncomment it.

@orbea
Copy link
Author

orbea commented Aug 4, 2024

This was also reported for the Gentoo issue tracker.

https://bugs.gentoo.org/932534

@RedYetiDev
Copy link
Member

The proposed patch would be:

--- a/deps/ngtcp2/ngtcp2.gyp
+++ b/deps/ngtcp2/ngtcp2.gyp
@@ -81,7 +81,7 @@
       'nghttp3/lib/nghttp3_vec.c',
       'nghttp3/lib/nghttp3_version.c',
       # sfparse is also used by nghttp2 and is included by nghttp2.gyp
-      # 'nghttp3/lib/sfparse.c'
+      'nghttp3/lib/sfparse.c'
     ]
   },
   'targets': [

@RedYetiDev RedYetiDev added the quic Issues and PRs related to the QUIC implementation / HTTP/3. label Aug 5, 2024
@RedYetiDev
Copy link
Member

CC @nodejs/quic

@VoltrexKeyva VoltrexKeyva added the build Issues and PRs related to build files or the CI. label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. quic Issues and PRs related to the QUIC implementation / HTTP/3.
Projects
None yet
Development

No branches or pull requests

3 participants