[webkit-changes] [WebKit/WebKit] 751a8c: [WebGPU] Add the ability to fuzz wgslc

Myles C. Maxfield noreply at github.com
Fri Jul 21 00:49:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 751a8c03a46a2b18f88e4385e7c15a2dd49cbddf
      https://github.com/WebKit/WebKit/commit/751a8c03a46a2b18f88e4385e7c15a2dd49cbddf
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-07-21 (Fri, 21 Jul 2023)

  Changed paths:
    M Configurations/Sanitizers.xcconfig
    M Source/WebGPU/WGSL/wgslc.cpp
    M Tools/Scripts/set-webkit-configuration
    M Tools/Scripts/webkitdirs.pm

  Log Message:
  -----------
  [WebGPU] Add the ability to fuzz wgslc
https://bugs.webkit.org/show_bug.cgi?id=259355
rdar://112576959

Reviewed by David Kilzer.

The way this works is:
% set-webkit-configuration --debug --asan --libFuzzer
% cd Source/WebGPU
% make SCHEME=wgslc
% ASAN_OPTIONS=whatever DYLD_FRAMEWORK_PATH=/path/to/Products/Debug DYLD_LIBRARY_PATH=/path/to/Products/Debug /path/to/Products/Debug/wgslc

This patch adds a new configuration option, named "libFuzzer" to WebKit. It sets
the ENABLE_LIBFUZZER Xcode variable, which automatically adds -fsanitize=fuzzer to
compilations. It also sets the ENABLE_LIBFUZZER preprocessor macro, which we can
use to conditionally use LLVMFuzzerTestOneInput() instead of main() if fuzzing is
enabled. Enabling fuzzing also enables ASAN (because of course it does).

* Configurations/Sanitizers.xcconfig:
* Source/WebGPU/WGSL/wgslc.cpp:
(runWGSL):
(LLVMFuzzerTestOneInput):
* Tools/Scripts/set-webkit-configuration:
(printCurrentSettings):
* Tools/Scripts/webkitdirs.pm:
(determineLibFuzzerIsEnabled):
(libFuzzerIsEnabled):
(XcodeOptions):
(generateBuildSystemFromCMakeProject):

Canonical link: https://commits.webkit.org/266202@main




More information about the webkit-changes mailing list