-
Notifications
You must be signed in to change notification settings - Fork 480
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
crossbeam-utils: check only the architecture, not the whole target string #751
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases, the kinds of atomic operations supported depend on the OS. For example:
- x86_64-*: cmpxchg16b is available for all x86_64 macOS devices, so Atomic128 is available for x86_64 macOS but not for x86_64 Linux.
- riscv32imc-*: riscv32imc-esp-espidf has atomic, but riscv32imc-unknown-none-elf does not.
Currently, the recommended way to build for custom targets is to use rustflags to pass the cfgs.
I would accept a patch to improve the situation, but we need to handle the edge cases mentioned above (in a way that does not manually maintain a list of such targets, whenever possible).
…ring There can be custom targets in use, and it's not possible to make a list of them; for the check only the first item in the target string is actually relevant (the architecture of the target, which is generally consistent between standard and custom targets). Signed-off-by: Alexander Kanavin <alex@linutronix.de>
f55dd2d
to
3fd3805
Compare
Thanks. The context is that this patch comes from the efforts to cross-compile librsvg in the Yocto project, where crossbeam is included into the librsvg tarball as a vendored library. For various reasons Yocto cannot use the standard rust targets (e.g. the compiler binary is hardcoded in them to 'cc' which is something we cannot use). I guess I need to find out how to convince librsvg's build system to pass those custom flags to crossbeam, instead of running build.rs - if you can take the librsvg tarball and check what it does, I'd appreciate: Just for reference, you can see our configuration ('recipe' in yocto parlance) for librsvg here: |
So yes, it's actually easier to just pass the needed flags via RUSTFLAGS on architectures where it's needed:
Thanks! |
Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 (From OE-Core rev: e54f9d1b40b14038dced0cd071a3022a3ea9dff4) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 (From OE-Core rev: 97562668e1a76710acd2be7c8cdbcc1deb80bd9f) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
922: When building for linux, replace all vendors with 'unknown' r=taiki-e a=kanavin Some build systems such as the Yocto project define custom rust targets, of the form 'arch-somevendor-linux-{gnu|musl}' (only the 'somevendor' part is custom, the rest matches rust's definitions). This causes mismatches with crossbeam's lists of targets which are built from the standard rust target list, and always have 'unknown' as the vendor. This change simply replaces such custom vendors with 'unknown' when the third component of the target is 'linux'. --- Note from Alex: this is a reworked and hopefully better/more precise/acceptable version of #751 926: crossbeam-epoch: Bump memoffset to 0.7 r=taiki-e a=glittershark mostly to keep the number of dupes of crates in my dependency graph down Co-authored-by: Alexander Kanavin <alex@linutronix.de> Co-authored-by: Griffin Smith <root@gws.fyi>
…per-target Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 (From OE-Core rev: 97562668e1a76710acd2be7c8cdbcc1deb80bd9f) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
…per-target Do not try to mangle the upstream list of targets; after discussion with upstream it turns out it's neither necessary nor upstreamable: crossbeam-rs/crossbeam#751 (From OE-Core rev: 97562668e1a76710acd2be7c8cdbcc1deb80bd9f) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
There can be custom targets in use, and it's not possible to make a list
of them; for the check only the first item in the target string is actually
relevant (the architecture of the target, which is generally consistent
between standard and custom targets).
Signed-off-by: Alexander Kanavin alex@linutronix.de