|
|
Home » Developing U++ » U++ Developers corner » Clang / lld
( ) 1 Vote
Clang / lld [message #51614] |
Fri, 19 April 2019 22:50  |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Sat, 13 April 2019 07:07These are things I would like to have solved, but do not have resources to:
- Fix uldar - old U++ linker for mingw by Tomas Rylek, that is superfast (compared to ld.exe supplied with mingw), but unfortunately stopped working around mingw 2012 version. This would make mingw much more attractive for us (well, there is still that poor TLS handling, but maybe that will get solved over time too).
I personally would take a look at LLD first. Gold linker is supposed to be several times faster than ld, but it doesn't support PE/COFF. LLD is supposed to be several times faster than the gold linker, and it supports PE/COFF. So, there is no need to reinvent the wheel.
Regards,
Novo
[Updated on: Wed, 24 April 2019 10:56] by Moderator Report message to a moderator
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51617 is a reply to message #51614] |
Sat, 20 April 2019 00:56   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Fri, 19 April 2019 22:50mirek wrote on Sat, 13 April 2019 07:07These are things I would like to have solved, but do not have resources to:
- Fix uldar - old U++ linker for mingw by Tomas Rylek, that is superfast (compared to ld.exe supplied with mingw), but unfortunately stopped working around mingw 2012 version. This would make mingw much more attractive for us (well, there is still that poor TLS handling, but maybe that will get solved over time too).
I personally would take a look at LLD first. Gold linker is supposed to be several times faster than ld, but it doesn't support PE/COFF. LLD is supposed to be several times faster than the gold linker, and it supports PE/COFF. So, there is no need to reinvent the wheel.
Absolutely! Anyway, the goal is to integrate it with mingw. Will that be possible?
[Updated on: Sat, 20 April 2019 01:01] Report message to a moderator
|
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51656 is a reply to message #51619] |
Tue, 23 April 2019 16:38   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Sat, 20 April 2019 01:05mirek wrote on Fri, 19 April 2019 18:56Absolutely! Anyway, the goal is to integrate it with mingw. Will that be possible?
I think, yes, this should be possible. I'll try to do that.
I was going through web investigating this and just to clarify: Even better would be using clang and its linker...
It looks like it should be possible to combine mingw libraries with clang toolchain...
I am really surprised that something like that is not already somewhere for download.
Mirek
[Updated on: Tue, 23 April 2019 16:39] Report message to a moderator
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51657 is a reply to message #51656] |
Tue, 23 April 2019 17:29   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Tue, 23 April 2019 10:38
I was going through web investigating this and just to clarify: Even better would be using clang and its linker...
It looks like it should be possible to combine mingw libraries with clang toolchain...
I am really surprised that something like that is not already somewhere for download.
Mirek
AFAIK, no one is allowed to distribute mingw. That is the problem ...
clang can be combined with Microsoft SDK as well ... In this case it is called clang-cl ...
I'll try to check clang with mingw later. I need to work on my own stuff now ...
Regards,
Novo
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51663 is a reply to message #51657] |
Wed, 24 April 2019 09:04   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Tue, 23 April 2019 17:29mirek wrote on Tue, 23 April 2019 10:38
I was going through web investigating this and just to clarify: Even better would be using clang and its linker...
It looks like it should be possible to combine mingw libraries with clang toolchain...
I am really surprised that something like that is not already somewhere for download.
Mirek
AFAIK, no one is allowed to distribute mingw. That is the problem ...
Nonsense. Mingw (those parts except the GNU compiler) is public domain.
Quote:
clang can be combined with Microsoft SDK as well ... In this case it is called clang-cl ...
I'll try to check clang with mingw later. I need to work on my own stuff now ...
OK, so I have tried... Clang 8.0.0. does not seem to work with mingw.
However, 7.0.0 does, after fixing some issues here and there, with ld.exe. That would be more than enough, 7.0.0 is late 2018 release.
The only problem is that I am so far unable to make ldd.exe work. I am able to compile with "-fuse-ld=lld" and everything seems fine, unfortunately resulting .exe just crashes. So it all leads to nowhere - complete recompile of GUI app is 12 seconds for clang and 17 seconds for that damned slow ld.exe to link results....
I am attaching .bm....
Maybe it would be better to try in Microsoft SDK mode? Perhaps mingw Win32 libraries and headers would import to clang-cl?
-
Attachment: CLANG.bm
(Size: 1.12KB, Downloaded 271 times)
|
|
|
|
|
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51685 is a reply to message #51676] |
Thu, 25 April 2019 16:14   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Thu, 25 April 2019 01:57Even better: I have tried to simply replace ld.exe in mingw with clang's (9.0.0) lld.exe and everything works!
Here are times:
with original ld.exe
C:\upp\out\examples\MINGWx64.Debug.Debug_Full.Gui\AddressBoo k.exe (39524957 B) linked in (0:19.68)
with lld.exe
C:\upp\out\examples\MINGWx64.Debug.Debug_Full.Gui\AddressBoo k.exe (36620800 B) linked in (0:00.27)
Thank you Novo for pointing me in the right direction. This is really significant step ahead!
No problem.
I'm glad to help.
Regards,
Novo
|
|
|
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51729 is a reply to message #51728] |
Fri, 03 May 2019 17:49   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
cbpporter wrote on Fri, 03 May 2019 09:11
Next, we need to use clang to compile .
I personally would recommend to be careful with clang. I always thought that clang on Linux is the best C++ compiler ever, but a few days ago I've ported my old app written for msvc to clang and got very unpleasant results. The app itself is big and complicated, written in 99.99% C++98 (keyword "auto" is used only once), but it has a lot of CRTP, static visitors and similar stuff. Now the app won't compile with GCC and MSVC, and it is crashing in the places where it used to work before.
IMHO, ideally, U++ should be tested against GCC, MSVC, and Clang.
Regards,
Novo
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51730 is a reply to message #51728] |
Sat, 04 May 2019 08:48   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Fri, 03 May 2019 15:11mirek wrote on Fri, 03 May 2019 12:50cbpporter wrote on Fri, 03 May 2019 10:27I upgraded to 13076 and there is no lld.exe inside.
Did you replace the executable with the same name or is this not included for testing yet?
Yes, it is renamed to ld.exe.
You can easily detect its presence by mingw link times... 
Mirek
Thanks!
Next, we need to use clang to compile .
Interestingly, from my tests, mingw / lld might be now ideal combo for Win. Clang is not faster compiler and does not produce better code than GCC 8. It even now seems that mingw/lld might be slightly better than Visual C++. The produced code seems a little bit more refined, link times are virtually zero while Visual C++ linker is fast, but still takes a couple of seconds to link large app (like theide). Compile times are about 2x worse, but in normal development cycle link times might be more important.
The only problem with mingw was horrible TLS implementation, but I have now workaround for that for the next release.
Mirek
|
|
|
|
Re: Possible new package or overhaul proposals for U++ in 2019 [message #51743 is a reply to message #51738] |
Sat, 11 May 2019 16:05   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Fri, 10 May 2019 11:49Hi,
Does MinGW support linking against external binary libraries created with MSVC?
I guess it depends on a lot of things, but generally, yes. Funny part is that whereas you need import library for MSC, mingw links directly .dll 
Also, are structs binary compatible with MSVC?
Quote:
Best regards,
As far as I can tell, yes.
[Updated on: Sat, 11 May 2019 16:05] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri May 09 18:01:42 CEST 2025
Total time taken to generate the page: 0.01541 seconds
|
|
|