[llvm-dev] Port to other Operating Systems
A. D. Sharpe via llvm-dev
llvm-dev at lists.llvm.org
Tue Oct 11 17:17:59 PDT 2016
On 10/11/2016 5:24 PM, John Reagan wrote:
> As part of our port of OpenVMS to x86-64, we are using LLVM with our own frontends on OpenVMS Itanium. We are writing a converter between our old backend's IR and the LLVM IR. We can cross-compile (hosted on OpenVMS Itanium) and link/execute on x86-64 CentOS. At present, we pass over 88% of our C test suite.
>
> Porting starts with being able to compile the code. Since we are stuck with a C++03 (sorta) compiler that uses an EDG frontend and the Intel Itanium backend, we had to start with an older LLVM release that did not use C++11 source code. We went with 3.4.2.
>
> I was able to build LLVM 3.4.2 with our old C++ compiler with little issues (I think I had to add about 5 or so "#ifdef __vms" to some modules in lib/Support). There were a handful of missing RTL interfaces due to OpenVMS not having complete C99 header support (that is being worked on now). I wrote a bunch of empty jackets to work around the missing symbols. So far, I haven't had to come back and fill in ANY of them (I'm sure I will bump into them at some point).
>
> And we'll build clang 3.4.2 using the same old C++ compiler and then hopefully once we have working OpenVMS x86 systems, I can use that clang to cross-compile a newer clang/LLVM pair (perhaps in several small step or all at once - we'll just wing it). And we'll need a working cmake on OpenVMS by that time. From peeking at the code, that might be the harder part. We might have to just grab cmake generated Makefile's from a Linux box and hack our way to daylight. Do you have cmake? Do you have some sort of bash shell and gnu tools? (OpenVMS has a "GNV" package with a bash shell, fileutils, diffutils, make, grep, awk, etc. which really reduces the effort)
Good to know!
> Compiling the code is just a start however. You'll eventually want to link those objects you create. What OS are you using and what hardware platform?
The OS is Pyro, it's a fork of Syllable, which itself is a fork of
AtheOS. We're prepping to move from x86 to x86_64. We thought that this
would be the best time to go ahead & move from our outdated GCC to LLVM.
I realize that we should do these things in stages. Currently, our GCC
support is 4.1.2, which is horribly outdated. So, the first step is to
port our OS as a target, so we can build our binaries on a FreeBSD host.
Once we're able to build the OS with LLVM, we'll worry about porting
LLVM to Pyro as a host.
--
Regards,
Apollo D. Sharpe, Sr.
More information about the llvm-dev
mailing list