kraj / meta-clang

Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
MIT License
160 stars 205 forks source link

libclc with LLVM 14 won't build #603

Closed zboszor closed 2 years ago

zboszor commented 2 years ago

Describe the bug

There's a linker error with LLVM 14 when trying to build libclc:

| [114/2871] : && /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-clang++ -target x86_64-oe-linux  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -target x86_64-oe-linux  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -o prepare_builtins -L/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot/usr/usr/lib  && :
| FAILED: prepare_builtins
| : && /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-clang++ -target x86_64-oe-linux  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -target x86_64-oe-linux  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0=/usr/src/debug/libclc/14.0.0-r0                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -o prepare_builtins -L/data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot/usr/usr/lib  && :
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: DWARF error: invalid or unhandled FORM value: 0x23
| CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `main':
| prepare-builtins.cpp:(.text+0x2d): undefined reference to `llvm::LLVMContext::LLVMContext()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x4f): undefined reference to `llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, char const*, bool)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0xa3): undefined reference to `llvm::MemoryBuffer::getFile(llvm::Twine const&, bool, bool, bool)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0xbd): undefined reference to `llvm::MemoryBuffer::getMemBufferRef() const'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0xef): undefined reference to `llvm::parseBitcodeFile(llvm::MemoryBufferRef, llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (llvm::StringRef)>)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x130): undefined reference to `llvm::Module::~Module()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x1d4): undefined reference to `llvm::errorToErrorCodeAndEmitErrors(llvm::LLVMContext&, llvm::Error)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x2e7): undefined reference to `llvm::Module::getNamedMetadata(llvm::Twine const&) const'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x2f7): undefined reference to `llvm::Module::eraseNamedMetadata(llvm::NamedMDNode*)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x328): undefined reference to `llvm::GlobalValue::isDeclaration() const'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x378): undefined reference to `llvm::GlobalValue::isDeclaration() const'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x3e6): undefined reference to `llvm::ToolOutputFile::ToolOutputFile(llvm::StringRef, std::error_code&, llvm::sys::fs::OpenFlags)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x40d): undefined reference to `llvm::WriteBitcodeToFile(llvm::Module const&, llvm::raw_ostream&, bool, llvm::ModuleSummaryIndex const*, bool, std::array<unsigned int, 5ul>*)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x426): undefined reference to `llvm::raw_fd_ostream::~raw_fd_ostream()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x435): undefined reference to `llvm::ToolOutputFile::CleanupInstaller::~CleanupInstaller()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x447): undefined reference to `llvm::errs()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x47b): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x485): undefined reference to `llvm::errs()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x4e4): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x4fd): undefined reference to `llvm::errs()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x51a): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x585): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x5e0): undefined reference to `llvm::llvm_shutdown()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x5ea): undefined reference to `llvm::LLVMContext::~LLVMContext()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text+0x68c): undefined reference to `llvm::errs()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `llvm::cl::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~opt()':
| prepare-builtins.cpp:(.text._ZN4llvm2cl3optINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ENS0_6parserIS7_EEED2Ev[_ZN4llvm2cl3optINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ENS0_6parserIS7_EEED2Ev]+0x7): undefined reference to `vtable for llvm::cl::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text._ZN4llvm2cl3optINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ENS0_6parserIS7_EEED2Ev[_ZN4llvm2cl3optINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ENS0_6parserIS7_EEED2Ev]+0x70): undefined reference to `vtable for llvm::cl::Option'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `llvm::raw_ostream::operator<<(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
| prepare-builtins.cpp:(.text._ZN4llvm11raw_ostreamlsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4llvm11raw_ostreamlsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xb): undefined reference to `llvm::raw_ostream::write(char const*, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `llvm::raw_ostream::operator<<(char)':
| prepare-builtins.cpp:(.text._ZN4llvm11raw_ostreamlsEc[_ZN4llvm11raw_ostreamlsEc]+0x1e): undefined reference to `llvm::raw_ostream::write(unsigned char)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `llvm::cl::Option::Option(llvm::cl::NumOccurrencesFlag, llvm::cl::OptionHidden)':
| prepare-builtins.cpp:(.text._ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE[_ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE]+0xa): undefined reference to `vtable for llvm::cl::Option'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text._ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE[_ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE]+0x9e): undefined reference to `llvm::cl::getGeneralCategory()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text._ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE[_ZN4llvm2cl6OptionC2ENS0_18NumOccurrencesFlagENS0_12OptionHiddenE]+0xe1): undefined reference to `llvm::SmallVectorBase<unsigned int>::grow_pod(void*, unsigned long, unsigned long)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o: in function `_GLOBAL__sub_I_prepare_builtins.cpp':
| prepare-builtins.cpp:(.text.startup+0x85): undefined reference to `vtable for llvm::cl::OptionValue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text.startup+0x97): undefined reference to `vtable for llvm::cl::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text.startup+0xa9): undefined reference to `vtable for llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text.startup+0x116): undefined reference to `llvm::cl::Option::addArgument()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text.startup+0x1d1): undefined reference to `llvm::cl::Option::setArgStr(llvm::StringRef)'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: prepare-builtins.cpp:(.text.startup+0x20b): undefined reference to `llvm::cl::Option::addArgument()'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o:(.data+0x0): undefined reference to `llvm::DisableABIBreakingChecks'
| /data/genericx86-64-yocto-3.5/tmp-sicom-glibc/work/core2-64-oe-linux/libclc/14.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-ld: CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o:(.data.rel.ro._ZTVN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTVN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x18): undefined reference to `llvm::cl::GenericOptionValue::anchor()'
| clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce Steps to reproduce the behavior:

  1. bitbake libclc or enable opencl PACKAGECONFIG for mesa in Yocto 4.0 master

Expected behavior libclc should build without errors.

kraj commented 2 years ago

Interesting, I can build it fine for qemux86-64 using latest meta-clang/master branch. Can you confirm that issue exists with latest top of trunk meta-clang ?

zboszor commented 2 years ago

Previous build was using 42dd5484867b772767a33340ee219fb9f42799e4. Trying now with 17a6480b5e03a73d38b2d26c072aa51957ae747d. I am using genericx86-64 from meta-yocto, or intel-corei7-64 from meta-intel. These machine setting should make no difference compared to qemux86-64.

zboszor commented 2 years ago

17a6480b5e03a73d38b2d26c072aa51957ae747d fixed this linker error.