Author Topic: Clang integration?  (Read 35757 times)

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #30 on: December 13, 2010, 06:07:54 pm »
i made a patch against latest svn version including john's patchset and a fix for compiling gfortran.

http://mingw-wine.googlecode.com/files/llvm-gcc.patch

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #31 on: December 14, 2010, 10:42:27 am »
ok seems i got a stable development version now.

next version will have some small changes.

replacing the mingw64 api with the standard mingw w32api since the gcc used as frontend is to ancient to use the mingw64 intrinsics.
compile against the static gmp and mpfr libraries link problems otherwise.
link against static iconv (winiconv in this case).

get a hold on the llvm-gcc patchset to update it for latest gcc (kinda needed for win32 atm since the dragonegg plugin for gcc-4.5 only works on unix and darwin).
the above might not be needed since the real build is done with the clang compiler (gcc only used to create the bytecode) i might be wrong though.

some things to consider.

the llvm compiler wont work unless the bin dir is on PATH (cannot find its headers otherwise).
codeblocks compatibility. atm it crashes when linking while it works from commandline (not really sure what tool clang uses for linking. atm i use clang++).
bootstrapping is broken. xgcc out of memory on second stage. if anyone got a fix let me hear.



Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #32 on: December 14, 2010, 08:17:04 pm »
ok final version up.

replaced the w32api with standard mingw one and recompiled everything.
added ccache and some shellscripts to run gcc and g++ through it if you use msys.
built against winiconv.
fortran c/c++ fully working ada was left out since it wont build (tried every trick in the book and out of it).
binutils and llvm-make built with it so yes it does work :)

the 7zip file includes everything needed.

remember the compilers bin dir must be on PATH or it wont find its headers/libraries.

reckless.

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #33 on: December 15, 2010, 08:23:46 am »
small update.

codelite works with llvm  :shock:

and now for something really really bad.

johns patchset while definatly ok for standard mingw unfortunatly breaks llvm-gcc :(

im reverting the parts that break now sorry about that.

ill upload the fixed llvm-gcc compiler standalone so atleast you wont have to redownload the entire thing just unzip it over the old one.

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #34 on: December 15, 2010, 12:46:47 pm »
another baddy llvm-gcc cannot build dll's due to a bug with __declspec(dllexport) so only static builds work atm. the bug is known but i cannot tell the timeframe for any fix as most development seems to target the dragonegg plugin these days so there might newer be a fix.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Clang integration?
« Reply #35 on: December 15, 2010, 01:13:32 pm »
you have already done a great work!!!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #36 on: December 15, 2010, 01:46:05 pm »
yeah i guess i can rest a bit ;)

ill try new builds from time to time to see if the __declspec bug is fixed if it is ill let you know :)

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #37 on: December 15, 2010, 06:39:57 pm »

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: Clang integration?
« Reply #38 on: May 22, 2012, 01:29:48 pm »
Just wondering. Is anybody still working on Clang-Support?

In current nightly I can only use LLVM for compiling D code.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Clang integration?
« Reply #39 on: May 22, 2012, 01:46:35 pm »
Just wondering. Is anybody still working on Clang-Support?
What exacly do you mean? If you use the GCC "wrapper", provided in this thread you can so it already.
All that needs to be done is to make a copy of the GCC compiler, name it LLVM (or alike), adjust the toolchain executable names, maybe fiddle with some compiler options (same as on command line) and your are done.

EDIT: I am using this btw:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/experimental/
« Last Edit: May 22, 2012, 02:12:53 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline reckless

  • Regular
  • ***
  • Posts: 353
Re: Clang integration?
« Reply #40 on: May 23, 2012, 09:22:43 am »
I long since ditched the old llvm-gcc and instead added dragonegg support to mingw (latest version with dragonegg on my site is 4.6.3) thanks to xunxun for the initial work.
Its a bit different than dragonegg on linux as each compiler has its own plugin.
Elaborating for C use -fplugin=dragonegg-cc1 for C++ use -fplugin=dragonegg-cc1plus etc.
It works fine most of the time but in a few cases i ran into problems linking stuff when the plugin was enabled, in that case add -Wl,--allow-multiple-definition to the linker flags.