[all-commits] [llvm/llvm-project] ec68dc: [compiler-rt] Work around incompatible Windows def...
Alexander Richardson via All-commits
all-commits at lists.llvm.org
Thu Aug 29 15:59:47 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ec68dc1ca4d967b599f1202855917d5ec9cae52f
https://github.com/llvm/llvm-project/commit/ec68dc1ca4d967b599f1202855917d5ec9cae52f
Author: Alexander Richardson <alexrichardson at google.com>
Date: 2024-08-29 (Thu, 29 Aug 2024)
Changed paths:
M compiler-rt/lib/interception/interception.h
M compiler-rt/lib/interception/interception_type_test.cpp
M compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
Log Message:
-----------
[compiler-rt] Work around incompatible Windows definitions of (S)SIZE_T
The interceptor types are supposed to match size_t (and the non-Windows
ssize_t) exactly, but on 32-bit Windows `size_t` uses `unsigned int`
whereas `SIZE_T` is `unsigned long`. The current definition results in
`uptr` not matching `uintptr_t` since we otherwise get typedef
redefinition errors. Work around this by using a #define instead of
a typedef when defining SIZE_T.
It would probably be cleaner to stop using these uppercase types, but
that is a rather invasive change and this one is the minimal change to
allow uptr to match uintptr_t on Windows.
To ensure this compiles on Windows, we also remove the interceptor.h
defines of uptr (that do not always match __sanitizer::uptr) and rely
on __sanitizer::uptr instead. The interceptor types most likely predate
those other types so clean up the unnecessary definition while here.
This also reverts commit 18e06e3e2f3d47433e1ed323b8725c76035fc1ac and
commit bb27dd853a713866c025a94ead8f03a1e25d1b6e.
Reviewed By: mstorsjo, vitalybuka
Pull Request: https://github.com/llvm/llvm-project/pull/106311
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list