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

Add lzstd to target compilation #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gpetrousov
Copy link

Hey,

Thanks for the article.
I think some functions were moved to a different library and the compilation breaks without them.

make all
...
clang++  -gfull -o parser parser.o codegen.o main.o tokens.o corefn.o native.o  `llvm-config --libs` `llvm-config --ldflags` -lpthread -ldl -lz -lncurses -rdynamic
/bin/ld: /usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::compression::zstd::compress(llvm::ArrayRef<unsigned char>, llvm::SmallVectorImpl<unsigned char>&, int)':
(.text._ZN4llvm11compression4zstd8compressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEi+0x1d): undefined reference to `ZSTD_compressBound'
/bin/ld: (.text._ZN4llvm11compression4zstd8compressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEi+0x47): undefined reference to `ZSTD_compress'
/bin/ld: (.text._ZN4llvm11compression4zstd8compressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEi+0x53): undefined reference to `ZSTD_isError'
/bin/ld: /usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::compression::zstd::uncompress(llvm::ArrayRef<unsigned char>, unsigned char*, unsigned long&)':
(.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEEPhRm+0x32): undefined reference to `ZSTD_decompress'
/bin/ld: (.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEEPhRm+0x42): undefined reference to `ZSTD_isError'
/bin/ld: (.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEEPhRm+0x89): undefined reference to `ZSTD_getErrorName'
/bin/ld: /usr/lib/libLLVMSupport.a(Compression.cpp.o): in function `llvm::compression::zstd::uncompress(llvm::ArrayRef<unsigned char>, llvm::SmallVectorImpl<unsigned char>&, unsigned long)'
:
(.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEm+0x59): undefined reference to `ZSTD_decompress'
/bin/ld: (.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEm+0x65): undefined reference to `ZSTD_isError'
/bin/ld: (.text._ZN4llvm11compression4zstd10uncompressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEm+0xbb): undefined reference to `ZSTD_getErrorName'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:31: parser] Error 1

I added the -lzstd flag which seems to have resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant