[llvm-libgcc] Fix symlink path for libcc when LLVM_ENABLE_PER_TARGET_… #165487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…RUNTIME_DIR is unset
current logic fails when LLVM_ENABLE_PER_TARGET_RUNTIME_DIR = OFF and it ends up with symlinks e.g.
libgcc.a -> ..//usr/lib/clang/21.1.4/lib/linux/libclang_rt.builtins.a
the real library is at
../lib/clang/21.1.4/lib/linux/libclang_rt.builtins-aarch64.a
The relative path is incorrect and its missing to add -arch suffix as well.
So we make checks a bit more explicit to cover this case.
The symlink for libgcc_so.1.0 is made to point to libunwind.so which is functionally correct but it fails some linux distro packaging complain because libunwind.so is made part of -dev package but libgcc_so.1.0 ends up in the real package, and creates an unneeded package -> dev dependency
create the symlink to point to libunwind.so.1 instead then the boundaries of packaging are not crossed and all is well.