-
Notifications
You must be signed in to change notification settings - Fork 12.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
Create armv4t_none_eabi.rs #99226
Create armv4t_none_eabi.rs #99226
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
|
To speed up the review process of this PR, can you add to your initial message the answers to the Tier 3 Target Tier Policy. Example here #94872 (comment). As well as adding an entry in |
@Urgau docs updated. |
This comment has been minimized.
This comment has been minimized.
Does mixing targets work? I.e. building What about crates that want to default to a32, but downstream is t32? Will the crates all get built as t32? Would it be more reasonable to only have one target, and instead allow the Maybe I'm misunderstanding, but I believe the |
Excellent questions
Yes, sorta. The linker handles it just fine. At the moment the compiler doesn't do this at all. But if you manually tell the compiler to link in a Given that newer devices don't use interworking like this, I think that it's extremely unlikely that the compiler will learn how to casually mix code from two different targets any time soon.
All crates are built according to the target you build them for, not their own wishes. If a crate is only appropriate on some targets (eg: it uses explicit
While that's a neat idea, it wouldn't help in this case. The (the exception to this is certain limited cases where rustc will inline before handing things to llvm, so a particular Separately, a person might not be interested in using thumb code at all. It's entirely possible to just use
Yes: Not only are there some CPUs that support arm/thumb interworking, but there's also CPUs that came out after that which only support thumb mode. (Technically it's an extension of thumb called "thumb2", but the point is that such CPUs don't support ARM mode at all.)
|
…me-pointer, r=davidtwco Fix thumbv4t-none-eabi frame pointer setting The `thumb_base` profile has changed since I last remember seeing it, and now it sets the frame pointer to "always keep", which is not desired for this target. Hooking a debugger to the running program is not really done, it's preferable to have the register available for actual program use, so the default "may omit" is now set. I thought that the target was already using "may omit" when I checked on it last month, because I forgot that the target was previously based on `thumb_base` rather than `Default::default()`. I only noticed the issue just now when creating the `armv4t-none-eabi` target (rust-lang#99226), though this PR is not in any way conditional on that one.
@jackh726 ping |
@Lokathor can you squash the commits? There's a merge commit in there |
i can but this'll take a while because i'll have to clone the repo |
uh, apparently i cant? when i try to squash them together with the desktop program It's telling me
I have no idea how git works though so maybe some other cli thing can still do it? |
hmm |
I just made #100244 instead. |
…2, r=jackh726 Add armv4t-none-eabi take2 This is the same as the previous PR (rust-lang#99226) but i just made a fresh branch without a merge commit in it. --- ### armv4t-none-eabi target quiz > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. That's me! > Targets must use naming consistent with any existing targets We're using the existing name as recognized by LLVM and GCC > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. No legal issues here. >> The target must not introduce license incompatibilities. No license requirements here. >> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). check >> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. no new deps, we're just adding a rustc target description file for a target llvm already knows about. >> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. bare-metal target, doesn't rely on any libs at all. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate `core` only here. You could build `alloc` too, but you'd have to bring your own global allocator. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the `compiler-builtins` crate has already been updated as necessary to fix any missing builtin function gaps. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. check.
This adds a target description for the
armv4t-none-eabi
target, intended as a new Tier 3 target.This target is essentially intended to be nearly identical to
thumbv4t-none-eabi
, except that functions codegen asa32
code by default instead of usingt32
. Said another way: thethumb
CPU feature is off by default for this target.This is not intended to be related to the existing
armv4t-unknown-linux-gnueabi
target. I haven't spoken with them at all, but that's for a linux device, and this is a bare metal device.armv4t-none-eabi target quiz
That's me!
We're using the existing name as recognized by LLVM and GCC
No legal issues here.
No license requirements here.
check
no new deps, we're just adding a rustc target description file for a target llvm already knows about.
bare-metal target, doesn't rely on any libs at all.
core
only here. You could buildalloc
too, but you'd have to bring your own global allocator.LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR.
No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the
compiler-builtins
crate has already been updated as necessary to fix any missing builtin function gaps.check.