[flang-commits] [clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

David Truby via flang-commits flang-commits at lists.llvm.org
Mon Nov 20 08:24:26 PST 2023


DavidTruby wrote:

> I tried this locally, but it doesn't quite work:
> 
> ```
> >flang-new foo.f90
> ... fatal error LNK1276: invalid directive 'clang_rt.builtins-x86_64.lib' found; does not start with '/'
> ```
> 
> The directives appear in the object file with an extra space:
> 
> ```
> >flang-new -c foo.f90
> >grep -ai defaultlib foo.o
>  /DEFAULTLIB: clang_rt.builtins-x86_64.lib /DEFAULTLIB: libcmt /DEFAULTLIB: Fortran_main.static.lib /DEFAULTLIB: FortranRuntime.static.lib /DEFAULTLIB: FortranDecimal.static.lib.text
> ```
> 
> There should not be a space after `/DEFAULTLIB:` before the library name.

This looks like a small bug in the previous patch in this series due to a misunderstanding by me of how `llvm.linker.options` works. I'll push a quick fix for that and then rebase this patch on that which should fix the issue

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


More information about the flang-commits mailing list