[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

Michael Klemm via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 11:56:37 PST 2023


mjklemm wrote:

> > Also, not sure what defines `_QQEnvironmentDefaults ` and what exactly makes it problematic?
> 
> The `main` entrypoint also calls `_QQEnvironmentDefaults` to treat `argc`, `argv`, etc. So, when `main` is included in the shared object, so will be those symbols are used symbols, which makes no sense.

I need to correct myself: _QQEnvironmentDefaults is not a function that is called, but rather an external file-scope variable that creates that symbol.  The symbol used to initialize that is `_FortranAProgramStart`.  Plus, there's `_FortranAProgramEndStatement` that also used by `Fortran_main.a`.  So, lot's of symbols that should not be in a dynamic library for no reason. :-)

https://github.com/llvm/llvm-project/pull/75816


More information about the cfe-commits mailing list