...
At the moment, due to a bug that needs further investigation, clang is failing to find the builtins, and adding the path to the builtin library as described in the https://clang.llvm.org/docs/UsersManual.html#finding-clang-runtime-libraries doesn’t seem to be working (bug report pending, since the LLVM bugzilla is currently locked due to the upstream migration to Github issues). HoweverLuckily, we can work around this issue by adding the builtin library directly on every link command (-DCMAKE_EXE_LINKER_FLAGS=path/to/clang_rt.builtins-aarch64.lib).
...
At the time of writing, clang version 13.0.0 is known to work for building flang . The flang binary obtained from main does not have support for without code generation yet. A prototype for this exists in the fir-dev branch and should be upstreamed in the hopefully near future. However, even a flang built from the support.
However, if you want to build a flang that can generate actual binaries, you need to use custom development branches such as this one. The latter is based on the community’s fir-dev branch, which is not currently capable of compiling a hello world on Windows on Armin the process of being upstreamed, plus a few hacks and workarounds to get things working on Windows on Arm. You can use the steps described above to build even this version of flang, and the resulting executable should be able to compile a simple ‘hello world’ with a bit of help from clang. See the example script for more details.
We are naturally working hard towards getting upstream flang to work on Windows on Arm in the cleanest way possible. In the meantime, if you would like to try a version that can compile a simple ‘hello world’, you can build from this (slightly hacky) branch. Note that you will also need clang for some of the steps, as detailed in this example script. Current progress for flang on Windows on Arm is tracked in Jira.