diff --git a/tools/fuzzing/libfuzzer/LICENSE.TXT b/tools/fuzzing/libfuzzer/LICENSE.TXT index 555c8bb952fc..fa6ac5400070 100644 --- a/tools/fuzzing/libfuzzer/LICENSE.TXT +++ b/tools/fuzzing/libfuzzer/LICENSE.TXT @@ -1,10 +1,245 @@ ============================================================================== -LLVM Release License +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): ============================================================================== University of Illinois/NCSA Open Source License -Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign. +Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: @@ -42,27 +277,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. -============================================================================== -Copyrights and Licenses for Third Party Software Distributed with LLVM: -============================================================================== -The LLVM software contains code written by third parties. Such software will -have its own individual LICENSE.TXT file in the directory in which it appears. -This file will describe the copyrights, license, and restrictions which apply -to that code. - -The disclaimer of warranty in the University of Illinois Open Source License -applies to all code in the LLVM Distribution, and nothing in any of the -other licenses gives permission to use the names of the LLVM Team or the -University of Illinois to endorse or promote products derived from this -Software. - -The following pieces of software have additional or alternate copyrights, -licenses, and/or restrictions: - -Program Directory -------- --------- -Google Test llvm/utils/unittest/googletest -OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} -pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} -ARM contributions llvm/lib/Target/ARM/LICENSE.TXT -md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h diff --git a/tools/fuzzing/libfuzzer/clone_libfuzzer.sh b/tools/fuzzing/libfuzzer/clone_libfuzzer.sh deleted file mode 100755 index ca01df2978b0..000000000000 --- a/tools/fuzzing/libfuzzer/clone_libfuzzer.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -e - -# Optionally get revision from cmd line -[ $1 ] && REVISION=$1 || REVISION=76d07503f0c69f6632e6d8d4736e2a4cb4055a92 - -mkdir tmp -git clone --single-branch --no-checkout --shallow-since "2020-07-01" https://github.com/llvm/llvm-project tmp - -(cd tmp && git reset --hard $REVISION) - -# libFuzzer source files -CPPS=($(ls tmp/compiler-rt/lib/fuzzer/*.cpp | sort -r)) -CPPS=(${CPPS[@]##*/}) -CPPS=(${CPPS[@]##FuzzerMain*}) # ignored -CPPS=(${CPPS[@]##FuzzerInterceptors*}) # ignored - -# Update SOURCES entries -sed -e "/^SOURCES/,/^]/ {/'/d}" -i moz.build -for CPP in ${CPPS[@]}; do sed -e "/^SOURCES/ a \\ '${CPP}'," -i moz.build; done - -# Remove previous files -rm *.{cpp,h,def} - -# Copy files -cp tmp/compiler-rt/lib/fuzzer/*.{cpp,h,def} . - -# Apply local patches -for patch in patches/*.patch -do - patch -p4 < $patch -done - -# Remove the temporary directory -rm -Rf tmp/ - -echo "Updated libFuzzer to ${REVISION}" diff --git a/tools/fuzzing/libfuzzer/moz.yaml b/tools/fuzzing/libfuzzer/moz.yaml new file mode 100644 index 000000000000..f816cbca31fb --- /dev/null +++ b/tools/fuzzing/libfuzzer/moz.yaml @@ -0,0 +1,96 @@ +--- +schema: 1 + +bugzilla: + product: Core + component: General + +origin: + + name: fuzzer + + description: library for coverage-guided fuzz testing + + url: https://llvm.org/docs/LibFuzzer.html + + release: 76d07503f0c69f6632e6d8d4736e2a4cb4055a92 (2020-07-30T12:42:56Z). + + revision: 76d07503f0c69f6632e6d8d4736e2a4cb4055a92 + + license: Apache-2.0 + license-file: LICENSE.txt + +vendoring: + url: https://github.com/llvm/llvm-project + source-hosting: github + + keep: + - LICENSE.txt + + exclude: + - ".*" + - "*" + - "**" + + include: + - "compiler-rt/lib/fuzzer/*.h" + - "compiler-rt/lib/fuzzer/*.cpp" + - "compiler-rt/lib/fuzzer/*.def" + + patches: + - patches/10-ef-runtime.patch + - patches/11-callback-rv.patch + - patches/12-custom-mutator-fail.patch + - patches/13-unused-write.patch + - patches/14-explicit-allocator.patch + - patches/15-return-to-exit.patch + + update-actions: + - action: move-dir + from: '{yaml_dir}/compiler-rt/lib/fuzzer' + to: '{yaml_dir}' + - action: delete-path + path: '{yaml_dir}/FuzzerMain*' + - action: delete-path + path: '{yaml_dir}/FuzzerInterceptors*' + # The globbing from exclude skips all dot files, remove them here + - action: delete-path + path: clang/ + - action: delete-path + path: clang-tools-extra/ + - action: delete-path + path: compiler-rt/ + - action: delete-path + path: debuginfo-tests/ + - action: delete-path + path: flang/ + - action: delete-path + path: libc/ + - action: delete-path + path: libclc/ + - action: delete-path + path: libcxx/ + - action: delete-path + path: libcxxabi/ + - action: delete-path + path: libunwind/ + - action: delete-path + path: lld/ + - action: delete-path + path: lldb/ + - action: delete-path + path: llvm/ + - action: delete-path + path: mlir/ + - action: delete-path + path: openmp/ + - action: delete-path + path: parallel-libs/ + - action: delete-path + path: polly/ + - action: delete-path + path: pstl/ + - action: delete-path + path: test/ + - action: delete-path + path: utils/ diff --git a/tools/fuzzing/libfuzzer/patches/10-ef-runtime.patch b/tools/fuzzing/libfuzzer/patches/10-ef-runtime.patch index 34562e27a56e..a544f42bd75d 100644 --- a/tools/fuzzing/libfuzzer/patches/10-ef-runtime.patch +++ b/tools/fuzzing/libfuzzer/patches/10-ef-runtime.patch @@ -6,9 +6,9 @@ # Parent 997c4109edd112695097fd8c55cbacd976cab24a [libFuzzer] Allow external functions to be defined at runtime -diff --git a/tools/fuzzing/libfuzzer/FuzzerDriver.cpp b/tools/fuzzing/libfuzzer/FuzzerDriver.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerDriver.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerDriver.cpp +diff --git a/FuzzerDriver.cpp b/FuzzerDriver.cpp +--- a/FuzzerDriver.cpp ++++ b/FuzzerDriver.cpp @@ -608,17 +608,18 @@ static Vector ReadCorpora(con SizedFiles.push_back({File, Size}); return SizedFiles; diff --git a/tools/fuzzing/libfuzzer/patches/11-callback-rv.patch b/tools/fuzzing/libfuzzer/patches/11-callback-rv.patch index 650444442c41..3f9832b0a3ee 100644 --- a/tools/fuzzing/libfuzzer/patches/11-callback-rv.patch +++ b/tools/fuzzing/libfuzzer/patches/11-callback-rv.patch @@ -6,9 +6,9 @@ # Parent 8a2a26b33d516c43c366b2f24d731d27d9843349 [libFuzzer] Change libFuzzer callback contract to allow positive return values -diff --git a/tools/fuzzing/libfuzzer/FuzzerInternal.h b/tools/fuzzing/libfuzzer/FuzzerInternal.h ---- a/tools/fuzzing/libfuzzer/FuzzerInternal.h -+++ b/tools/fuzzing/libfuzzer/FuzzerInternal.h +diff --git a/FuzzerInternal.h b/FuzzerInternal.h +--- a/FuzzerInternal.h ++++ b/FuzzerInternal.h @@ -60,17 +60,17 @@ public: static void StaticAlarmCallback(); @@ -28,9 +28,9 @@ diff --git a/tools/fuzzing/libfuzzer/FuzzerInternal.h b/tools/fuzzing/libfuzzer/ void CrashResistantMergeInternalStep(const std::string &ControlFilePath); MutationDispatcher &GetMD() { return MD; } void PrintFinalStats(); -diff --git a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp +diff --git a/FuzzerLoop.cpp b/FuzzerLoop.cpp +--- a/FuzzerLoop.cpp ++++ b/FuzzerLoop.cpp @@ -463,17 +463,19 @@ static void RenameFeatureSetFile(const s DirPlusFile(FeaturesDir, NewFile)); } @@ -106,9 +106,9 @@ diff --git a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp b/tools/fuzzing/libfuzzer/Fu if (Options.OutputCorpus.empty()) return ""; std::string Path = DirPlusFile(Options.OutputCorpus, Hash(U)); -diff --git a/tools/fuzzing/libfuzzer/FuzzerMerge.cpp b/tools/fuzzing/libfuzzer/FuzzerMerge.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerMerge.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerMerge.cpp +diff --git a/FuzzerMerge.cpp b/FuzzerMerge.cpp +--- a/FuzzerMerge.cpp ++++ b/FuzzerMerge.cpp @@ -223,17 +223,19 @@ void Fuzzer::CrashResistantMergeInternal U.shrink_to_fit(); } diff --git a/tools/fuzzing/libfuzzer/patches/12-custom-mutator-fail.patch b/tools/fuzzing/libfuzzer/patches/12-custom-mutator-fail.patch index 2457c1f04634..13bcedc872c0 100644 --- a/tools/fuzzing/libfuzzer/patches/12-custom-mutator-fail.patch +++ b/tools/fuzzing/libfuzzer/patches/12-custom-mutator-fail.patch @@ -6,9 +6,9 @@ # Parent ea198a0331a6db043cb5978512226977514104db [libFuzzer] Allow custom mutators to fail -diff --git a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp +diff --git a/FuzzerLoop.cpp b/FuzzerLoop.cpp +--- a/FuzzerLoop.cpp ++++ b/FuzzerLoop.cpp @@ -690,16 +690,20 @@ void Fuzzer::MutateAndTestOne() { if (II.HasFocusFunction && !II.DataFlowTraceForFocusFunction.empty() && Size <= CurrentMaxMutationLen) diff --git a/tools/fuzzing/libfuzzer/patches/13-unused-write.patch b/tools/fuzzing/libfuzzer/patches/13-unused-write.patch index f8ef7a5ac96e..7aaa8cf84f06 100644 --- a/tools/fuzzing/libfuzzer/patches/13-unused-write.patch +++ b/tools/fuzzing/libfuzzer/patches/13-unused-write.patch @@ -6,9 +6,9 @@ # Parent 64e7d096fa77a62b71a306b2c5383b8f75ac4945 [libFuzzer] Suppress warnings about unused return values -diff --git a/tools/fuzzing/libfuzzer/FuzzerIO.cpp b/tools/fuzzing/libfuzzer/FuzzerIO.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerIO.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerIO.cpp +diff --git a/FuzzerIO.cpp b/FuzzerIO.cpp +--- a/FuzzerIO.cpp ++++ b/FuzzerIO.cpp @@ -3,16 +3,17 @@ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -46,9 +46,9 @@ diff --git a/tools/fuzzing/libfuzzer/FuzzerIO.cpp b/tools/fuzzing/libfuzzer/Fuzz long E = Epoch ? *Epoch : 0; Vector Files; ListFilesInDirRecursive(Path, Epoch, &Files, /*TopDir*/true); -diff --git a/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp b/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp ---- a/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp +diff --git a/FuzzerIOPosix.cpp b/FuzzerIOPosix.cpp +--- a/FuzzerIOPosix.cpp ++++ b/FuzzerIOPosix.cpp @@ -2,16 +2,17 @@ // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. diff --git a/tools/fuzzing/libfuzzer/patches/14-explicit-allocator.patch b/tools/fuzzing/libfuzzer/patches/14-explicit-allocator.patch index 8e02273193d1..178173228658 100644 --- a/tools/fuzzing/libfuzzer/patches/14-explicit-allocator.patch +++ b/tools/fuzzing/libfuzzer/patches/14-explicit-allocator.patch @@ -6,9 +6,9 @@ # Parent 6c779ec81530b6784a714063af66085681ab7318 [libFuzzer] Make fuzzer_allocator explicit -diff --git a/tools/fuzzing/libfuzzer/FuzzerDefs.h b/tools/fuzzing/libfuzzer/FuzzerDefs.h ---- a/tools/fuzzing/libfuzzer/FuzzerDefs.h -+++ b/tools/fuzzing/libfuzzer/FuzzerDefs.h +diff --git a/FuzzerDefs.h b/FuzzerDefs.h +--- a/FuzzerDefs.h ++++ b/FuzzerDefs.h @@ -41,17 +41,17 @@ extern ExternalFunctions *EF; // We are using a custom allocator to give a different symbol name to STL // containers in order to avoid ODR violations. diff --git a/tools/fuzzing/libfuzzer/patches/15-return-to-exit.patch b/tools/fuzzing/libfuzzer/patches/15-return-to-exit.patch index 4adb9f59a9b2..14923f93636c 100644 --- a/tools/fuzzing/libfuzzer/patches/15-return-to-exit.patch +++ b/tools/fuzzing/libfuzzer/patches/15-return-to-exit.patch @@ -4,10 +4,10 @@ Date: Mon Mar 1 15:47:38 2021 -0500 [libfuzzer] In most cases, return instead of exit(). -diff --git a/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.cpp b/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.cpp +diff --git a/FuzzerDataFlowTrace.cpp b/FuzzerDataFlowTrace.cpp index 0e9cdf7e66b1..06ea287a3cfe 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.cpp +--- a/FuzzerDataFlowTrace.cpp ++++ b/FuzzerDataFlowTrace.cpp @@ -102,9 +102,11 @@ Vector BlockCoverage::FunctionWeights(size_t NumFunctions) const { return Res; } @@ -98,10 +98,10 @@ index 0e9cdf7e66b1..06ea287a3cfe 100644 } int CollectDataFlow(const std::string &DFTBinary, const std::string &DirPath, -diff --git a/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.h b/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.h +diff --git a/FuzzerDataFlowTrace.h b/FuzzerDataFlowTrace.h index d6e3de30a4ef..767bad24f1d0 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.h -+++ b/tools/fuzzing/libfuzzer/FuzzerDataFlowTrace.h +--- a/FuzzerDataFlowTrace.h ++++ b/FuzzerDataFlowTrace.h @@ -113,8 +113,8 @@ class BlockCoverage { class DataFlowTrace { @@ -113,10 +113,10 @@ index d6e3de30a4ef..767bad24f1d0 100644 Vector &CorporaFiles, Random &Rand); void Clear() { Traces.clear(); } const Vector *Get(const std::string &InputSha1) const { -diff --git a/tools/fuzzing/libfuzzer/FuzzerDriver.cpp b/tools/fuzzing/libfuzzer/FuzzerDriver.cpp +diff --git a/FuzzerDriver.cpp b/FuzzerDriver.cpp index cd720200848b..bedad16efa7b 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerDriver.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerDriver.cpp +--- a/FuzzerDriver.cpp ++++ b/FuzzerDriver.cpp @@ -326,7 +326,7 @@ int CleanseCrashInput(const Vector &Args, if (Inputs->size() != 1 || !Flags.exact_artifact_path) { Printf("ERROR: -cleanse_crash should be given one input file and" @@ -318,10 +318,10 @@ index cd720200848b..bedad16efa7b 100644 } extern "C" ATTRIBUTE_INTERFACE int -diff --git a/tools/fuzzing/libfuzzer/FuzzerFork.cpp b/tools/fuzzing/libfuzzer/FuzzerFork.cpp +diff --git a/FuzzerFork.cpp b/FuzzerFork.cpp index d9e6b79443e0..ee2a99a250c1 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerFork.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerFork.cpp +--- a/FuzzerFork.cpp ++++ b/FuzzerFork.cpp @@ -177,14 +177,16 @@ struct GlobalEnv { return Job; } @@ -432,10 +432,10 @@ index d9e6b79443e0..ee2a99a250c1 100644 } } // namespace fuzzer -diff --git a/tools/fuzzing/libfuzzer/FuzzerFork.h b/tools/fuzzing/libfuzzer/FuzzerFork.h +diff --git a/FuzzerFork.h b/FuzzerFork.h index b29a43e13fbc..1352171ad49d 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerFork.h -+++ b/tools/fuzzing/libfuzzer/FuzzerFork.h +--- a/FuzzerFork.h ++++ b/FuzzerFork.h @@ -16,7 +16,7 @@ #include @@ -445,10 +445,10 @@ index b29a43e13fbc..1352171ad49d 100644 const Vector &Args, const Vector &CorpusDirs, int NumJobs); } // namespace fuzzer -diff --git a/tools/fuzzing/libfuzzer/FuzzerIO.cpp b/tools/fuzzing/libfuzzer/FuzzerIO.cpp +diff --git a/FuzzerIO.cpp b/FuzzerIO.cpp index 0053ef39f2b9..6be2be67c691 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerIO.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerIO.cpp +--- a/FuzzerIO.cpp ++++ b/FuzzerIO.cpp @@ -82,7 +82,9 @@ void ReadDirToVectorOfUnits(const char *Path, Vector *V, long *Epoch, size_t MaxSize, bool ExitOnError) { long E = Epoch ? *Epoch : 0; @@ -478,10 +478,10 @@ index 0053ef39f2b9..6be2be67c691 100644 } std::string DirPlusFile(const std::string &DirPath, -diff --git a/tools/fuzzing/libfuzzer/FuzzerIO.h b/tools/fuzzing/libfuzzer/FuzzerIO.h +diff --git a/FuzzerIO.h b/FuzzerIO.h index 6e4368b971fa..6c90ba637322 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerIO.h -+++ b/tools/fuzzing/libfuzzer/FuzzerIO.h +--- a/FuzzerIO.h ++++ b/FuzzerIO.h @@ -60,7 +60,7 @@ void RawPrint(const char *Str); bool IsFile(const std::string &Path); size_t FileSize(const std::string &Path); @@ -500,10 +500,10 @@ index 6e4368b971fa..6c90ba637322 100644 char GetSeparator(); // Similar to the basename utility: returns the file name w/o the dir prefix. -diff --git a/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp b/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp +diff --git a/FuzzerIOPosix.cpp b/FuzzerIOPosix.cpp index 4b453d286c80..1a50295c010f 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerIOPosix.cpp +--- a/FuzzerIOPosix.cpp ++++ b/FuzzerIOPosix.cpp @@ -53,16 +53,16 @@ std::string Basename(const std::string &Path) { return Path.substr(Pos + 1); } @@ -543,10 +543,10 @@ index 4b453d286c80..1a50295c010f 100644 } -diff --git a/tools/fuzzing/libfuzzer/FuzzerIOWindows.cpp b/tools/fuzzing/libfuzzer/FuzzerIOWindows.cpp +diff --git a/FuzzerIOWindows.cpp b/FuzzerIOWindows.cpp index 651283a551cf..0e977bd02557 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerIOWindows.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerIOWindows.cpp +--- a/FuzzerIOWindows.cpp ++++ b/FuzzerIOWindows.cpp @@ -98,11 +98,12 @@ size_t FileSize(const std::string &Path) { return size.QuadPart; } @@ -593,10 +593,10 @@ index 651283a551cf..0e977bd02557 100644 } -diff --git a/tools/fuzzing/libfuzzer/FuzzerInternal.h b/tools/fuzzing/libfuzzer/FuzzerInternal.h +diff --git a/FuzzerInternal.h b/FuzzerInternal.h index 1f7d671ed848..cc2650b58ef1 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerInternal.h -+++ b/tools/fuzzing/libfuzzer/FuzzerInternal.h +--- a/FuzzerInternal.h ++++ b/FuzzerInternal.h @@ -35,8 +35,8 @@ public: Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD, FuzzingOptions Options); @@ -644,10 +644,10 @@ index 1f7d671ed848..cc2650b58ef1 100644 void PurgeAllocator(); void ReportNewCoverage(InputInfo *II, const Unit &U); void PrintPulseAndReportSlowInput(const uint8_t *Data, size_t Size); -diff --git a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp +diff --git a/FuzzerLoop.cpp b/FuzzerLoop.cpp index 4c4e8c271b1f..e7dfc187dbfe 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerLoop.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerLoop.cpp +--- a/FuzzerLoop.cpp ++++ b/FuzzerLoop.cpp @@ -254,12 +254,20 @@ void Fuzzer::ExitCallback() { _Exit(Options.ErrorExitCode); } @@ -753,10 +753,10 @@ index 4c4e8c271b1f..e7dfc187dbfe 100644 } void Fuzzer::MinimizeCrashLoop(const Unit &U) { -diff --git a/tools/fuzzing/libfuzzer/FuzzerMerge.cpp b/tools/fuzzing/libfuzzer/FuzzerMerge.cpp +diff --git a/FuzzerMerge.cpp b/FuzzerMerge.cpp index 919eea848580..0a185c7325bb 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerMerge.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerMerge.cpp +--- a/FuzzerMerge.cpp ++++ b/FuzzerMerge.cpp @@ -28,11 +28,12 @@ bool Merger::Parse(const std::string &Str, bool ParseCoverage) { return Parse(SS, ParseCoverage); } @@ -895,10 +895,10 @@ index 919eea848580..0a185c7325bb 100644 } } // namespace fuzzer -diff --git a/tools/fuzzing/libfuzzer/FuzzerMerge.h b/tools/fuzzing/libfuzzer/FuzzerMerge.h +diff --git a/FuzzerMerge.h b/FuzzerMerge.h index e0c6bc539bdb..6dc1c4c45abf 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerMerge.h -+++ b/tools/fuzzing/libfuzzer/FuzzerMerge.h +--- a/FuzzerMerge.h ++++ b/FuzzerMerge.h @@ -63,7 +63,7 @@ struct Merger { bool Parse(std::istream &IS, bool ParseCoverage); @@ -917,10 +917,10 @@ index e0c6bc539bdb..6dc1c4c45abf 100644 const Vector &OldCorpus, const Vector &NewCorpus, Vector *NewFiles, -diff --git a/tools/fuzzing/libfuzzer/FuzzerTracePC.cpp b/tools/fuzzing/libfuzzer/FuzzerTracePC.cpp +diff --git a/FuzzerTracePC.cpp b/FuzzerTracePC.cpp index b2ca7693e540..fbceda39bc22 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerTracePC.cpp -+++ b/tools/fuzzing/libfuzzer/FuzzerTracePC.cpp +--- a/FuzzerTracePC.cpp ++++ b/FuzzerTracePC.cpp @@ -238,13 +238,13 @@ void TracePC::IterateCoveredFunctions(CallBack CB) { } } @@ -953,10 +953,10 @@ index b2ca7693e540..fbceda39bc22 100644 } bool TracePC::ObservedFocusFunction() { -diff --git a/tools/fuzzing/libfuzzer/FuzzerTracePC.h b/tools/fuzzing/libfuzzer/FuzzerTracePC.h +diff --git a/FuzzerTracePC.h b/FuzzerTracePC.h index 501f3b544971..b46ebb909dbf 100644 ---- a/tools/fuzzing/libfuzzer/FuzzerTracePC.h -+++ b/tools/fuzzing/libfuzzer/FuzzerTracePC.h +--- a/FuzzerTracePC.h ++++ b/FuzzerTracePC.h @@ -116,7 +116,7 @@ class TracePC { CB(PC); }