[all-commits] [llvm/llvm-project] ca4098: [compiler-rt][interception][win] Add more assembly...

alvinhochun via All-commits all-commits at lists.llvm.org
Thu May 4 07:41:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca40985ee96e213127ee3c6f0c76ada73cc56bfb
      https://github.com/llvm/llvm-project/commit/ca40985ee96e213127ee3c6f0c76ada73cc56bfb
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M compiler-rt/lib/interception/interception_win.cpp
    M compiler-rt/lib/interception/tests/interception_win_test.cpp

  Log Message:
  -----------
  [compiler-rt][interception][win] Add more assembly patterns

These assembly patterns are needed to intercept some libc++ and
libunwind functions built by Clang for i686-w64-windows-gnu target.

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


  Commit: 814a75dca75406dd06dfdf72bed078394f239728
      https://github.com/llvm/llvm-project/commit/814a75dca75406dd06dfdf72bed078394f239728
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M compiler-rt/lib/asan/asan_interceptors.h
    M compiler-rt/lib/interception/interception_win.cpp

  Log Message:
  -----------
  [compiler-rt][asan][win] Intercept exceptions for i686 MinGW

The i686-w64-windows-gnu target does not use SEH (which MSVC uses),
but DWARF-2 exception handling or possibly sjlj depending on the
toolchain build options. On this target we have to actually intercept
functions in libc++ and libunwind which handles throwing exceptions.
This fixes the `TestCases/intercept-rethrow-exception.cpp` test.

The x86_64-w64-windows-gnu target already works because it uses SEH
which is handled by intercepting RaiseException, so this change does not
affect x86_64.

Depends on https://reviews.llvm.org/D148990

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


  Commit: 7b5571f3fc79ed77d9868258ba1047b26dc63dfe
      https://github.com/llvm/llvm-project/commit/7b5571f3fc79ed77d9868258ba1047b26dc63dfe
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M compiler-rt/lib/interception/interception_win.cpp
    M compiler-rt/lib/interception/tests/interception_win_test.cpp

  Log Message:
  -----------
  [compiler-rt][interception][win] Don't crash on unknown instructions

Do not treat unknown instructions as a fatal error. In most cases,
failure to intercept a function is reported by the caller, though
requires setting verbosity to 1 or higher to be visible.

Better error message reporting for asan will be added in a separate
patch.

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


  Commit: 0716888d828f2e3cca3ac511d05d47c2ca698319
      https://github.com/llvm/llvm-project/commit/0716888d828f2e3cca3ac511d05d47c2ca698319
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M compiler-rt/lib/asan/asan_interceptors.cpp
    M compiler-rt/lib/asan/asan_win.cpp
    M compiler-rt/lib/interception/interception_win.cpp
    M compiler-rt/lib/interception/interception_win.h
    M compiler-rt/lib/interception/tests/interception_win_test.cpp

  Log Message:
  -----------
  [compiler-rt][interception][asan][win] Improve error reporting

Add a callback from interception to allow asan on Windows to produce
better error messages. If an unrecoverable error occured when
intercepting functions, print a message before terminating.

Additionally, when encountering unknown instructions, a more helpful
message containing the address and the bytes of the unknown instruction
is now printed to help identify the issue and make it easier to propose
a fix.

Depends on D149549

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


  Commit: 1a7a00bdc99fa2b2ca19ecd2d1069991b3c1006b
      https://github.com/llvm/llvm-project/commit/1a7a00bdc99fa2b2ca19ecd2d1069991b3c1006b
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M compiler-rt/lib/interception/interception_win.cpp

  Log Message:
  -----------
  [compiler-rt][interception][win] Add error messages for some errors

Depends on D149002

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


Compare: https://github.com/llvm/llvm-project/compare/efc494aa4d84...1a7a00bdc99f


More information about the All-commits mailing list