stoken
stoken copied to clipboard
Version script includes missing symbols
stoken> CCLD libstoken.la
stoken> aarch64-unknown-linux-gnu-ld: error: version script assignment of 'STOKEN_PRIVATE' to symbol 'stoken__strcasestr' failed: symbol not defined
stoken> aarch64-unknown-linux-gnu-ld: error: version script assignment of 'STOKEN_PRIVATE' to symbol 'stoken__mkstemps' failed: symbol not defined
stoken> clang: error: linker command failed with exit code 1 (use -v to see invocation)
stoken> make[1]: *** [Makefile:866: libstoken.la] Error 1
stoken> make[1]: Leaving directory '/build/source'
stoken> make: *** [Makefile:703: all] Error 2
Since LLVM 17, it's linker enforces --no-undefined-version by default. Since the version script includes symbols which may not be defined, this causes issues with LLVM versions 17 and newer. The solution is to generate the version script based on the symbols which are expected to be included.