This is an archive of the discontinued LLVM Phabricator instance.

[clang] Use -android environment for all compiler-rt libs.
ClosedPublic

Authored by danalbert on Jan 26 2015, 12:30 PM.

Diff Detail

Event Timeline

danalbert updated this revision to Diff 18776.Jan 26 2015, 12:30 PM
danalbert retitled this revision from to [clang] Use -android environment for all compiler-rt libs..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added reviewers: eugenis, srhines.
danalbert set the repository for this revision to rL LLVM.
danalbert added a subscriber: Unknown Object (MLST).
eugenis edited edge metadata.Jan 27 2015, 3:53 AM

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).

samsonov edited edge metadata.Jan 27 2015, 3:19 PM

+1 to what eugenis says.

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.

danalbert updated this revision to Diff 18909.Jan 28 2015, 11:17 AM
danalbert edited edge metadata.

Lower appending of '-android' into getCompilerRT.

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).

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.

samsonov accepted this revision.Jan 28 2015, 2:39 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 28 2015, 2:39 PM
danalbert closed this revision.Jan 28 2015, 3:25 PM

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.