This was already done for the sanitizers, but it needs to be done for
the profile and builtin libs as well.
Details
Diff Detail
Event Timeline
I suggest moving this logic into getCompilerRT and getting rid of the Env argument.
Beside the two functions this patch is changing, getCompilerRT is used in some MSVC-specific code which can not have llvm::Triple::Android, and it addSanitizerDynamicList.
The latter is interesting, because the current code is wrong, and the proposed change would fix it. Dot-sym files for android static runtime libraries are already generated with "-android" suffix, and the current implementation would fail to find them. There is no way to test it because android target defaults to shared runtime and there is no -static-libasan flag (as a counterpart to -shared-libasan).
The original reason that I didn't sink the logic into getClangRT was specifically because the original behavior was asymmetric. If it is supposed to be appended always, then sinking it is preferable.
Ah. I had avoided moving the logic into getCompilerRT because I thought the dynamic lists were supposed to be shared across the platforms. Should be correct now.
LGTM
lib/Driver/Tools.cpp | ||
---|---|---|
2139 | Minor nit: Id have moved it after the Suffix, so that all the strings are together. But, thats unimportant. |
Minor nit: Id have moved it after the Suffix, so that all the strings are together. But, thats unimportant.