This is an archive of the discontinued LLVM Phabricator instance.

Allow libFuzer to build with MSVC
AbandonedPublic

Authored by metzman on Jan 6 2019, 10:49 AM.

Details

Reviewers
None
Summary

Allow libFuzer to build with MSVC

Previously, libFuzzer on Windows could only be built with
clang-cl, this changes that by making libFuzzer compilable
with MSVC's cl.exe

The following changes were made to accomplish this:

  1. libFuzzer's handling of external functions on Windows was

changed to be compatible with MSVC (previously it relied on
attributes, which MSVC does not support.

  1. SanitizerCoverage's code-coverage instrumentation arrays

were changed so that MSVC's alignment wouldn't break
libFuzzer.

  1. Calls to __builtin functions were replaced with calls to

macros or functions that on POSIX call the builtins, but on
Windows, call Windows-specific intrinsics.

  1. Attributes were replaced by macros that on POSIX are

defined as attributes, but on Windows are defined as the
corresponding __declspec (if one exists).

Event Timeline

metzman created this revision.Jan 6 2019, 10:49 AM
metzman updated this revision to Diff 180406.Jan 6 2019, 11:09 AM

Improve comments, dont reformat if inconsistent

metzman updated this revision to Diff 182195.Jan 16 2019, 5:27 PM
  • add dllexport back
metzman abandoned this revision.Jan 24 2019, 5:42 PM

This change was broken up and landed.