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

libopencl-clang.so cannot be linked on Fedora 32 and rawhide #108

Open
JacekDanecki opened this issue Feb 17, 2020 · 1 comment
Open

libopencl-clang.so cannot be linked on Fedora 32 and rawhide #108

JacekDanecki opened this issue Feb 17, 2020 · 1 comment

Comments

@JacekDanecki
Copy link

JacekDanecki commented Feb 17, 2020

Starting with (clang-10.0.0-0.2.rc1.fc32](https://koji.fedoraproject.org/koji/buildinfo?buildID=1458974) libopencl-clang.so cannot be linked because of missing libraries. The same issue with newer clang package reproduced in copr build.
More details about clang in Fedora 32: https://lists.fedoraproject.org/archives/list/[email protected]/thread/7YQGZ2RQUNJCD7QA37AVVJQF4F4QCPXL/

[ 94%] Linking CXX shared library libopencl-clang.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/opencl-clang.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNDEBUG  -Wl,-rpath-link,  -Wl,-O3 -Wl,--no-undefined -Wl,-Bsymbolic -Wl,--version-script=/root/rpmbuild/BUILD/opencl-clang-0a5a9f67b56431ef7b9436d1af812df6dfb44975/common_clang.map -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared -Wl,-soname,libopencl-clang.so.10 -o libopencl-clang.so.10 CMakeFiles/opencl-clang.dir/common_clang.cpp.o CMakeFiles/opencl-clang.dir/options.cpp.o CMakeFiles/opencl-clang.dir/pch_mgr.cpp.o CMakeFiles/opencl-clang.dir/options_compile.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c.h.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-base.h.cpp.o   -L/usr/lib64/lib64  -Wl,-rpath,"\$ORIGIN/../lib64" -lclangBasic -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangCodeGen -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangFrontend -lclangDriver -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -lclangBasic -ldl -lLLVMSPIRVLib /usr/lib64/libLLVM-10.so -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -ldl -lLLVMSPIRVLib 
/usr/bin/ld: cannot find -lclangBasic
/usr/bin/ld: cannot find -lclangCodeGen
/usr/bin/ld: cannot find -lclangDriver
/usr/bin/ld: cannot find -lclangFrontend
/usr/bin/ld: cannot find -lclangFrontendTool
/usr/bin/ld: cannot find -lclangCodeGen
/usr/bin/ld: cannot find -lclangRewriteFrontend
/usr/bin/ld: cannot find -lclangARCMigrate
/usr/bin/ld: cannot find -lclangStaticAnalyzerFrontend
/usr/bin/ld: cannot find -lclangStaticAnalyzerCheckers
/usr/bin/ld: cannot find -lclangStaticAnalyzerCore
/usr/bin/ld: cannot find -lclangCrossTU
/usr/bin/ld: cannot find -lclangIndex
/usr/bin/ld: cannot find -lclangFrontend
/usr/bin/ld: cannot find -lclangDriver
/usr/bin/ld: cannot find -lclangParse
/usr/bin/ld: cannot find -lclangSerialization
/usr/bin/ld: cannot find -lclangSema
/usr/bin/ld: cannot find -lclangAnalysis
/usr/bin/ld: cannot find -lclangEdit
/usr/bin/ld: cannot find -lclangFormat
/usr/bin/ld: cannot find -lclangToolingInclusions
/usr/bin/ld: cannot find -lclangToolingCore
/usr/bin/ld: cannot find -lclangRewrite
/usr/bin/ld: cannot find -lclangASTMatchers
/usr/bin/ld: cannot find -lclangAST
/usr/bin/ld: cannot find -lclangLex
/usr/bin/ld: cannot find -lclangBasic
/usr/bin/ld: cannot find -lclangCodeGen
/usr/bin/ld: cannot find -lclangDriver
/usr/bin/ld: cannot find -lclangFrontend
/usr/bin/ld: cannot find -lclangFrontendTool
/usr/bin/ld: cannot find -lclangRewriteFrontend
/usr/bin/ld: cannot find -lclangARCMigrate
/usr/bin/ld: cannot find -lclangStaticAnalyzerFrontend
/usr/bin/ld: cannot find -lclangStaticAnalyzerCheckers
/usr/bin/ld: cannot find -lclangStaticAnalyzerCore
/usr/bin/ld: cannot find -lclangCrossTU
/usr/bin/ld: cannot find -lclangIndex
/usr/bin/ld: cannot find -lclangParse
/usr/bin/ld: cannot find -lclangSerialization
/usr/bin/ld: cannot find -lclangSema
/usr/bin/ld: cannot find -lclangAnalysis
/usr/bin/ld: cannot find -lclangEdit
/usr/bin/ld: cannot find -lclangFormat
/usr/bin/ld: cannot find -lclangToolingInclusions
/usr/bin/ld: cannot find -lclangToolingCore
/usr/bin/ld: cannot find -lclangRewrite
/usr/bin/ld: cannot find -lclangASTMatchers
/usr/bin/ld: cannot find -lclangAST
/usr/bin/ld: cannot find -lclangLex
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/opencl-clang.dir/build.make:175: libopencl-clang.so.10] Error 1
make[2]: Leaving directory '/root/rpmbuild/BUILD/opencl-clang-0a5a9f67b56431ef7b9436d1af812df6dfb44975/build'
make[1]: *** [CMakeFiles/Makefile2:235: CMakeFiles/opencl-clang.dir/all] Error 2
make: *** [Makefile:133: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.iV4OfP (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.iV4OfP (%build)

Libraries in clang-libs package:

$ rpm -ql clang-libs | grep so.10
/usr/lib64/libclang-cpp.so.10
/usr/lib64/libclang.so.10
@JacekDanecki JacekDanecki changed the title libopencl-clang.so cannot be linked on Fedora rawhide libopencl-clang.so cannot be linked on Fedora 32 and rawhide Mar 2, 2020
@JacekDanecki
Copy link
Author

When I replace list of clang libraries with clang-cpp library libopencl-clang.so.10 can be linked correctly

[ 70%] Linking CXX shared library libopencl-clang.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/opencl-clang.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNDEBUG  -Wl,-rpath-link,  -Wl,-O3 -Wl,--no-undefined -Wl,-Bsymbolic -Wl,--version-script=/root/rpmbuild/BUILD/opencl-clang-0a5a9f67b56431ef7b9436d1af812df6dfb44975/common_clang.map -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared -Wl,-soname,libopencl-clang.so.10 -o libopencl-clang.so.10 CMakeFiles/opencl-clang.dir/common_clang.cpp.o CMakeFiles/opencl-clang.dir/options.cpp.o CMakeFiles/opencl-clang.dir/pch_mgr.cpp.o CMakeFiles/opencl-clang.dir/options_compile.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c.h.cpp.o cl_headers/CMakeFiles/cl_headers.dir/opencl-c-base.h.cpp.o   -L/usr/lib64/lib64  -Wl,-rpath,"\$ORIGIN/../lib64" -lclang-cpp -ldl -lLLVMSPIRVLib /usr/lib64/libLLVM-10.so 
/usr/bin/cmake -E cmake_symlink_library libopencl-clang.so.10 libopencl-clang.so.10 libopencl-clang.so
make[2]: Leaving directory '/root/rpmbuild/BUILD/opencl-clang-0a5a9f67b56431ef7b9436d1af812df6dfb44975/build'
[100%] Built target opencl-clang

Output from ldd

$ ldd ./libopencl-clang.so.10
        linux-vdso.so.1 (0x00007ffd08b9d000)
        libclang-cpp.so.10 => /lib64/libclang-cpp.so.10 (0x00007fbffcf20000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fbffcf19000)
        libLLVMSPIRVLib.so.10 => /lib64/libLLVMSPIRVLib.so.10 (0x00007fbffcbc2000)
        libLLVM-10.so => /lib64/libLLVM-10.so (0x00007fbff7e54000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fbff7c64000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbff7c49000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fbff7a7d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbff7a5b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fbfffe2f000)
        libffi.so.6 => /lib64/libffi.so.6 (0x00007fbff7a50000)
        libedit.so.0 => /lib64/libedit.so.0 (0x00007fbff7a13000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fbff79f9000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fbff79ca000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fbff7883000)

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

1 participant