File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -526,9 +526,14 @@ if (CLR_CMAKE_HOST_UNIX)
526526 # Disable frame pointer optimizations so profilers can get better call stacks
527527 add_compile_options (-fno-omit-frame-pointer)
528528
529- # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around
529+ # Make signed overflow well-defined. Implies the following flags in clang-20 and above.
530+ # -fwrapv - Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around
530531 # using twos-complement representation (this is normally undefined according to the C++ spec).
531- add_compile_options (-fwrapv)
532+ # -fwrapv-pointer - The same as -fwrapv but for pointers.
533+ add_compile_options (-fno-strict-overflow)
534+
535+ # Suppress C++ strict aliasing rules. This matches our use of MSVC.
536+ add_compile_options (-fno-strict-aliasing)
532537
533538 if (CLR_CMAKE_HOST_APPLE)
534539 # Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand.
You can’t perform that action at this time.
0 commit comments