-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Why does Meson not automatically find the strip binary when cross-building? #14172
Comments
@jpakkane's original design goals for cross compiling included an intention to be very explicit (some might say, verbose) about the toolchain used. It's the same reason you explicitly specify the compiler in a cross file too. Meson now has |
@eli-schwartz Thank you for the clarification and for answering my question! I agree that being explicit is much safer than being implicit in most cases. It may cause more work for users, but at least, maintainers can be sure about the expected scenario. Please, tell me if there is a plan for adding automatic strip executable detection at least, or if Meson is open for contributions via PRs. Best regards! |
It's possible that we discussed this on the Debian bug tracking system rather than upstream, and my suggestion might have been rejected by an upstream maintainer sufficiently forcefully that I didn't think it was worth spending the time to suggest it in the upstream issue tracker and get it rejected again. At the moment, However, having cross-tools prefixed with a GNU architecture tuple is not Debian-specific: if anything it's more of a GNUism. Autotools systematically tries One way to achieve that could be for Or, another way to achieve that could be for Meson itself to be aware of the prefixing convention. |
It's not so much "assumes" but of "I do not know how other distros do this so do not guess but instead do the simple thing and wait for MRs from people who actually know how things should be". So if there is a way to do something along the lines of "reliably detect that we are on distro X and do all the custom things needed by it in env2mfile automatically so that nobody ever has to do that again" then that is definitely something that should happen. |
I think it happened in #debian-devel, where I am the only upstream maintainer. I said I found the idea intriguing and worth thinking about implementing. :) |
Hello team!
First I would like to thank you all for providing such a nice build tool, which is getting ever more popular.
I’ve noticed a behavior in Meson that seems divergent from other build systems like CMake and Autotools. I know they are different projects and may have different proposals.
When cross-building a project, Meson does not automatically find the strip binary, even though it warns about strip not being found, like this:
WARNING: Cross file does not specify strip binary, result will not be stripped.
This requires explicitly specifying the strip binary in the cross file or via the environment
STRIP=
, which can be inconvenient.In contrast, both CMake and Autotools automatically deduce and locate the appropriate strip binary for the target architecture during cross-compilation, because they use the triplet (compiler prefix) for it. This makes the process smoother and requires less manual configuration.
For instance, using CMake, I only set the compiler path and target architecture for my toolchain, like this:
Then, I run the CMake setup as usual:
Now, checking my CMake cache file, it lists the strip executable automatically found as well:
Of course, I can override the strip path as well, but that's not the case.
This issue may be related to #13755 as well.
Could you clarify why Meson diverges from this behavior?
Is it something that could be improved in future versions?
Thank you for your time and for this great project!
Cheers!
The text was updated successfully, but these errors were encountered: