Commit 798584d
authored
MDBF-1214 Add WITH_{MSAN, ASAN, UBSAN} CMake support (#313)
* MDBF-1214 Add WITH_MSAN CMake support
Declare WITH_MSAN as a regular option for standalone Connector/C
builds.
When enabled directly in Connector/C, append MemorySanitizer compile and
link flags for Debug and RelWithDebInfo builds.
When Connector/C is included as a subproject, keep using the inherited
WITH_MSAN value only for sanitizer-specific linker behavior. This avoids
duplicating sanitizer flags already managed by parent projects.
* MDBF-1214 Add ASAN and UBSAN CMake support
Add standalone Connector/C options for WITH_ASAN and WITH_UBSAN.
Use a shared sanitizer flag helper for Debug and RelWithDebInfo builds,
covering compile flags and executable/shared/module linker flags.
Keep the flag handling disabled for subproject builds so Connector/C++
and ODBC continue to own sanitizer flags for their combined builds.
* MDBF-1214 Refine sanitizer CMake options
Add an opt-in WITH_ASAN_SCOPE option for Clang builds so ASAN can detect stack use after scope without adding the flag to linker options.
Enable MSVC ASAN stack use after return instrumentation and keep incremental linking disabled for those builds.
Reject MSAN when ASAN or UBSAN is also enabled. Remove the redundant ASAN -fPIC flag and keep UBSAN alignment checks enabled.1 parent 7564026 commit 798584d
1 file changed
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
82 | 149 | | |
83 | 150 | | |
84 | 151 | | |
| |||
566 | 633 | | |
567 | 634 | | |
568 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
569 | 640 | | |
570 | 641 | | |
571 | 642 | | |
| |||
0 commit comments