emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.79k stars 3.31k forks source link

Upstream emscripten compiler-rt changes (In particular the new asan, lsan, platform support) #15097

Open sbc100 opened 3 years ago

sbc100 commented 4 months ago

I think this is largely don't now isn't it @aheejin ?

aheejin commented 4 months ago

I don't think so? At least I haven't upstreamed any compiler-rt changes myself. (I only upstreamed Wasm EH-related changes libc++abi / libunwind) Running grep on the upstream LLVM's compiler-rt directory doesn't yield much. I'm not sure what those LIBFUZZER_EMSCRIPTEN things are but they are not our sanitizer changes.

aheejin@aheejin:~/llvm-project/compiler-rt$ grep EMSCRIPTEN * -R
lib/orc/endianness.h:    defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
lib/fuzzer/FuzzerDriver.cpp:#if !LIBFUZZER_EMSCRIPTEN
lib/fuzzer/FuzzerDriver.cpp:#endif // LIBFUZZER_EMSCRIPTEN
lib/fuzzer/FuzzerExtFunctionsWeak.cpp:    LIBFUZZER_FREEBSD || LIBFUZZER_EMSCRIPTEN
lib/fuzzer/FuzzerExtraCounters.cpp:    LIBFUZZER_FUCHSIA || LIBFUZZER_EMSCRIPTEN
lib/fuzzer/FuzzerUtilLinux.cpp:    LIBFUZZER_EMSCRIPTEN
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 0
lib/fuzzer/FuzzerPlatform.h:#elif __EMSCRIPTEN__
lib/fuzzer/FuzzerPlatform.h:#define LIBFUZZER_EMSCRIPTEN 1
lib/fuzzer/FuzzerPlatform.h:   LIBFUZZER_FREEBSD || LIBFUZZER_EMSCRIPTEN)
lib/fuzzer/FuzzerUtilPosix.cpp:  if (Options.HandleAlrm && Options.UnitTimeoutSec > 0 && !LIBFUZZER_EMSCRIPTEN)
lib/fuzzer/FuzzerUtilPosix.cpp:      LIBFUZZER_EMSCRIPTEN) {
kleisauke commented 4 months ago

FWIW, this might be easier to do after (draft) PR #19559 lands. That is, it mostly reverts the Emscripten-specific syscall changes in sanitizer_linux.cpp in favor of libc calls in sanitizer_emscripten.cpp, similar to the NetBSD and macOS implementations.