arne_v wrote: ↑Sat May 18, 2024 10:15 am
You need to use clang instead of cc.
I hope you all don't get too tired of me asking dumb questions about clang, but here goes...
So I thought I'd try out clang using some of the examples from this page:
https://clang.llvm.org/get_started.html,
first hello.c, then t.c
clang :== $sys$system:clang.exe
clang t.c "-S" -emit-llvm
produces T.LL and T.S
but:
clang hello.c "-S" -emit-llvm
did not produce a HELLO.S, but instead a HELLO.BC which apparently is a ByteCode file. I am curious to know why I didn't get a HELLO.S as I'm more interested in reading the x86 assembly.
(another question is, is there an x86 Assembler for OpenVMS x86?)
(I know this is probably not the correct nomenclature for LLVM but I'm new to LLVM, but since i get the impression that LLVM is important to OpenVMS on x86 I need to learn it!)
Also does the OpenVMS community VM come with some of the LLVM command line utilities such as "llc" (there is no SYS$SYSTEM:LLC.EXE)
Then out of curiosity I copied the files over to Linux and
readelf recognises HELLO.EXE as an ELF file and
objdump recognises HELLO.OBJ as an ELF file as well so now I'm starting to wonder if it is possible to cross compile a program for OpenVMS x86 on a Linux (x86) machine - (assuming one could reference the DECC runtime correctly)
An then, while still on Linux, I tried
llc hello.ll and amazingly it produced a hello.s file without error!
Continuing that cross-compilation thought experiment, it might be easier to generate LLVM IR on Linux and then compile and link on OpenVMS if VSI made all the LLVM tools available? Come to think of it, is a most interesting question, I should have stated with this question first!
Thanks again for your time
CRG