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

Add initial support for m68k-unknown-linux-gnu #2414

Merged
merged 1 commit into from
Feb 6, 2022

Conversation

glaubitz
Copy link
Contributor

This adds initial support for m68k-unknown-linux-gnu to libc.

CC @ricky26 @jrtc27

@rust-highfive
Copy link

r? @JohnTitor

(rust-highfive has picked a reviewer for you, use r? to override)

src/unix/linux_like/linux/gnu/b32/m68k/align.rs Outdated Show resolved Hide resolved
src/unix/linux_like/linux/gnu/b32/m68k/mod.rs Show resolved Hide resolved
src/unix/linux_like/linux/gnu/b32/m68k/mod.rs Outdated Show resolved Hide resolved
src/unix/linux_like/linux/gnu/b32/m68k/mod.rs Outdated Show resolved Hide resolved
src/unix/linux_like/linux/gnu/b32/m68k/mod.rs Outdated Show resolved Hide resolved
@glaubitz glaubitz force-pushed the m68k-linux branch 4 times, most recently from 28c9d7e to ffc15dd Compare September 21, 2021 15:30
@JohnTitor
Copy link
Member

JohnTitor commented Sep 24, 2021

If it works fine on the platform, I could rubber-stamp this. Is the review from cc'd people complete?

@glaubitz
Copy link
Contributor Author

I will have to fix the remaining issues first that @jrtc27 has mentioned. I'll ping you back once we're ready.

dkm added a commit to dkm/misc-builder that referenced this pull request Oct 1, 2021
Make the last revision argument optional for easier local use.

Change git URL for rustc_cg_gcc as it's now part of rust-lang:

 rust-lang/libc#2414

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit to compiler-explorer/misc-builder that referenced this pull request Nov 14, 2021
Make the last revision argument optional for easier local use.

Change git URL for rustc_cg_gcc as it's now part of rust-lang:

 rust-lang/libc#2414

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
@glaubitz glaubitz force-pushed the m68k-linux branch 3 times, most recently from 76349f3 to efe27af Compare January 25, 2022 12:36
@glaubitz
Copy link
Contributor Author

I will have to review all the constants again before we can consider this ready-for-merge.

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 1, 2022

@jrtc27 @JohnTitor I have updated the definitions now and they should now all be correct.

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 1, 2022

Could someone clear the S-waiting-on-author? Thanks!

@glaubitz glaubitz force-pushed the m68k-linux branch 2 times, most recently from e19a267 to 7a8bd4d Compare February 1, 2022 19:03
@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 2, 2022

@bors r?

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 3, 2022

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned JohnTitor Feb 3, 2022
@Amanieu
Copy link
Member

Amanieu commented Feb 6, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2022

📌 Commit 9fa467e has been approved by Amanieu

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 6, 2022

@jrtc27 Could you briefly comment on the max_align_t struct? I'm not sure I got it right:

#[allow(missing_debug_implementations)]
#[repr(align(2))]
pub struct max_align_t {
       priv_: [i8; 12]
}

@Amanieu I'm not sure whether the current max_align_t matches what the glibc does.

@Amanieu
Copy link
Member

Amanieu commented Feb 6, 2022

My recommendation would be to check against a m68k C toolchain:

#include <stddef.h>
int foo = sizeof(max_align_t);

Generate assembly code with -S and check the value of foo.

@bors r-

Let me know once you've checked the value.

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 6, 2022

@Amanieu Perfect, thank you! That's what I was looking for!

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 6, 2022

OK, it's 20 bytes:

#NO_APP
        .file   "max_align.c"
        .text
        .globl  foo
        .data
        .align  2
        .type   foo, @object
        .size   foo, 4
foo:
        .long   20
        .ident  "GCC: (Debian 11.2.0-14) 11.2.0"
        .section        .note.GNU-stack,"",@progbits

Not sure how that translates into the Rust struct.

Would that be:

#[allow(missing_debug_implementations)]
#[repr(align(2))]
pub struct max_align_t {
       priv_: [i8; 20]
}

?

@glaubitz
Copy link
Contributor Author

glaubitz commented Feb 6, 2022

@Amanieu I think it should be correct now. The overall size is 20 bytes which can be represented by [i8; 20].

@Amanieu
Copy link
Member

Amanieu commented Feb 6, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2022

📌 Commit 7a027d3 has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Feb 6, 2022

⌛ Testing commit 7a027d3 with merge 6449ebc...

@bors
Copy link
Contributor

bors commented Feb 6, 2022

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: Amanieu
Pushing 6449ebc to master...

@bors bors merged commit 6449ebc into rust-lang:master Feb 6, 2022
bors added a commit that referenced this pull request Feb 12, 2022
Build fixes for Linux/m68k

This PR contains a few fixes on top of #2414 that were not previously discovered.

I have verified that with these fixes applied, the libc module builds fine on Linux/m68k.
bors added a commit that referenced this pull request Feb 12, 2022
Build fixes for Linux/m68k

This PR contains a few fixes on top of #2414 that were not previously discovered.

I have verified that with these fixes applied, the libc module builds fine on Linux/m68k.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants