Oleg Smolsky via llvm-dev
2021-Sep-03 18:00 UTC
[llvm-dev] Linking issue with clang/libc++
Folks, I'm hitting a funky issue while building a Boost tool with Clang/libc++. Here is the compiler invocation: $ /opt/llvm-12/bin/clang++ -std=c++11 -O2 -stdlib=libc++ -Wno-mismatched-tags -O2 -s -DNDEBUG builtins.cpp class.cpp ........... pathunix.cpp -o b2 And I get this: /opt/llvm-12/bin/../lib/libc++.so.1: undefined reference to `__divmodti4 at GCC_7.0.0' Clang itself was built with GCC-11... so I fail to understand where this symbol is coming from. Can someone shed some light on this please? Thanks in advance, Oleg. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210903/2901d271/attachment.html>
Anton Korobeynikov via llvm-dev
2021-Sep-03 19:28 UTC
[llvm-dev] Linking issue with clang/libc++
This symbol is a part of compiler runtime. In your case – you need to link libgcc. On Fri, Sep 3, 2021 at 9:01 PM Oleg Smolsky via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Folks, I'm hitting a funky issue while building a Boost tool with Clang/libc++. Here is the compiler invocation: > > $ /opt/llvm-12/bin/clang++ -std=c++11 -O2 -stdlib=libc++ -Wno-mismatched-tags -O2 -s -DNDEBUG builtins.cpp class.cpp ........... pathunix.cpp -o b2 > > And I get this: > > /opt/llvm-12/bin/../lib/libc++.so.1: undefined reference to `__divmodti4 at GCC_7.0.0' > > Clang itself was built with GCC-11... so I fail to understand where this symbol is coming from. Can someone shed some light on this please? > > Thanks in advance, > Oleg. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- With best regards, Anton Korobeynikov Department of Statistical Modelling, Saint Petersburg State University