[LLVMdev] [cfe-dev] Adding new target for hobby OS

Samuel Crow samuraileumas at yahoo.com
Sat Apr 9 13:14:10 PDT 2011


This concerns me as well.  I've accepted a programming bounty to port LLVM to 
AROS x86.  Once that's done I suspect many people will want it ported to the 
other processors AROS supports.


----- Original Message ----
> From: Bjarke Walling <bjarke.walling at gmail.com>
> To: cfe-dev at cs.uiuc.edu
> Sent: Sat, April 9, 2011 2:06:30 PM
> Subject: [cfe-dev] Adding new target for hobby OS
> 
> Hi,
> 
> I'm contemplating using Clang for my hobby OS project  called
> "wkernel". I want to add a new target i686-pc-wkernel. Later I want  to
> support x86-64 and ARMv7. Is there any documentation on how to add  a
> target like this? What is the state of the Universal Driver  Project?
> When grepping for "freebsd" or "openbsd" it seems I need to add  my
> target to the following  files:
> 
> include/clang/Driver/HostInfo.h
> lib/Basic/Targets.cpp
> lib/CodeGen/TargetInfo.cpp
> lib/Driver/HostInfo.cpp
> lib/Driver/Tools.cpp
> lib/Driver/Driver.cpp
> lib/Driver/ToolChains.h
> lib/Driver/Tools.h
> lib/Driver/ToolChains.cpp
> lib/Frontend/InitHeaderSearch.cpp
> ...  and maybe:
> lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
> 
> It  could be nice to add a target by just creating a target
> configuration file  (with everything in one file), maybe using plain
> text files or tablegen. My  guess is that many targets are similar in
> different aspects, so some form of  inheritance or include mechanism
> should be available.
> 
> I built the gold  linker (as cross-compiler) from Binutils for my
> target. It required few  changes since my target is similar to
> i686-pc-elf. On the other hand there  might be more to it with Clang
> since I'm creating my own C library using  building blocks from PDCLIB
> 0.5 and hopefully I'll be using libc++ in the  future. Where does a
> cross-compiler look for header files and libraries  compared to
> compiling for the native target?
> 
> -  Bjarke
> _______________________________________________
> cfe-dev mailing  list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 


      



More information about the llvm-dev mailing list