Bug 188699

Summary: Adjust CMAKE_MODULE_LINKER_FLAGS for asan
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: Tools / TestsAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, commit-queue, don.olmstead, lforschler, mcatanzaro, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch none

Michael Catanzaro
Reported 2018-08-17 10:01:26 PDT
As suggested by Konstantin, it's good form to set CMAKE_MODULE_LINKER_FLAGS for when enabling asan.
Attachments
Patch (1.26 KB, patch)
2018-08-17 10:02 PDT, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2018-08-17 10:02:02 PDT
Michael Catanzaro
Comment 2 2018-08-17 10:09:06 PDT
Comment on attachment 347362 [details] Patch Hm, maybe should also set CMAKE_STATIC_LINKER_FLAGS
Konstantin Tokarev
Comment 3 2018-08-17 10:10:51 PDT
Comment on attachment 347362 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=347362&action=review > Source/cmake/WebKitCompilerFlags.cmake:177 > + set(CMAKE_MODULE_LINKER_FLAGS "-lpthread ${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address") It would be better to avoid duplication of flags, e.g. set(CMAKE_EXE_LINKER_FLAGS "-lpthread ${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
Konstantin Tokarev
Comment 4 2018-08-17 10:11:24 PDT
(In reply to Michael Catanzaro from comment #2) > Hm, maybe should also set CMAKE_STATIC_LINKER_FLAGS No, it's not needed
Michael Catanzaro
Comment 5 2018-08-17 11:06:10 PDT
(In reply to Konstantin Tokarev from comment #3) > It would be better to avoid duplication of flags, e.g. > > set(CMAKE_EXE_LINKER_FLAGS "-lpthread ${CMAKE_EXE_LINKER_FLAGS} > -fsanitize=address") > set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) > set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) Well that's no good, what if the user wants to set different flags? I checked what ECMEnableSanitizers is doing and it boils down to link_libraries("asan")
Konstantin Tokarev
Comment 6 2018-08-17 11:09:07 PDT
(In reply to Michael Catanzaro from comment #5) > (In reply to Konstantin Tokarev from comment #3) > > It would be better to avoid duplication of flags, e.g. > > > > set(CMAKE_EXE_LINKER_FLAGS "-lpthread ${CMAKE_EXE_LINKER_FLAGS} > > -fsanitize=address") > > set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) > > set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) > > Well that's no good, what if the user wants to set different flags? Oops. Just wanted to get away without additional variable, but it was surely wrong
Konstantin Tokarev
Comment 7 2018-08-17 11:10:41 PDT
(In reply to Michael Catanzaro from comment #5) > I checked what ECMEnableSanitizers is doing and it boils down to > link_libraries("asan") Yep, it should be fine, at least ECMEnableSanitizers works fine with QtWebKit
Michael Catanzaro
Comment 8 2018-08-17 11:19:04 PDT
Comment on attachment 347362 [details] Patch Bringing back this original patch... I was hoping to fix asan under flatpak here, but it's too much work for this bug.
WebKit Commit Bot
Comment 9 2018-08-18 08:00:19 PDT
Comment on attachment 347362 [details] Patch Clearing flags on attachment: 347362 Committed r235010: <https://trac.webkit.org/changeset/235010>
WebKit Commit Bot
Comment 10 2018-08-18 08:00:20 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2018-08-18 08:03:18 PDT
Note You need to log in before you can comment on or make changes to this bug.