This is an archive of the discontinued LLVM Phabricator instance.

[fuzzer] Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp
ClosedPublic

Authored by metzman on Sep 5 2018, 11:55 AM.

Details

Summary

Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp
to get externally defined functions (eg: LLVMFuzzerInitialize,
LLVMFuzzerCustomMutator, etc) working again.

Also enable tests that depended on these functions (on windows)

Event Timeline

metzman created this revision.Sep 5 2018, 11:55 AM
metzman edited the summary of this revision. (Show Details)Sep 16 2018, 6:36 PM
metzman edited the summary of this revision. (Show Details)

@morehouse and @rnk: please take a look.

My patch essentially undoes this one by Marcos.
I can't tell for sure what problem that patch solved and I haven't been able to reproduce it.
I think that maybe the use of -fsanitize=fuzzer has made it so that the issue seen no longer appears.
I've tested many chrome fuzzers with my patch and the initial code, the initial code does not work for loading functions like LLVMFuzzerInitialize etc. in non-component (ie: MT) builds, whereas with my patch these functions are found.
This change might break (more than it already is broken) MD builds but I don't need this for Chrome and I think it makes most sense to get one kind of build fully working rather than having neither kind fully working.

Should I remove FuzzerExtFunctionsDlsymWin.cpp?
I'm unsure about doing so because in Marcos's patch he didn't remove FuzzerExtFunctionsWeakAlias.cpp and because I may find how use it properly later, in which case removing it might make the history uglier?

metzman retitled this revision from Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp to [fuzzer] Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp.Sep 17 2018, 7:01 AM
metzman added reviewers: rnk, morehouse.
This revision is now accepted and ready to land.Sep 17 2018, 9:35 AM
rnk accepted this revision.Sep 19 2018, 1:41 PM

lgtm

rnk added a comment.Sep 19 2018, 1:41 PM

Should I remove FuzzerExtFunctionsDlsymWin.cpp?
I'm unsure about doing so because in Marcos's patch he didn't remove FuzzerExtFunctionsWeakAlias.cpp and because I may find how use it properly later, in which case removing it might make the history uglier?

Missed this initially... I would go ahead and remove it.

metzman updated this revision to Diff 166335.Sep 20 2018, 11:17 AM
  • Remove unused file.
This revision was automatically updated to reflect the committed changes.
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptSep 20 2018, 4:28 PM