Implement external functions for Windows using weak symbols with alias.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This one looks fine, but since I'm not sure which CLs depend on which other CLs, to avoid weird merge conflicts I will wait until the first ones go in before submitting this.
lib/Fuzzer/CMakeLists.txt | ||
---|---|---|
15–16 | do you have to change the file names? |
Look at it from another side.
What if we decide to switch Linux implementation to use dlsym?
Or what if we port to FreeBSD, where "weak" works equally well.
My suggestion is to not rename the existing files and to call the new file
FuzzerExtFunctionsWindows.cpp or FuzzerExtFunctionsWeakAlias.cpp
lib/Fuzzer/FuzzerCorpus.h | ||
---|---|---|
17 ↗ | (On Diff #80005) | is this a related change? |
lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp | ||
17 ↗ | (On Diff #80005) | do you need this change here? |
lib/Fuzzer/FuzzerExtFunctionsWeak.cpp | ||
16 ↗ | (On Diff #80005) | do you need this change here? |
lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp | ||
10 | Implementation using weak aliases. Works for Windows. |
lib/Fuzzer/FuzzerCorpus.h | ||
---|---|---|
17 ↗ | (On Diff #80005) | That header is required to include std::iota() declaration, in Windows. It is a detail, if you prefer, I can add that line in a different diff. |
lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp | ||
17 ↗ | (On Diff #80005) | @kcc Yes, it is needed to use the Printf() function. |
lib/Fuzzer/FuzzerExtFunctionsWeak.cpp | ||
16 ↗ | (On Diff #80005) | @kcc I remove an empty line, so the 3 files FuzzerExtFunctions*.cpp have the same format. If you prefer, I can remove that change. |
lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp | ||
10 | @kcc Ok, I will add that comment. |
do you have to change the file names?
We've spent quite some time with the Apple folks bike-shedding about these names...