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

Compiled LLVM 7.0, but cannot ciompile this project #11

Open
liuxuan30 opened this issue Jan 8, 2019 · 1 comment
Open

Compiled LLVM 7.0, but cannot ciompile this project #11

liuxuan30 opened this issue Jan 8, 2019 · 1 comment

Comments

@liuxuan30
Copy link

Not sure if it's LLVM version issue. Any plan to upgrade the support for LLVM, or we have to use 3.9? Thanks

XuanLiuLaptop:class-dump-swift-master xuanliu$ make
clang main.mm Demangle.cpp Punycode.cpp -std=c++11 `llvm-config --libs` `llvm-config --cxxflags` `llvm-config --ldflags` -lstdc++ -lncurses -o swiftd
Demangle.cpp:282:11: warning: enumeration value 'DestructiveInjectEnumTag' not handled in switch [-Wswitch]
  switch (k) {
          ^
Demangle.cpp:282:11: note: add missing switch cases
  switch (k) {
          ^
Demangle.cpp:2400:22: warning: 8 enumeration values not handled in switch: 'ReflectionMetadataBuiltinDescriptor',
      'ReflectionMetadataFieldDescriptor', 'ReflectionMetadataAssocTypeDescriptor'... [-Wswitch]
    switch (pointer->getKind()) {
                     ^
Demangle.cpp:2400:22: note: add missing switch cases
    switch (pointer->getKind()) {
                     ^
Demangle.cpp:2929:11: warning: 8 enumeration values not handled in switch: 'ReflectionMetadataBuiltinDescriptor',
      'ReflectionMetadataFieldDescriptor', 'ReflectionMetadataAssocTypeDescriptor'... [-Wswitch]
  switch (kind) {
          ^
Demangle.cpp:2929:11: note: add missing switch cases
  switch (kind) {
          ^
3 warnings generated.
Undefined symbols for architecture x86_64:
  "_compress2", referenced from:
      llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl<char>&, llvm::zlib::CompressionLevel) in libLLVMSupport.a(Compression.cpp.o)
  "_compressBound", referenced from:
      llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl<char>&, llvm::zlib::CompressionLevel) in libLLVMSupport.a(Compression.cpp.o)
  "_crc32", referenced from:
      llvm::zlib::crc32(llvm::StringRef) in libLLVMSupport.a(Compression.cpp.o)
  "_uncompress", referenced from:
      llvm::zlib::uncompress(llvm::StringRef, char*, unsigned long&) in libLLVMSupport.a(Compression.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1
@caioremedio
Copy link

caioremedio commented Apr 29, 2019

Use clang++ and add -lz. Should work:

clang++ main.mm Demangle.cpp Punycode.cpp -std=c++11 `llvm-config --libs` `llvm-config --cxxflags` `llvm-config --ldflags` -lstdc++ -lncurses -o swiftd -lz

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

No branches or pull requests

2 participants