Closed chorman0773 closed 5 years ago
Are you thinking it'd be possible to use the real gcc and link the object files to command block assembly? That would not be feasible because object files generated by gcc are compiled for an architecture known to gcc (e.g. x86_64) and it'd be a lot of work to translate the output to command block assembly's language.
Instead, CBA will provide the tools needed for its ecosystem, currently there's an assembler and a compiler, I may create a linker in the future (currently the "linking" step is performed internally by the assembler)
Well it would be possible to substitue the internal assembler with cba/as, then write some backend code to the assembly. Its theoretically possible, but as you noted, quite a bit of work. The main things needed are of course as and ld.
If I were to go that route then I'd write a backend for LLVM, which is something I might do. I already designed Command IR which is what I will be using going forward.
I was wondering if it may be possible to write a full set of binutils for this (Basically have a ld which does some checks and that's it, and as which is a port of this, or a thin-wrapper arround this), which would basically enable people to use full gcc. It would take some more work than just this, but it would be a start.