Comments (3)
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.
Strange but as long as they are on it, ok.
from llvm-mingw.
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)
- Unable to run the latest docker image HOT 3
- Microsoft Defender reports Trojan in Release llvm-mingw-20231128-msvcrt-i686.zip llvm-size.exe HOT 3
- Treat file content as command line (feature request) HOT 2
- `fcloseall()` is missing (feature request) HOT 6
- DLLs should be available via --print-file-name HOT 8
- What is the difference between this llvm distribution and the one installed from msys2 pacman? HOT 3
- adding split debug info to the release? HOT 1
- -O2 -flto -fcs-profile-generate cause undefined symbol
- Missing `windmc.exe` Message Compiler
- Missing LLVM header files in resulting zip when building with FULL_LLVM=1 HOT 1
- Supporting passing .rc and .res files on command line
- Installation HOT 8
- ld.lld.exe segfaulting HOT 4
- Cannot link executable HOT 2
- [C++20] [Modules] ld.lld: error: undefined symbol: initializer for module HOT 11
- "unable to execute command: program not executable" on Windows HOT 4
- `<triple>-c++` wrappers are provided but `<triple>-cc` are not HOT 4
- Triple naming probably unorthodox HOT 4
- typo in python buildscript HOT 1
- Regression: llvm-mingw-20240502-msvcrt i686: duplicate symbol '_time' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm-mingw.