Skip to content
Unverified Commit 50a5f5c1 authored by Michael Klemm's avatar Michael Klemm Committed by GitHub
Browse files

[flang][driver] Add -fno-fortran-main (link time) option to remove...


[flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (#74139)

This PR adds the `-fno-fortran-main` command line option to remove
`Fortran_main.a` from the link and to allow for linking Fortran code w/o
program unit with C/C++ translation units that provide the `main()`
entrypoint.

When linking Fortran code with C/C++ code (Fortran calling into C/C++),
PR #73124 introduced a proper error message that would prevent
successful linkage, if there was a program unit from Fortran *and*
`main()` function coming from C/C++. Alas, this caused some breakage of
code that would call Fortran code from C/C++ and rightfully provided the
`main()` entrypoint. Classic Flang had the command-line option
`-fno-fortran-main` to then remove the entrypoints for the Fortran
program unit from the linker stage.

This PR is related to PR #74120 and (merged) PR #73124.

---------

Co-authored-by: default avatarAndrzej Warzyński <andrzej.warzynski@gmail.com>
parent 19918ac3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment