This is an archive of the discontinued LLVM Phabricator instance.

Fix broken 2-stage build when -tblgen tools may depend on runpath that is not yet built
AbandonedPublic

Authored by arcivanov on Feb 3 2022, 8:16 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Restricted Project
Summary

In my case -tblgen tools in the second stage end up being built depending on libc++.so.
While the the dependency is correct and the tools are built successfully, -tblgen tools would not function until libc++.so is built in the $ORIGIN/../lib.
But libc++.so of the second stage cannot be built without second stage llvm-tblgen and clang-tblgen functioning.

This patch makes sure that in a bootstrapped build llvm-tblgenand clang-tblgen are always used from the bootstrap even when not crosscompiling.

See https://github.com/llvm/llvm-project/issues/53561 for extensive logs, printouts and cmake caches.

If accepted please also send to 13.x and 14.x.

Diff Detail

Event Timeline

arcivanov created this revision.Feb 3 2022, 8:16 PM
arcivanov requested review of this revision.Feb 3 2022, 8:16 PM

So this change is insufficient as additional tools (lldb-tblgen and clang-ast-dump) will fail thereafter.
Since all those tools depend on libc++ being available for stage2-bins, the libc++ needs to be built on stage two (along with unwind and compiler-rt in my case).
The way I've tried to fix above is treating the symptom and not the cause.

arcivanov planned changes to this revision.Feb 4 2022, 6:09 AM
arcivanov abandoned this revision.Mar 29 2023, 6:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 6:23 PM