On 2/23/24 06:23, Alexandre Oliva wrote:
I'm not so worried about bootstrap itself as I am about post-bootstrap host tools. Those are unusual in that, after native bootstraps, they're built using the just-built (last-stage) compiler and target libraries, rather than the host compiler and system libraries. While configuring them, we need LD_LIBRARY_PATH (or similar) set up so that native execution tests can pass, at the very least; while building them, we may need LD_LIBRARY_PATH set up so that dependent libraries are found and link correctly.
So, like gdb? Sure, if we built a stage3 gdb with the stage2 gcc and linked against the stage2 libstdc++.so, it would want to be able to find the stage2 libstdc++.so, or the stage3 in case of bootstrap-lean.
The problem, as you say, comes when you want to both bootstrap and build tools that aren't involved in the bootstrap process. To support that perhaps we want POSTBOOTSTRAP_HOST_EXPORTS for host modules without the bootstrap tag, and add the TARGET_LIB_PATH directories there?
Jason