Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » Upp package binding for LLVM/Clang library (libclang)
Upp package binding for LLVM/Clang library (libclang) [message #30312] Thu, 23 December 2010 20:35 Go to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
Hello.

After watching slides from 2010 LLVM Developer's Meeting for libclang, I thought to create Upp package which can be used as binding to Clang library. When talked with dolik.rce, I understood that this could be useful for other people too. This topic is result of such efforts.

The archive contains following packages:
ClangBase - as base for Clang library, which binds to it.
SyntaxCheck - console application to syntax check a file for errors/warnings, which prints LLVM/Clang diagnostics. This is fixed and changed version of syntax-check example from slides to run with Ultimate++ Framework.

Requirements:
- Installed/compiled version of LLVM and Clang 3.4 version (or either version from 2.8 to 3.3 with LLVM_2_8 to LLVM_3_3 build flag).
- Build method points to include and library directories for LLVM/Clang (e.g. INCLUDE directories: /usr/local/include; LIB directories: usr/local/lib).

The 2.8 and 2.9 versions tested on FreeBSD 8.1 (for Clang 2.8 and Clang 2.9 port versions) and Windows XP by me and Arch Linux by dolik.rce.
The versions from 3.0 to 3.4 tested on Windows XP.

These packages considered experimental.

Changelog:
2014-01-25 Added support for LLVM 3.4 release version, which is now by default. Introduced LLVM_3_3 build flag for LLVM 3.3 version.
2013-06-24 Added support for LLVM 3.3 release version, which is now by default. Introduced LLVM_3_2 build flag for LLVM 3.2 version.
2013-01-03 Added support for LLVM 3.2 release version, which is now by default. Introduced LLVM_3_1 build flag for LLVM 3.1 version.
2012-06-04 Added support for LLVM 3.1 release version, which is now by default. Introduced LLVM_3_0 build flag for LLVM 3.0 version.
2011-12-10 Added support for LLVM 3.0 release version, which is now by default. Introduced LLVM_2_9 build flag for LLVM 2.9 version.
2011-04-07 Added support for LLVM 2.9 release version, which is now by default. Introduced LLVM_2_8 build flag for LLVM 2.8 version and LLVM build flag for current (development) version.
2011-01-08 Added object oriented interface for libclang.
2010-12-26 Added MSC library option. Added GCC library option for Windows to link statically.

[Updated on: Sat, 25 January 2014 02:18]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #30322 is a reply to message #30312] Fri, 24 December 2010 17:05 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
How to build and install LLVM/Clang on Windows:
I will describe how to install it using GCC compiler.

You need to download and install following software first:
- CMake build system from http://www.cmake.org.
- TDM GCC compiler from http://www.tdm-gcc.tdragon.net, Nuwen GCC compiler from http://nuwen.net or MinGW GCC compiler from http://www.mingw.org.
- Python from http://www.python.org.
- SVN command line client from http://www.sliksvn.com or http://subversion.tigris.org.

Then download "BuildSystem_v3.4.zip" archive from attachments and extract it to "C:\BuildSystem" directory, for example.
Next, you need to edit "_start_here.bat" file for "System configurable settings" section for current paths of installed software. After running it, you will see command prompt.

First of you need to checkout sources from svn repository for particular version:
Toggle versions

For example, you run "checkout_3_4.bat" first.

Then you can build and install LLVM/Clang for selected version:
Toggle versions

For example, you run "build_3_4.bat" second.

If selected batch files runs without errors, then inside build and install directories you will see llvm directories for selected versions.

To update current development sources to latest versions you could run "update.bat" file when needed and start to build them from second step.

Note:
You need to run batch files inside command prompt after running "_start_here.bat" file.

How to configure installed LLVM/Clang on Windows for TheIDE:
Assuming you did previous steps to install 3.4 release version.
1. Start TheIDE.
2. Open "Setup->Build Methods.." menu.
3. Press insert key on the keyboard to add new build method and name it "LLVM34_MinGW".
4. Select GCC builder.
5. Add following directories for selected tabs:
PATH - executable directories:
C:\MinGW\bin
C:\BuildSystem\install\llvm_3_4\bin
INCLUDE directories:
C:\MinGW\include
C:\BuildSystem\install\llvm_3_4\include
LIB directories:
C:\MinGW\lib
C:\BuildSystem\install\llvm_3_4\lib
6. Use "LLVM34_MinGW" build method to build software relative to LLVM 3.4 version.

To use Upp package binding (ClangBase) with Clang library you need to check "C:\BuildSystem\install\llvm_3_4\lib" for "liblibclang.dll.a" and "liblibclang.dll" files. Else you need to find them inside "C:\BuildSystem\build\llvm_3_3" directories (e.g. bin and lib) and place them respectively.
If you compile shared (or static on Windows) version of ClangBase package, then you need to place "liblibclang.dll" file into "%windir%\system32" directory or near executable file. Else you could configure %PATH% environment variable to directory with "liblibclang.dll" file. Starting from 3.1 version, the "liblibclang.dll" file installed to bin directory, therefore you could extend LIB directories with:
C:\BuildSystem\install\llvm_3_4\bin
To note: the shared library for 2.9 release version is "libclang.dll".

Tested for CMake v2.8.12, Nuwen GCC v4.8.1, Python v2.7.5, Slik SVN v1.7.10.

[Updated on: Fri, 14 February 2014 15:33]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #30400 is a reply to message #30322] Tue, 28 December 2010 01:44 Go to previous messageGo to next message
Sgifan is currently offline  Sgifan
Messages: 37
Registered: February 2010
Location: France
Member
nice explanation.

works as explained.

it works if the goal is to contribute to llvm or clang.

but using clang to compile u++ samples does not work.

to use the compiled clang the explanation about the build method should also include to enter clang as the compiler name.

in this case it is really clang and not gcc that is invoked to compile.

but then it fails to compile all samples
examples with PainterSVGDemo:

In file included from C:\upp\bazaar\PainterSvg_demo\SvgDemo.cpp:1:
In file included from C:\upp\bazaar\PainterSvg_demo/Examples.h:4:
In file included from C:\upp\uppsrc/CtrlLib/CtrlLib.h:4:
In file included from C:\upp\uppsrc/CtrlCore/CtrlCore.h:4:
In file included from C:\upp\uppsrc/RichText/RichText.h:4:
In file included from C:\upp\uppsrc/Draw/Draw.h:6:
C:\upp\uppsrc/Core/Core.h:39:10: fatal error: 'typeinfo' file not found
#include <typeinfo>
^
1 error generated.
PainterSvg_demo: 1 file(s) built in (0:01.07), 1076 msecs / file, duration = 1139 msecs, parallelization 0%


is there a way to use clang to compile u++ code ??

thanks




Re: Upp package binding for LLVM/Clang library (libclang) [message #30403 is a reply to message #30400] Tue, 28 December 2010 15:48 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
Hello, Sgifan.

As you can see, I explained how to compile LLVM/Clang on Windows and didn't say about using Clang compiler. That's it for Windows operating system (for now, at least).
Yes, you can use Clang to compile C++ source code (even whole Upp TheIDE) on Unix-like operating systems.

The purpose of this thread is to use Clang library (libclang) with Upp build system (as package). The libclang library is not a whole compiler, but also can suffer from its features for particular operating system.
To understand about libclang, please watch slides or video(s) from 2010 LLVM Developer's Meeting.

To use libclang with Clang compiler you need to compile it first using Clang, not GCC (but there is a possibility with the same ABI between them, of course). Also, you need to specify correct paths for Clang.
As you may know, latest GCC version which use Clang is 4.2 version (by developers). But there is a possibility to use newer versions. For example, if you install LLVM/Clang with TDM-GCC v4.5.2 then you can specify following paths for TheIDE build method:
PATH - executable directories:
C:\BuildSystem\install\llvm\bin
C:\MinGW\bin
INCLUDE directories:
C:\BuildSystem\install\llvm\include
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\mingw32
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\backward
C:\MinGW\include
C:\MinGW\lib\gcc\mingw32\4.5.2\include
C:\MinGW\lib\gcc\mingw32\4.5.2\include-fixed
LIB directories:
C:\BuildSystem\install\llvm\lib
C:\MinGW\lib

And now you can change compiler name to "clang++" for build method and try to build C++ source code.
For example, I did it in the past and had linker errors.

If you want to improve possibility to compile C++ source code on Windows then there is LLVM BugDatabase for various projects including Clang.

Edit (2011-04-07):
From LLVM 2.9 release, it possible to build applications on Windows. But there are stability issues of compiled applications (especially on exit) and multithreading source code issues (which tested for TDM GCC v4.5.2).

[Updated on: Thu, 07 April 2011 19:17]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #31925 is a reply to message #30312] Thu, 07 April 2011 18:45 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
There is new LLVM 2.9 version.
The corresponding archives were updated.
Re: Upp package binding for LLVM/Clang library (libclang) [message #34756 is a reply to message #30312] Sat, 10 December 2011 12:00 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
There is new LLVM 3.0 version.
The corresponding archives were updated.
Re: Upp package binding for LLVM/Clang library (libclang) [message #36523 is a reply to message #30312] Mon, 04 June 2012 21:51 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
There is new LLVM 3.1 version on 22th May 2012. The corresponding archives were updated.

In this version "CXString clang_getDiagnosticCategoryName(unsigned Category);" function was deprecated and recommended to use "CXString clang_getDiagnosticCategoryText(CXDiagnostic diag);" function instead.

Also I tried to build C/C++ applications with Clang v3.1 compiler on Windows. It was successfull for Clang, compiled with GCC v4.6.1 and by using binaries, headers and libraries from GCC v4.7.0 (e.g. from nuwen.net). With following paths for TheIDE build method:
PATH - executable directories:
C:\BuildSystem\install\llvm_3_1\bin
C:\MinGWN\bin
INCLUDE directories:
C:\MinGWN\include\c++\4.7.0
C:\MinGWN\include\c++\4.7.0\i686-pc-mingw32
C:\MinGWN\include\c++\4.7.0\backward
C:\MinGWN\lib\gcc\i686-pc-mingw32\4.7.0\include
C:\MinGWN\include
C:\MinGWN\lib\gcc\i686-pc-mingw32\4.7.0\include-fixed
C:\BuildSystem\install\llvm_3_1\include
LIB directories:
C:\MinGWN\lib
C:\BuildSystem\install\llvm_3_1\lib
And "clang++" compiler name.

But there are issues with multithreading source code, such as: error: "thread-local storage is unsupported for the current target". The U++ TheIDE, compiled with GUI build flag, works well.
To note: To disable various warning messages there is "-w" compiler option. To restrict various error messages there is "-ferror-limit=n" compiler option, where n is maximum number of errors; 0 - without restrictions.

[Updated on: Tue, 05 June 2012 04:21]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #36864 is a reply to message #36523] Sat, 14 July 2012 20:49 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Very interesting.

Did you test on performance?

For example for me on Ubuntu gcc compiles better than clang

in clang I have:
(20235484 B) linked in (0:03.40)
OK. (0:54.74)

and in GCC I have:
(15365512 B) linked in (0:03.28)
OK. (1:02.77)

The result with GCC is better by application size and worst by compilation performance.

I'm not sure with runtime performance.

[Updated on: Sat, 14 July 2012 20:54]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #36865 is a reply to message #36864] Sat, 14 July 2012 21:54 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
tojocky wrote on Sat, 14 July 2012 20:49

Did you test on performance?

The AddressBook example (r5188), Optimal build, on Windows XP:
- TDM MinGW GCC v4.6.1:
AddressBook.exe (2508288 B) linked in (0:03.12)

OK. (3:26.01)

- Nuwen MinGW GCC v4.7.0:
AddressBook.exe (2520064 B) linked in (0:01.62)

OK. (4:02.50)

- Clang v3.1 with diagnostics:
AddressBook.exe (2880512 B) linked in (0:01.28)

OK. (2:49.35)

Note: TheIDE freezes for some time, after linking stage.
- Clang v3.1 without diagnostics:
AddressBook.exe (2880512 B) linked in (0:01.25)

OK. (2:43.45)

- MSC9 compiler:
AddressBook.exe (1243136 B) linked in (0:02.21)

OK. (1:53.06)

Other related topics:
- "Clang - Performance", "Clang vs Other Open Source Compilers" on clang.llvm.org.
- "GCC 4.6/4.7 vs. LLVM-Clang 3.0/3.1 Compilers" on phoronix.com.
- "Clang vs GCC for Linux Development: Compare and Contrast" on stackoverflow.com.

Edit: Added some results on Windows XP.

[Updated on: Sat, 14 July 2012 23:14]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #38668 is a reply to message #30312] Thu, 03 January 2013 04:46 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
There is new LLVM 3.2 version on 20 Dec 2012. The corresponding archives were updated.

This version added libxml2 dependency, which is optional (for xml validation) and not required to build.
Re: Upp package binding for LLVM/Clang library (libclang) [message #40025 is a reply to message #38668] Sun, 26 May 2013 20:11 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 537
Registered: November 2008
Location: France
Contributor
Hi all,

I am trying to make clang work and I run into the following error:
In file included from /users/didier/upp.out/SRC_MII/CtrlLib/CLANG.Blitz.Gui.Shared/$blitz.cpp:3:
In file included from /users/didier/upp/uppsrc/CtrlLib/LabelBase.cpp:1:
In file included from /users/didier/upp/uppsrc/CtrlLib/CtrlLib.h:4:
In file included from /users/didier/upp/uppsrc/CtrlCore/CtrlCore.h:4:
In file included from /users/didier/upp/uppsrc/RichText/RichText.h:4:
In file included from /users/didier/upp/uppsrc/Draw/Draw.h:6:
In file included from /users/didier/upp/uppsrc/Core/Core.h:213:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/string:53:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:40:
/usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48:45: error: use of undeclared identifier '__ATOMIC_ACQ_REL'
  { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }


Obviously my BM file is incomplete/wrong but what is wrong ??

[Updated on: Sun, 26 May 2013 20:11]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #40030 is a reply to message #40025] Sun, 26 May 2013 21:04 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
Hello, Didier.
Didier wrote on Sun, 26 May 2013 20:11

Obviously my BM file is incomplete/wrong but what is wrong ??

Usually, I use following command to get default include directories for GCC compiler:
gcc -v -fsyntax-only -x c++ test.c
where test.c is path to file with following contents:
#include <stdio.h>

int main() {
	return 0;
}

The excerpt of output might look like follows:
#include "..." search starts here:
#include <...> search starts here:
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/mingw32
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/backward
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/include
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include
 c:\mingw\bin\../lib/gcc/mingw32/4.7.1/include-fixed
End of search list.
Then the default include directories (for concrete compiler version) are:
c:\mingw\lib\gcc\mingw32\4.7.1\include\c++
c:\mingw\lib\gcc\mingw32\4.7.1\include\c++\mingw32
c:\mingw\lib\gcc\mingw32\4.7.1\include\c++\backward
c:\mingw\lib\gcc\mingw32\4.7.1\include
c:\mingw\include
c:\mingw\lib\gcc\mingw32\4.7.1\include-fixed

[Updated on: Sun, 26 May 2013 21:17]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #40039 is a reply to message #40030] Mon, 27 May 2013 21:06 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 537
Registered: November 2008
Location: France
Contributor
Hi Sender Ghost,

I will try you're suggestion.
Re: Upp package binding for LLVM/Clang library (libclang) [message #40154 is a reply to message #30312] Mon, 24 June 2013 02:15 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
There is new LLVM 3.3 version on 17 Jun 2013. The corresponding archives were updated.

At the moment of writing this message, there are no Clang v3.3 pre-built binaries for MinGW (as of 184675 revision). I managed to build it by excluding AArch64 LLVM target:
set CUR_DIR=%~p0
set GENERATOR="MinGW Makefiles"
set GENERATOR_DIR="%CUR_DIR%build\llvm_3_3"
set GENERATOR_FILES="%CUR_DIR%source\llvm_3_3"
set INSTALL_DIR="%CUR_DIR%install\llvm_3_3"
rem all targets, except AArch64, to exclude the error
set TARGETS_TO_BUILD="ARM;CppBackend;Hexagon;Mips;MBlaze;MSP430;NVPTX;PowerPC;Sparc;SystemZ;X86;XCore"
set GENERATOR_DEFINES=-DCMAKE_INSTALL_PREFIX:PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE:STRING="RELEASE" -DLLVM_TARGETS_TO_BUILD:STRING=%TARGETS_TO_BUILD%

cd %GENERATOR_DIR%
cmake -G %GENERATOR% %GENERATOR_DEFINES% %GENERATOR_FILES%
mingw32-make
mingw32-make install/fast

To note: there is also possible to use "Ninja" CMake generator instead of "MinGW Makefiles" (for example, to use all CPU cores for building):
Toggle batch file

To create "Ninja build system" from source code on Windows, just use configured "_start_here.bat" file from the above message (and re2c scanner generator binary, if needed):
cd ninja
python bootstrap.py --platform=mingw

[Updated on: Mon, 24 June 2013 03:57]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #42977 is a reply to message #40154] Sun, 20 April 2014 15:54 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3120
Registered: August 2008
Ultimate Member
Hello Sender

I have tried to install clang on TheIDE in windows unsuccessfully. I have used the precompiled files.

I have added the include, lib and path directories, and added clang++ as "Compiler Name". However the compiler does not find #include <typeinfo> in Core.h. Just removing clang++ as "Compiler Name" and the files are compiled without problem (with MinGW).

May you help me?


Best regards
Iñaki
Re: Upp package binding for LLVM/Clang library (libclang) [message #42979 is a reply to message #42977] Sun, 20 April 2014 22:19 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
Hello Koldo.

koldo wrote on Sun, 20 April 2014 15:54
I have tried to install clang on TheIDE in windows unsuccessfully. I have used the precompiled files.

You didn't say about which precompiled files you used, but if they are official v3.4 "Pre-built Binaries: Clang for Windows" from llvm.org download page, then they didn't work here also (perhaps, because of 64-bit compiler build, which don't support 32-bit Windows operating system).
koldo wrote on Sun, 20 April 2014 15:54
I have added the include, lib and path directories, and added clang++ as "Compiler Name". However the compiler does not find #include <typeinfo> in Core.h.

The plain "include" directory from MinGW is not enough to configure Clang compiler on Windows, in case of unsupported search directories in the source code. To solve this with TheIDE, you could add full include directories, as explained in 40030 message.
koldo wrote on Sun, 20 April 2014 15:54
Just removing clang++ as "Compiler Name" and the files are compiled without problem (with MinGW).

Yes, because of "c++" compiler name by default for GCC builder.

In conclusion, I recommend to download/install necessary software and build LLVM/Clang by yourself, e.g. as explained in 30322 message, to try it out. But you could try to find different precompiled LLVM/Clang (e.g. from http://www.drangon.org/mingw/) or use following temporary links (by clicking "Direct download link"):
LLVM/Clang v3.3 release (32-bit, 86.5 Mb).
LLVM/Clang v3.4 release (32-bit, 128 Mb).

The last working version for GCC builder of TheIDE is 3.3. The 3.4 version uses error messages instead of warning messages for unsupported compiler/linker flags (e.g. "-finline-limit", "-mwindows", "-mconsole", etc.) and will not build (e.g., without excluding/changing some flags for GCC builder). But this is not true, if you just need to use libclang library, compiled by MinGW GCC, with GCC compiler.

[Updated on: Sun, 20 April 2014 22:31]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #42995 is a reply to message #42979] Tue, 22 April 2014 12:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3120
Registered: August 2008
Ultimate Member
Hello Sender

Thank you for your aid.

With 3.3 version from http://www.drangon.org/mingw/, clang++ complained because of the lack of libgcc_s_seh-1.dll.

With your v3.3 file, llvm package compiles well after adding include folders, although clang++ emits many "'&&' within '||' [-Wlogical-op-parentheses]" warnings. Unfortunately the link fails because of "undefined reference to `_Unwind_Resume'"


Best regards
Iñaki
Re: Upp package binding for LLVM/Clang library (libclang) [message #43006 is a reply to message #42995] Wed, 23 April 2014 00:41 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
koldo wrote on Tue, 22 April 2014 12:58
With your v3.3 file, llvm package compiles well after adding include folders, although clang++ emits many "'&&' within '||' [-Wlogical-op-parentheses]" warnings

It's possible to disable warnings with "-w" compiler option (or to specify "-ferror-limit=n", where n is number of diagnostics, as said in "Clang compiler user's manual").
koldo wrote on Tue, 22 April 2014 12:58
Unfortunately the link fails because of "undefined reference to `_Unwind_Resume'"

Looks like, you used compiler with a different stack unwinding method: Dwarf-2 (DW2) or SJLJ (setjmp/longjmp). I used Nuwen GCC compiler (10.3 distribution version, before it became 64-bit only, but available 10.4 version might be ok) to build 3.3 version.

In case, if you used TDM-GCC 4.8.1 compiler, I rebuild 3.3 version of LLVM/Clang with it and got the same "undefined reference to `_Unwind_Resume'" errors. So, it might be compiler dependent.

I fixed issue with "unknown argument" for Clang (v3.4 release) with following changes:
Toggle patch file

which turns such kind of error to warning message and doesn't stop. But while it compiles and builds, the result executables starts with exception error. For reference, I uploaded 3.4 version (with applied patch) to the following temporary links:
LLVM/Clang v3.4 release (32-bit, compiled by TDM GCC 4.8.1, 118.8 Mb).
LLVM/Clang v3.4 release (32-bit, compiled by Nuwen GCC 4.8.1, 128 Mb).

Then I decided to apply the same changes to development version of Clang (3.5):
Toggle patch file

The simple console applications starts without exception errors, but others (which compiles by 3.3, 3.4 versions) is not compiled. For reference, I uploaded 3.5 development version (with applied patch) to the following temporary link:
LLVM/Clang v3.5 devel (32-bit, compiled by Nuwen GCC 4.8.1, 137.5 Mb).

[Updated on: Wed, 23 April 2014 00:59]

Report message to a moderator

Re: Upp package binding for LLVM/Clang library (libclang) [message #43008 is a reply to message #43006] Wed, 23 April 2014 08:12 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3120
Registered: August 2008
Ultimate Member
Hello Sender

For sure the problem is in the MinGW compiler version. I use TDM 4.8.1.

So I see the only way to get LLVM is by compiling it all Sad. I hate CMake.


Best regards
Iñaki
Re: Upp package binding for LLVM/Clang library (libclang) [message #43015 is a reply to message #43008] Wed, 23 April 2014 11:42 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
koldo wrote on Wed, 23 April 2014 08:12
So I see the only way to get LLVM is by compiling it all

Well, it quite easy, if you automate it a bit with some batch files.

For example, I just configure paths (to GCC, CMake, Python, SVN) for _start_here.bat file (or copy it to a different name for particular compiler). Then I choose or copy build.bat file to a different name and configure (if necessary) GENERATOR (type of CMake generator for particular build system, e.g. MinGW Makefiles, Ninja, etc.), GENERATOR_DIR (where to place build files), GENERATOR_FILES (root of LLVM sources path), INSTALL_DIR (where to install files). In next step I run _start_here.bat file and type build.bat, push <ENTER>. If there are no errors, it will be done after some time.

The same steps are true for other projects, which use CMake. The difference is in configuration.

[Updated on: Wed, 23 April 2014 11:42]

Report message to a moderator

Previous Topic: PieChart: Title disable
Next Topic: LedLabel new package
Goto Forum:
  


Current Time: Wed May 27 23:38:39 CEST 2020

Total time taken to generate the page: 0.01396 seconds