This patch adds 2 missing items required for flang-new to be able to
generate executables:
- Extra linker flags to include Fortran runtime libraries.
- The Fortran_main runtime library, which implements the main entry point into Fortran's PROGRAM.
With this change, you can generate an executable that will print `hello,
world!` as follows:
$ cat hello.f90 program hello write (*,*), "hello, world!" end program hello $ flang-new hello.f90 ./a.out hello, world!
Note: Fortran_main was originally written by Peter Klausler, Jean Perier
and Steve Scalpone in the fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Klausler <pklausler@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Steve Scalpone <sscalpone@nvidia.com
I think the multilib style CLANG_LIBDIR_SUFFIX is being phased out in clang driver, so no need for the comment.