Jinyan via llvm-dev
2020-Jul-24 02:17 UTC
[llvm-dev] undefined reference witn DBUILD_SHARED_LIBS
Hi, all: During I merge my out-of-tree pass to in-tree, I meet some problem like following, fpscan is my pass name: If I open DBUILD_SHARED_LIBS option,: [1/2657] Linking CXX shared library lib/libLLVMfpscan.so.11git FAILED: lib/libLLVMfpscan.so.11git : && /usr/bin/c++ -fPIC -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/home/phantom/llvm/build/llvm/./lib -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,libLLVMfpscan.so.11git -o lib/libLLVMfpscan.so.11git lib/Transforms/fpscan/CMakeFiles/LLVMfpscan.dir/fpscan.cpp.o -Wl,-rpath,"\$ORIGIN/../lib" && : lib/Transforms/fpscan/CMakeFiles/LLVMfpscan.dir/fpscan.cpp.o: In function `llvm::fpscan::printLine(llvm::Instruction const*)': fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x19): undefined reference to `llvm::outs()' fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0xf7): undefined reference to `llvm::raw_ostream::operatorfpscan.cpp: fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x16a): undefined reference to `llvm::Value::print(llvm::raw_ostream&, bool) const' fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x1d0): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)' fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x21a): undefined reference to `llvm::MDString::getString() const' fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x271): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)' fpscan.cpp:(.text._ZN4llvm6fpscan9printLineEPKNS_11InstructionE+0x2c3): undefined reference to `llvm::raw_ostream::operatorfpscan.cpp: ... I have include their hear file (I can run out-of-tree), and add require in LLVM builder type = Library name = fpscan parent = Transforms library_name = fpscan required_libraries = Core Support TransformUtils So, I really have no idea why it still can't find the reference, did I still miss something, thks