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 | ||
---|---|---|
14 | 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 | is this a related change? | |
lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp | ||
17 | do you need this change here? | |
lib/Fuzzer/FuzzerExtFunctionsWeak.cpp | ||
16 | do you need this change here? | |
lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp | ||
9 ↗ | (On Diff #80005) | Implementation using weak aliases. Works for Windows. |
lib/Fuzzer/FuzzerCorpus.h | ||
---|---|---|
17 | 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 | @kcc Yes, it is needed to use the Printf() function. | |
lib/Fuzzer/FuzzerExtFunctionsWeak.cpp | ||
16 | @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 | ||
9 ↗ | (On Diff #80005) | @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...