[all-commits] [llvm/llvm-project] 9d6837: [flang][driver] Remove Fortain_main static library...

Michael Klemm via All-commits all-commits at lists.llvm.org
Mon Dec 25 10:15:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d6837d595719904720e5ff68ec1f1a2665bdc2f
      https://github.com/llvm/llvm-project/commit/9d6837d595719904720e5ff68ec1f1a2665bdc2f
  Author: Michael Klemm <michael.klemm at amd.com>
  Date:   2023-12-25 (Mon, 25 Dec 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M flang/docs/FlangDriver.md
    M flang/test/Driver/dynamic-linker.f90

  Log Message:
  -----------
  [flang][driver] Remove Fortain_main static library from linking stages (#75816)

At present, when building static or shared libraries, Flang adds
`-lFortran_main.a` (or `/WHOLEARCHIVE:Fortran.*.lib` pon Windows) to the
link line. This leads to the problem that `_QQmain` and
`_QQEnvironmentDefaults` (as of the time of this PR) are symbols marked
as used, while `main` is being defined. This should not happen and this
PR fixes this by detecting if `-shared` or `-static` is used on the
Flang command line and removing the static `Fortran_main` library.

---------

Co-authored-by: kkwli <kkwli at users.noreply.github.com>




More information about the All-commits mailing list