NEW 182247
[GTK] Should pass through CFLAGS and LDFLAGS when creating gir files
https://bugs.webkit.org/show_bug.cgi?id=182247
Summary [GTK] Should pass through CFLAGS and LDFLAGS when creating gir files
Michael Catanzaro
Reported 2018-01-29 09:14:29 PST
In a private bug, I received the following instructions on how to compile and run WebKitGTK+ with address sanitizer support. Step 1 should not be necessary; we should make this just work somehow. 1. Add appropriate ASAN flags to CFLAGS and LDFLAGS in Source/WebKit/PlatformGTK.cmake Relevant parts: add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir DEPENDS WebKit2 DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=\"-Wno-deprecated-declarations -fsanitize=address\" LDFLAGS=\"-fsanitize=address\" ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}" ${INTROSPECTION_SCANNER} ... and add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=\"-Wno-deprecated-declarations -fsanitize=address\" LDFLAGS=\"${INTROSPECTION_ADDITIONAL_LDFLAGS} -fsanitize=address\" ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}" ${INTROSPECTION_SCANNER} 2. export CC=/usr/bin/clang export CXX=/usr/bin/clang++ export CFLAGS="-g -fsanitize=address" export CXXFLAGS="-g -fsanitize=address" export LDFLAGS="-g -fsanitize=address" export ASAN_OPTIONS="detect_leaks=0"
Attachments
Michael Catanzaro
Comment 1 2018-01-29 11:15:21 PST
Also we probably should not be generating gir files when ENABLE_INTROSPECTION is turned off. This whole big chunk of code ought to go under that conditional.
Michael Catanzaro
Comment 2 2018-06-26 14:46:46 PDT
(In reply to Michael Catanzaro from comment #1) > Also we probably should not be generating gir files when > ENABLE_INTROSPECTION is turned off. This whole big chunk of code ought to go > under that conditional. We fixed this at some point, so now I think all we need is to pass through CFLAGS and LDFLAGS.
Note You need to log in before you can comment on or make changes to this bug.