[all-commits] [llvm/llvm-project] 1b708b: [lld][MinGW] Ignore `--[no-]as-neeed` flags in Min...

zero9178 via All-commits all-commits at lists.llvm.org
Sun Jan 2 03:07:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b708b67f625507cf2c24319b30479cc2af41c86
      https://github.com/llvm/llvm-project/commit/1b708b67f625507cf2c24319b30479cc2af41c86
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2022-01-02 (Sun, 02 Jan 2022)

  Changed paths:
    M lld/MinGW/Options.td

  Log Message:
  -----------
  [lld][MinGW] Ignore `--[no-]as-neeed` flags in MinGW driver

These flags are specific to ELF, but are still accepted by GNU ld, even if it does not do anything. This patch adds them as ignored option for the sake of compatibility.

Part of https://github.com/llvm/llvm-project/issues/52947

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


  Commit: dbeeb136abcb03eaa85e2ee47a5169f5298e8944
      https://github.com/llvm/llvm-project/commit/dbeeb136abcb03eaa85e2ee47a5169f5298e8944
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2022-01-02 (Sun, 02 Jan 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/test/Driver/pic.c
    M clang/test/Driver/windows-pic.cpp

  Log Message:
  -----------
  [clang][MinGW] Explicitly ignore `-fPIC` & friends

GCC on Windows ignores this flag completely [0] which some build systems sadly rely on when compiling for Windows using MinGW. The current behaviour of clang however is to error out as -fPIC & friends has no effect on Windows.

This patch instead changes the behaviour for MinGW to ignore the option for the sake of compatibility

Fixes https://github.com/llvm/llvm-project/issues/52947

[0] https://gcc.gnu.org/legacy-ml/gcc-patches/2015-08/msg00836.html

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


Compare: https://github.com/llvm/llvm-project/compare/3782624c126b...dbeeb136abcb


More information about the All-commits mailing list