Porting llvm-gcc-4.2

Hello,

how would I go porting llvm-gcc-4.2 to an “unknown” platform, i.e.
MirBSD? For regular gcc, I’d have to add stuff to gcc/gcc/config/
and patch quite some configure scripts, but seeing that llvm-gcc
uses LLVM for target specific stuff, how much of this still applies?
cpp defines and startup files at the least, probably, for the com-
piler driver…

Which dependencies does llvm-gcc-4.2 have, besides the usual gmake,
bison, working toolchain, gnat for building Ada, llvm? Specifically,
does it also have the hilarious library dependencies (gmp, mpfr, etc)?

What is the status of the other (besides C and C++) languages on
llvm-gcc-4.2 r58565? I’ve read that Ada fails and Fortran has issues.
How about ObjC, ObjC++, Java™?

Speaking of Ada: is gnat from gcc 3.4.6 enough to build gnat/gcc4?

Is there a recommended way to compile libstdc++ and libobjc to llvm
byte code only (instead of native code), both to enable the use of
more optimisations¹ and the use of the C back-end (possibly to create
a C-only bootstrap version of llvm and llvm-gcc to get rid of gcc/g++
in base and being able to use pcc to bootstrap llvm)?

① What’s this about link time optimisation being supported only on
  Darwin anyway?

Do you have any other recommendations for me for porting llvm, clang
and llvm-gcc to MirBSD?

Thanks in advance!

bye,
//mirabilos

llvm-gcc bits are but a small part of it. You need to add a new target to llvm. Please read llvm documentation and llvmdev archieve for more information.

Evan

Evan Cheng dixit:

llvm-gcc bits are but a small part of it. You need to add a new target

Actually, I can just re-use the existing i386 and sparc targets.

bye,
//mirabilos

Hello again,

just wanted to let you know that MirBSD-current/i386 has basic
success with llvm-gcc and ccc/clang building http://mirbsd.de/mksh
as well as a Fortran 99-bottles-of-beer example. No valitdation
though :relaxed:

In use:
• LLVM r58935
• Clang r58935
• llvm-gcc-4.2 r58935

A question do I have though… why is, for example, libstdc++ not
built into LLVM Bytecode, and why do neither ccc nor llvm-gcc
front-ends recognise Bytecode *.o files?

https://www.mirbsd.org/cvs.cgi/src/bin/mksh/Build.sh.diff?r1=1.368;r2=1.369
contains the kludge (llvm-link | opt -std-compile-flags | llc)
I have to use for that to work.

bye,
//mirabilos