Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update esysroot patch to fix prefix and Canadian Cross issues #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chewi
Copy link
Member

@chewi chewi commented Jan 4, 2025

This addresses bug #942672 by comparing ESYSROOT with BROOT rather than merely checking whether ESYSROOT is empty or /. Although both variables are set by Portage, I didn't want to assume they were fully normalised, so I applied libiberty's lrealpath helper.

It now also ignores ESYSROOT if CHOST is set but doesn't match the toolchain's target machine. This is necessary for a Canadian Cross. In that case, two cross-compilers are invoked, but only the one matching CHOST should have its sysroot set by ESYSROOT.

I've been slightly unsure whether this is the best approach. Another would be to check whether CTARGET does match if set. Or CHOST could be compared with CTARGET. CTARGET is rarely used though, and I didn't want to assume it would be in every case of this. The downside to comparing with the target machine is that it breaks if the compiler has been invoked using a different name, e.g. x86_64-cross-linux-gnu-gcc as a symlink to x86_64-pc-linux-gnu-gcc for a cheap "native cross" solution. I could be swayed here, so feedback welcome.

The code also moved up a few lines to accommodate another patch I'm going to submit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant