Skip to content

Fix incorrect constant for O_LARGEFILE on mips64-linux-musl#2875

Merged
bors merged 1 commit into
rust-lang:masterfrom
jam1garner:fix-mips-o-largefile
Aug 16, 2022
Merged

Fix incorrect constant for O_LARGEFILE on mips64-linux-musl#2875
bors merged 1 commit into
rust-lang:masterfrom
jam1garner:fix-mips-o-largefile

Conversation

@jam1garner

Copy link
Copy Markdown
Contributor

Changes O_LARGEFILE from 0 to 0x2000

Bash script used for ensuring constant is correct:

#!/bin/bash
echo "
#include <fcntl.h>
int largefile() {
    return O_LARGEFILE;
}
" | mips64-linux-musl-gcc -c -O2 musl_o_largefile.c -o temp.o
mips64-linux-musl-objdump -d temp.o | grep -A2 largefile

Output:

0000000000000000 <largefile>:
   0:	03e00008 	jr	ra
   4:	24022000 	li	v0,8192    ; 0x2000

Link to relevant portion of kernel source, shows that it should match mips32 musl (which currently has a value of 0x2000 as well).

I believe the reason #2738 had this value incorrect was because it's 0 for glibc on mips64 (to specify it's the default, I believe).

@rust-highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon.

Please see the contribution instructions for more information.

@JohnTitor

Copy link
Copy Markdown
Member

Thanks for the detailed explanation, I also confirmed the value on the musl source: https://github.com/bminor/musl/blob/cfdfd5ea3ce14c6abf7fb22a531f3d99518b5a1b/arch/mips64/bits/fcntl.h#L16

cc @Grommish the value is going to be changed as the value is incorrect.

@bors r+

@bors

bors commented Aug 15, 2022

Copy link
Copy Markdown
Contributor

📌 Commit 6844aff has been approved by JohnTitor

It is now in the queue for this repository.

@bors

bors commented Aug 15, 2022

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6844aff with merge 13e4011...

bors added a commit that referenced this pull request Aug 15, 2022
Fix incorrect constant for O_LARGEFILE on mips64-linux-musl

Changes `O_LARGEFILE` from `0` to `0x2000`

Bash script used for ensuring constant is correct:

```sh
#!/bin/bash
echo "
#include <fcntl.h>
int largefile() {
    return O_LARGEFILE;
}
" | mips64-linux-musl-gcc -c -O2 musl_o_largefile.c -o temp.o
mips64-linux-musl-objdump -d temp.o | grep -A2 largefile
```

Output:

```asm
0000000000000000 <largefile>:
   0:	03e00008 	jr	ra
   4:	24022000 	li	v0,8192    ; 0x2000
```

Link to relevant portion of kernel source, shows that it should match mips32 musl (which currently has a value of 0x2000 as well).

I believe the reason #2738 had this value incorrect was because it's 0 for glibc on mips64 (to specify it's the default, I believe).
@bors

bors commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

💥 Test timed out

@JohnTitor

Copy link
Copy Markdown
Member

@bors retry

@bors

bors commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6844aff with merge 1d38aa2...

@bors

bors commented Aug 16, 2022

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: JohnTitor
Pushing 1d38aa2 to master...

@bors bors merged commit 1d38aa2 into rust-lang:master Aug 16, 2022
@jam1garner jam1garner deleted the fix-mips-o-largefile branch August 31, 2022 19:48
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.

5 participants