[all-commits] [llvm/llvm-project] ed108e: [Driver, X86] Ignore -mfpmath= for assembler input

Amy Huang via All-commits all-commits at lists.llvm.org
Mon Aug 28 23:12:45 PDT 2023


  Branch: refs/heads/release/17.x
  Home:   https://github.com/llvm/llvm-project
  Commit: ed108ee79b3119a4a83bc22b16abe5ff5a550825
      https://github.com/llvm/llvm-project/commit/ed108ee79b3119a4a83bc22b16abe5ff5a550825
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/X86.cpp
    M clang/lib/Driver/ToolChains/Arch/X86.h
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    A clang/test/Driver/x86-mfpmath.c

  Log Message:
  -----------
  [Driver,X86] Ignore -mfpmath= for assembler input

Some options are only claimed in AddX86TargetArgs/etc (called by
Clang::RenderTargetOptions).
For assembler input, `Add*TargetArgs` is not called. If an option is
unclaimed, it either leads to a -Wunused-command-line-argument warning
or an error (if `TargetSpecific` is set)
```
// clang '-###' --target=x86_64 -mfpmath=sse -c a.s
clang: error: unsupported option '-mfpmath=sse' for target 'x86_64'
```

For -mfpmath=, it's actually claimed by RenderFloatingPointOptions,
which should be moved to AddARMTargetArgs/AddX86TargetArgs later
(non-AArch32-non-x86 targets give a frontend error).
This change is localized and similar to D153691, for release/17.x
backporting.

Fix https://github.com/llvm/llvm-project/issues/65023

Reviewed By: thesamesam

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

(cherry picked from commit 081afa3d04a4bc0d43c62b5b0e5a84f86a8a70ec)


  Commit: da76a22ae9ff984a2038940b17e0322219bce25f
      https://github.com/llvm/llvm-project/commit/da76a22ae9ff984a2038940b17e0322219bce25f
  Author: Amy Huang <akhuang at google.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M llvm/tools/llvm-rc/llvm-rc.cpp

  Log Message:
  -----------
  [llvm-rc] Continue to use Argv[0] to resolve executable path

In internal google builds, MainExecPath doesn't go to the directory with `clang`.
Fall back to using Argv0 if MainExecPath doesn't find any clangs.

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

(cherry picked from commit e4eb8d97e8afcb879dc5cd0da7a937dbb26fbf12)


Compare: https://github.com/llvm/llvm-project/compare/0638df00951c...da76a22ae9ff


More information about the All-commits mailing list