This is an archive of the discontinued LLVM Phabricator instance.

[libc][CMake] Place archives in build/lib/<target-triple>
ClosedPublic

Authored by aidengrossman on May 27 2023, 7:52 PM.

Details

Summary

This patch moves the location of libllvmlibc.a within the build tree to
within ./lib/<target triple>. This more closely matches the behavior of
other runtime builds and allows for clang in the same build tree to
automatically be able to link against llvmlibc since this path is by
default included by the driver.

Also removes the LIBC_BINARY_DIR CMake flag since it isn't used anywhere
in the tree (based on a quick grep).

Diff Detail

Event Timeline

aidengrossman created this revision.May 27 2023, 7:52 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 27 2023, 7:52 PM
aidengrossman requested review of this revision.May 27 2023, 7:52 PM

This will be necessary for using https://reviews.llvm.org/D151013 in multi-stage builds automatically. This is the default behavior of the libcxx builds (logic was copied from there), which can be automatically linked against in multi-stage builds since clang by default includes this directory. I wasn't able to find any specific reason the LLVM libc static archives were placed where they were, but it's very possible I could be missing something there.

phosek accepted this revision.Jun 3 2023, 3:23 PM

LGTM

libc/cmake/modules/LLVMLibCLibraryRules.cmake
138

I think we should use ${LIBC_LIBRARY_DIR} here as well.

This revision is now accepted and ready to land.Jun 3 2023, 3:23 PM