[all-commits] [llvm/llvm-project] 28dc5f: [flang] Use internal linkage for string literals

David Truby via All-commits all-commits at lists.llvm.org
Thu May 11 07:47:41 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28dc5f4cdd5e552c87ec72d39bd0f9d7378ab747
  Author: David Truby <david at truby.dev>
  Date:   2023-05-11 (Thu, 11 May 2023)

  Changed paths:
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/test/Lower/allocatable-assignment.f90
    M flang/test/Lower/character-assignment.f90
    M flang/test/Lower/convert.f90
    M flang/test/Lower/global-format-strings.f90
    M flang/test/Lower/io-statement-open-options.f90
    M flang/test/Lower/namelist.f90
    M flang/test/Lower/read-write-buffer.f90
    M flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp

  Log Message:
  [flang] Use internal linkage for string literals

On Windows, global string literals with "linkonce" linkage is not
supported without using comdat. As a simpler fix than adding comdat
support we can use internal linkage instead.

This fixes a bug where two string literals with the same value in
different fortran files would cause a linker error due to the use
of linkonce linkage.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D149859

More information about the All-commits mailing list