Clang for P2
Clang is a well known C++ compiler front end for the LLVM compiler back end.
Many thanks to forum member n_ermosh for all the hard work on this and also iseries for testing
Download a 600MB Clang folder for Windows, ready to go.
Just unzip somewhere and then update "start in" folder in command prompt and first line of build.bat with new path of the bin folder
Then, type "build serial" and then "load serial" to get Hello World Example run
Or, type "build test" and "load test"
To Build yourself: Recent posts in the C/C++ Parallax forum suggests it may be ready for use
Build instructions are given in post #133 in this thread
Note: Skip the "cd build" step.
Github source is here: GitHub - ne75/p2llvm: Contains Propeller 2 Library, C Standard Library, examples, and documentation for p2llvm
Prerequisites to build:
install git from here: https://git-scm.com/download/win (Use all default settings when installing)
get cmake latest releast from here and let it add cmake to the path: https://cmake.org/download/
download and install Python3 from here: https://www.python.org/downloads/ (let it add python to path)
Note: To actually compile, you also need libc.a and libp2.a and loadp2.exe
These can't currently be compiled with cmake, so need to get them some other way
Some versions of libc.a include debug code and produce large elf files.
Seems the elf file can be bigger than 512kB, but less actually gets loaded
To compile things with printf, you need to copy libc with stdio.h in it over to the build folder.