-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
[suggestion]use configuration file replace clang wrapper #253
Comments
Hi, thanks for the suggestion!
Yup, I've actually experimented with using this a couple years ago already. (I have a PoC branch locally, but it's quite some time since I last rebased and tried it out.) I think the main stumbling block was that it requires symlinks (which I guess are more or less supported in practice on Windows these days, or is that only as administrator and/or if the computer is set up in developer mode? - and they don't work through zip files as I use for distribution, as I want it to be unpackable out of the box without any other tools). Without symlinks, previously it would have caused huge duplication due to making a new copy of a 90 MB clang.exe for each of the frontends. But since switching to building with dylibs in 46efff4, the main clang-14.exe is only 75-110 KB or thereabout, so maybe it could even be tolerable? (The clang-target-wrapper.exe which is duplicated today is 17 KB.)
Do you have any measurement on whether this does affect the total compilation time in some scenario, and how much? I would guess that it has a bigger impact on Windows than on unix, but I'm still curious about how big the impact is.
That shouldn't be an issue, I don't really use that feature in practice
Ok - I guess I can try to fix upstream so that it would recognize c99/c11 too (not sure if upstream would accept handling
This isn't needed any longer; I've fixed this properly upstream now, which will be part of the 14.0.0 release, see https://github.com/llvm/llvm-project/commits/df0ba47c36f6bd0865e3286853b76d37e037c2d7. I pushed a branch
FWIW,
Thanks, the use of |
I experimented with this as well, I used the lookup strategy to separate configs for compiler-type and target. Otherwise, symlinks to clang with the current names should work. ( clang-cpp.cfg
clang.cfg
clang++.cfg
armv7-w64-windows-gnu.cfg
armv7-w64-windows-gnuuwp.cfg
|
FYI, I'm seriously considering taking config files into use - I have a branch prepared for this now, see https://github.com/mstorsjo/llvm-mingw/commits/clang-cfg, and am currently planning on merging this before the next point release in 2 weeks. After fixing a couple of issues around clang-scan-deps, that tool can now also pick up defaults implicitly from config files, so the clang-scan-deps wrapper can be avoided entirely on unix - CC @huangqinjin. By skipping the hardcoded defaults in the clang binary on Windows (which never was strictly needed when we use wrappers anyway), we also ease use of the clangd binary with other mingw toolchains, see #454 (comment). Also CC @alvinhochun, even if this doesn't affect your case in #444. |
I did try merging this, but it uncovered two issues - see e0964ce for references around that. Will try to reapply these changes once we have those two issues sorted out. |
Since e2e9216 and 866d47c (as they were relanded after attempting and reverting before), this change should now be part of the latest release at https://github.com/mstorsjo/llvm-mingw/releases/tag/20241119. Therefore, I'll go ahead and close this issue now. |
via https://clang.llvm.org/docs/UsersManual.html#configuration-files
Using configuration file can reduce one process invoke but no
ccache
support,clang clang++ gcc g++ cc c++
can support configuration file butc99 c11 as
can not.https://reviews.llvm.org/D53066 is needed for windows.
here is a example for
i686-w64-mingw32
andi686-w64-mingw32uwp
.1. Put the following 4 files in the bin directory
2. Create
i686-w64-mingw32-gcc.exe
link toclang.exe
, when runi686-w64-mingw32-gcc.exe
will auto loadi686-w64-mingw32.cfg
, and createi686-w64-mingw32uwp-gcc.exe
link toclang.exe
, when runi686-w64-mingw32-gcc.exe
will auto loadi686-w64-mingw32uwp.cfg
,The text was updated successfully, but these errors were encountered: