4 Commits

Author SHA1 Message Date
Dmitry Vyukov
5addb736a9 sanmd: improve precision of UAR analysis
Only mark functions that have address-taken locals
as requiring UAR checking.

On a large internal app this reduces number of marked functions
from 78441 to 66618. Mostly small, trivial getter/setter-type
functions are unmarked, but also some amount of larger
number-crunching-type functions are unmarked as well.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D139811
2022-12-12 11:41:59 +01:00
Nico Weber
9531fc37fb Unbreak check-all on macOS after dbe8c2c316c40
`${X86_64}` expands to `x86_64;x86_64h` on macOS, so

    get_test_cc_for_arch(${X86_64} METADATA_TEST_TARGET_CC METADATA_TEST_TARGET_CFLAGS)

calls the macro get_test_cc_for_arch() with the four arguments
`x86_64`, `x86_64h`, `METADATA_TEST_TARGET_CC`, and `METADATA_TEST_TARGET_CFLAGS`.

This writes the compiler into a variable called x86_64h, the cflags into a
variable called METADATA_TEST_TARGET_CC, and silently ignores the fourth
parameter.

As a fix, just pass `x86_64` instead of `${X86_64}`. Hopefully
that won't break anything on other platforms.
2022-12-06 10:19:58 -05:00
Dmitry Vyukov
08742e72a3 compiler-rt/test/metadata: restrict tests to x86_64
aarch64 builder broke with:

-- Supported architectures for crt: aarch64
CMake Error at compiler-rt/cmake/config-ix.cmake:244 (message):
  Unsupported architecture: x86_64
Call Stack (most recent call first):
  compiler-rt/cmake/config-ix.cmake:280 (get_target_flags_for_arch)
  compiler-rt/test/metadata/CMakeLists.txt:7 (get_test_cc_for_arch)
-- Configuring incomplete, errors occurred!

https://lab.llvm.org/buildbot/#/builders/223/builds/11423

Restrict the tests to x86_64 only.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D139323
2022-12-05 15:27:21 +01:00
Dmitry Vyukov
dbe8c2c316 Use-after-return sanitizer binary metadata
Currently per-function metadata consists of:
(start-pc, size, features)

This adds a new UAR feature and if it's set an additional element:
(start-pc, size, features, stack-args-size)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D136078
2022-12-05 14:40:31 +01:00