[scudo standalone] Why is it required to resolve all symbols at build time?

For scudo_standalone sanitizer there are a bunch of flags added to compiler command:

list(APPEND SCUDO_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro)

As I understand these flags are used to avoid unresolved symbols.
I wonder why do we have to resolve all the symbols at build time for scudo_standalone? There is no such requirements for other sanitizers.

Those link flags were added in the original commit of Scudo (https://reviews.llvm.org/D57412). Given that (a) no users of scudo (fuchsia, android) use the cmake build system (except the compiler-rt tests), and (b) changes to how scudo actually implements malloc() and such have happened over time, these flags may be vestigial. You should try removing them one at a time and see what happens - that’s the only way to determine whether they’re necessary given that there’s no context-providing comment on the source files.

1 Like

Thank you for your prompt reply.
I have already built scudo_sanitizer without these flags, and everything seems fine, that’s why I started wondering about them.
Well, since there is no context, I think we won’t be able to figure out much there.