|
|
Home » Community » Coffee corner » Clang now fully supports U++
Clang now fully supports U++ [message #29144] |
Thu, 07 October 2010 12:51  |
|
Hi everyone!
Few days ago new version of LLVM was released. Since the release notes claimed that clang compiler now fully supports C++ standards, I decided to give it a try and see if it is mature enough to digest the complicated internals of U++.
Here is what I found:
There are some minor glitches, but mostly very easy to solve. I will soon post patched files. It will be probably just a few lines. For example it doesn't like something in the __BREAK__ statement (but that is only in debug mode) or missing some constructors for classes used with GLOBAL_VAR macro. I successfully compiled some of the example apps (wc,UWord,...) and also TheIDE. And as we all know, if it compiles TheIDE, it'll compile pretty much anything 
I really appreciate the verbosity of this compiler and I think even the compilation times are little shorter then gcc (that is just my feeling, I did not measure it). In my opinion it is definitely worthed to use it and to ensure U++ is compatible.
Best regards,
Honza
|
|
|
|
|
|
Re: Clang now fully supports U++ [message #29175 is a reply to message #29169] |
Fri, 08 October 2010 16:59   |
|
luzr wrote on Fri, 08 October 2010 12:45 |
unodgs wrote on Thu, 07 October 2010 15:05 | That's a really good news! I must recompile my clang compilator .Hope to see your patches posted here soon 
|
What patches? dolik.rce has theide open for commits... (At least I hope so..)
|
Yes, I have - but this time, theide doesn't require any patch 
The changed files are from Core and references. Mostly the changes required for clang are marked with #ifdef __clang__ to not disturb other compilers, but it probably wouldn't hurt anything anyway.
I tested by compiling everything from tutorial, examples, reference plus theide. Clang compiles everything that GCC does. Also I found few bugs in reference apps. Fix for SocketServer and Xmlize_std is included. XmlRpcCall is broken too, but I couldn't fix that.
Best regards,
Honza
EDIT: I got some more time so I changed the file from diff to archive with complete files.
-
Attachment: clang.zip
(Size: 6.54KB, Downloaded 390 times)
[Updated on: Fri, 08 October 2010 20:49] Report message to a moderator
|
|
|
|
Re: Clang now fully supports U++ [message #29199 is a reply to message #29184] |
Sun, 10 October 2010 12:10   |
|
dolik.rce wrote on Sat, 09 October 2010 00:41 | PS: I forgot to mention one important thing: The changed files I posted ensure that clangs works in optimal mode. The debug mode is still on my TODO list...
|
Looks like I was mistaken/confused. Everything works fine even in debug mode with the changes posted above. Mirek could you check the files and commit them? Then I can put CLANG build method to packaging scripts...
Best regards,
Honza
|
|
|
|
Re: Clang now fully supports U++ [message #29525 is a reply to message #29524] |
Tue, 26 October 2010 16:18   |
|
Sgifan wrote on Tue, 26 October 2010 13:58 | I suppose all this is only true in Linux ?
clang is not ready for windows if i recall correctly
|
Hi Sgifan,
I believe that the situation on windows should be quite similar. For some reason I could not found the binaries on llvm.org, but I downloaded it from http://code.google.com/p/i18n-zh/downloads/detail?name=LLVM- CLang-2.8-Mingw32-gcc-4.5.tar.xz and it appears to work. I tested it briefly on wine and compiled some simple files. I didn't manage to make it work with U++, but that was probably because I did not try hard enough I think it also requires some header files from mingw or windows SDK, you will have to set up the paths correctly...
Let us know if you make it work and how 
Best regards,
Honza
|
|
|
Re: Clang now fully supports U++ [message #29602 is a reply to message #29525] |
Tue, 02 November 2010 22:25   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
Is there any specific reason the changes required to use CLANG instead of GCC have not been brought to the current upp codebase?
I would sure like to see this compiler in the builder selection list.
Best regards,
Tom
|
|
|
|
Re: Clang now fully supports U++ [message #29627 is a reply to message #29622] |
Thu, 04 November 2010 15:40   |
|
luzr wrote on Thu, 04 November 2010 14:05 | Such a change has my full support!
|
Hi Mirek,
Can you support it by uploading those four files from archive few posts above? They are in places where I don't have commit rights. Also checking if the changes are not harmful would be a great help 
Tom1: CLANG won't appear in the builder selection list(the one in Build Methods dialog), as it works perfectly fine with the GCC builder. But it can sure appear in your build method list I attach my build method file to make it easier for you, just copy it into the configuration directory of theide (usually ~/.upp/theide/). The settings are mostly standard, so there is high probability that it will work as it is, without any adjustments.
Best regards,
Honza
-
Attachment: CLANG.bm
(Size: 1.13KB, Downloaded 368 times)
|
|
|
Re: Clang now fully supports U++ [message #29640 is a reply to message #29627] |
Fri, 05 November 2010 10:13   |
|
Yesterday I rebuilt my clang in Win7 64 (one cmakelist.txt must be change manually to get clang compiled in 64b mode). Unfortunately clang still have problems with win api headers (but it's better than it was before) so I was not able to compile and run any upp gui application . I hope they will fix it soon.
|
|
|
Re: Clang now fully supports U++ [message #29654 is a reply to message #29627] |
Fri, 05 November 2010 21:16   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Honza,
Thanks for your notes. The CLANG.bm excellently covers what I had in mind -- in addition to the fixes you made to the source previously.
Now I'm having a different problem: Running any application I have compiled with CLANG results in 'Illegal instruction' printed on console followed by immediate end of execution.
Just to make sure the compiler works, I compiled the classic non-upp 'hello world' application directly from shell. That works OK.
Any idea what I'm doing wrong here? (I have a 32-bit Kubuntu 10.10, clang version 2.8, U++ 2791-maverick-i386 from your repository plus the sources have been updated from SVN today.)
Best regards,
Tom
|
|
|
Re: Clang now fully supports U++ [message #29660 is a reply to message #29654] |
Sat, 06 November 2010 00:55   |
|
Hi Tom,
That is strange... I use clang 2.8 on 32-bit system too and never hit any runtime error. I'll try on Ubuntu on the weekend if I get some spare time, to see if it is related to the way ubuntu clang is compiled.
Honza
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 18:16:26 CEST 2025
Total time taken to generate the page: 0.00578 seconds
|
|
|