This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Support symlinking runtimes under a different name
Needs ReviewPublic

Authored by phosek on Jan 26 2020, 5:42 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

When using the per-target runtimes directory layout with the runtimes
build, this change allows symlinking runtimes under a different target
(triple) name. The example use case is as follow:

set(LLVM_RUNTIME_TARGET_x86_64-linux-gnu_SYMLINK "x86_64-unknown-linux-gnu" CACHE STRING "")

This would create a symlink x86_64-linux-gnu pointing to the
x86_64-unknown-linux-gnu runtime directory.

Diff Detail

Event Timeline

phosek created this revision.Jan 26 2020, 5:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2020, 5:42 PM

This could be useful for us!

From my reading of the code, if you have e.g. armv7-none-linux-androideabi16 in your LLVM_RUNTIME_TARGETS, you could set LLVM_RUNTIME_TARGET_armv7-none-linux-androideabi16_SYMLINK to armv7-none-linux-andrdoieabi and it would create a symlink from armv7-none-linux-androideabi to armv7-none-linux-androideabi16. That's the opposite of what I'm reading in the description (though I think the code makes sense as-is).

llvm/runtimes/CMakeLists.txt
563

Maybe SYMLINKS instead of SYMLINK to reflect that there can be multiple?

584

Use add_llvm_install_targets?

590

Add dependencies for the *-stripped targets too?

There's also libraries which are installed outside the resource directory, right? E.g. libc++ and libc++abi.