[PATCH] D122008: [flang][driver] Add support for generating executables
Andrzej Warzynski via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 18 07:13:16 PDT 2022
awarzynski created this revision.
awarzynski added reviewers: kiranchandramohan, clementval.
Herald added a subscriber: mgorny.
Herald added a reviewer: sscalpone.
Herald added projects: Flang, All.
awarzynski requested review of this revision.
Herald added subscribers: cfe-commits, jdoerfert.
Herald added a project: clang.
This patch adds 2 missing items required for `flang-new` to be able to
generate executables:
1. Extra linker flags to include Fortran runtime libraries.
2. 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: Peter Klausler <pklausler at nvidia.com>
Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Steve Scalpone <sscalpone at nvidia.com
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122008
Files:
clang/lib/Driver/ToolChains/Gnu.cpp
flang/include/flang/Runtime/stop.h
flang/runtime/CMakeLists.txt
flang/runtime/FortranMain/CMakeLists.txt
flang/runtime/FortranMain/Fortran_main.c
flang/test/CMakeLists.txt
flang/test/Driver/linker-flags.f90
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122008.416498.patch
Type: text/x-patch
Size: 4705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220318/e07f2a7a/attachment.bin>
More information about the cfe-commits
mailing list