GithubHelp home page GithubHelp logo

clang_rt obscured about llvm-mingw HOT 3 CLOSED

mstorsjo avatar mstorsjo commented on August 15, 2024
clang_rt obscured

from llvm-mingw.

Comments (3)

mstorsjo avatar mstorsjo commented on August 15, 2024

clang_rt is the correct replacement for libgcc but it is not included with all the rest of the libraries

Neither is libgcc. While compiler_rt builtins are placed in <toolchain>/lib/clang/<clangversion>/lib/windows/libclang_rt.<arch>.a, libgcc is normally placed in e.g. <toolchain>/lib/gcc/<triplet>/<gccversion>/libgcc.a.

The difference lies in the fact that gcc refers to libgcc by adding that directory to the path by passing -L to the linker and then linking to it with -lgcc. Clang on the other hand refers to it with an absolute path to the static library. Upstream is reluctant to changing this even though it also has tripped up some other issues along the way, see https://reviews.llvm.org/D51440.

Also, I think it's worth making a FAQ or wiki so that others don't find this pitfall.

TBH, I don't really see the location of the compiler_rt library being a frequently asked question, as most users won't run into the issue as the compiler automatically adds the argument (unless you explicitly opt out of that with -nostdlib or -nodefaultlibs).

FWIW, libtool does a similar thing in certain cases (linking a shared library that contains C++ code), by first doing a test link using -v, parsing out all the automatically added libs from that, and then linking with -nostdlib and manually adding all the libs that the compiler otherwise would have added (possibly with some amount of filtering of them).

from llvm-mingw.

GravisZro avatar GravisZro commented on August 15, 2024

Strange but as long as they are on it, ok.

from llvm-mingw.

mstorsjo avatar mstorsjo commented on August 15, 2024

Well, I wouldn't call it "on it" in the sense of actually working towards changing it; I see it more like clang upstream is (now) aware that this oddity is causing issues in certain cases, but regards is as "working as intended" and prefers that the kinks are worked around elsewhere. Wrt libtool, it's problematic as libtool upstream is very much stale and patches aren't really being processed and merged.

from llvm-mingw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.