[all-commits] [llvm/llvm-project] bf7c5f: [LLD][MinGW] Add --[no-]guard-cf and --[no-]guard-...

alvinhochun via All-commits all-commits at lists.llvm.org
Thu Sep 8 23:56:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bf7c5f1fae582ff4cc875713695b2dadb1cf5e59
      https://github.com/llvm/llvm-project/commit/bf7c5f1fae582ff4cc875713695b2dadb1cf5e59
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M lld/MinGW/Driver.cpp
    M lld/MinGW/Options.td
    M lld/docs/ReleaseNotes.rst
    M lld/test/MinGW/driver.test

  Log Message:
  -----------
  [LLD][MinGW] Add --[no-]guard-cf and --[no-]guard-longjmp

These will be LLD-specific options to support Control Flow Guard for the
MinGW target. They are disabled by default, but enabling `--guard-cf`
will also enable `--guard-longjmp` unless `--no-guard-longjmp` is also
specified. These options maps to `-guard:cf,[no]longjmp`.

Note that these features require the `_load_config_used` symbol to
contain the load config directory and be filled with the required
symbols. While current versions of mingw-w64 do not supply this symbol,
the user can provide their own version of it.

Reviewed By: MaskRay, rnk

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


  Commit: a3a8bd00c8f1e094967a80e56485c421e312dd2e
      https://github.com/llvm/llvm-project/commit/a3a8bd00c8f1e094967a80e56485c421e312dd2e
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/lib/Driver/ToolChains/MinGW.h
    A clang/test/Driver/mingw-cfguard.c

  Log Message:
  -----------
  [clang][MinGW] Add `-mguard=cf` and `-mguard=cf-nochecks`

This option can be used to enable Control Flow Guard checks and
generation of address-taken function table. They are equivalent to
`/guard:cf` and `/guard:cf,nochecks` in clang-cl. Passing this flag to
the Clang driver will also pass `--guard-cf` to the MinGW linker.

This feature is disabled by default. The option `-mguard=none` is also
available to explicitly disable this feature.

Reviewed By: rnk

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


Compare: https://github.com/llvm/llvm-project/compare/06413618eae9...a3a8bd00c8f1


More information about the All-commits mailing list