[Webkit-unassigned] [Bug 188460] [CMake] Add ENABLE_UNDEFINED_BEHAVIOR_SANITIZER to make it easier to build with UBSan

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 10 06:47:58 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=188460

--- Comment #6 from Michael Catanzaro <mcatanzaro at igalia.com> ---
(In reply to Konstantin Tokarev from comment #5)
> Comment on attachment 346878 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=346878&action=review
> 
> > Source/cmake/WebKitCompilerFlags.cmake:185
> > +        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=undefined")
> 
> 1. Ideally, when CMAKE_EXE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS are
> modified, one should also modify CMAKE_MODULE_LINKER_FLAGS

Don, you should of course fix ENABLE_ADDRESS_SANITIZER as well, then.

> 2. Why not just use ECMEnableSanitizers? [1] At least it makes sense to
> borrow there ideas, e.g. there must be a reason why they use
> -fno-optimize-sibling-calls with ubsan as well.

No opinion from me on this, except the -DECM prefix on the CMake option is not great.

(In reply to Fujii Hironori from comment #4)
> Some code is intentionally using undefined behavior.

Scary.

> It seems that you should define ASAN_ENABLED macro.

Perhaps, but perhaps undefined behavior should always be avoided.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180810/1eca86fd/attachment.html>


More information about the webkit-unassigned mailing list