This patch tries to fix sanitizer linkage errors on Darwin 10.6 (GCC's pr78663 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78663).
Since I don't have Darwin target available, I'm posting original patch for GCC as it is present in GCC bugzilla to initiate further discussion.
If (ugly) ifdef stuff is not acceptable, we can probably just introduce weak hooks for mmap and munmap that will fall back to regular mmap and munmap calls accordingly. For memmem we can probably print a warning.
Details
- Reviewers
kcc kubamracek - Commits
- rGe5f2bfaea9d9: [sanitizer] Fix 'dyld: Symbol not found: _memmem' linkage error on Darwin 10.6
rCRT293992: [sanitizer] Fix 'dyld: Symbol not found: _memmem' linkage error on Darwin 10.6
rL293992: [sanitizer] Fix 'dyld: Symbol not found: _memmem' linkage error on Darwin 10.6
Diff Detail
- Repository
- rL LLVM
Event Timeline
Maxim, I'm generally fine with this (a few nits), but 10.6 is really ancient today. We currently only support *running* (i.e. deployment target) on 10.9+, and building on 10.10+. All our Darwin buildbots (http://lab.llvm.org:8080/) are 10.10+.
I'm afraid that there will always be changes that break more and more stuff on 10.6 or even 10.7 and 10.8. If these are something that you need supported, we should get public buildbots of these configurations, and I'm afraid we can't provide them.
lib/sanitizer_common/sanitizer_mac.cc | ||
---|---|---|
96 ↗ | (On Diff #86300) | typo "one" |
107 ↗ | (On Diff #86300) | clang-format please |
199 ↗ | (On Diff #86300) | drop the space at the start of the line |
lib/sanitizer_common/sanitizer_platform_interceptors.h | ||
51 ↗ | (On Diff #86300) | drop the space between # and define |
56–60 ↗ | (On Diff #86300) | I don't think this is the right place for this. Can we put something like the following somewhere close to original place where SANITIZER_INTERCEPT_MEMMEM was defined: #define SI_MAC_DEPLOYMENT_BELOW_10_7 ... // memmem on Darwin doesn't exist on 10.6 #define SANITIZER_INTERCEPT_MEMMEM SI_NOT_WINDOWS && !SI_MAC_DEPLOYMENT_BELOW_10_7 ? |
Thank you for this information. Just to clarify: 10.6 means Darwin 10 (MACOS_VERSION_SNOW_LEOPARD), right? Because this is an original platform where linkage error occurred.
I'm afraid that there will always be changes that break more and more stuff on 10.6 or even 10.7 and 10.8. If these are something that you need supported, we should get public buildbots of these configurations, and I'm afraid we can't provide them.
Okay, got it, we'll probably need to disable sanitizers on Darwin 10 and older in future GCC releases (or just fix problems locally).
Thank you for this information. Just to clarify: 10.6 means Darwin 10 (MACOS_VERSION_SNOW_LEOPARD), right? Because this is an original platform where linkage error occurred.
Correct, macOS 10.6 is Snow Leopard.