Skip to content

Commit a2e41ca

Browse files
committed
Make small addition about static and shared libraries
1 parent bdd5d9b commit a2e41ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flang/docs/FlangDriver.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ driver) or use Flang with the `-fno-fortran-main` flag. This flag removes
197197
`Fortran_main` from the linker stage and hence requires one of the C/C++
198198
translation units to provide a definition of the `main` function.
199199

200+
When creating shared or static libraries, `Fortran_main` is automatically
201+
removed from the linker stage. It is assumed that when creating a static or
202+
shared library, the generated library does not need a `main` function, as a
203+
final link stage will occur that will provide the `Fortran_main` library when
204+
creating the final executable.
205+
200206
## Frontend Driver
201207
Flang's frontend driver is the main interface between compiler developers and
202208
the Flang frontend. The high-level design is similar to Clang's frontend

0 commit comments

Comments
 (0)