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

Improve newlib constants #1335

Merged
merged 8 commits into from May 16, 2019
Merged

Improve newlib constants #1335

merged 8 commits into from May 16, 2019

Conversation

leo60228
Copy link
Contributor

@leo60228 leo60228 commented May 9, 2019

This is necessary to set socket options on the Nintendo Switch, which uses a socket implementation directly ported from FreeBSD. Reopened from #1334 because I accidentally closed that.

This is necessary to set socket options on the Nintendo Switch, which uses a socket implementation directly ported from FreeBSD.
@rust-highfive
Copy link

r? @gnzlbg

(rust_highfive has picked a reviewer for you, use r? to override)

@leo60228
Copy link
Contributor Author

leo60228 commented May 9, 2019

From the person that originally added the constants (not that it matters much, but...):

image

@leo60228 leo60228 changed the title Use FreeBSD SO_ constants on newlib Improve newlib constants May 9, 2019
@mati865
Copy link
Contributor

mati865 commented May 9, 2019

Some of the bots fail because of #1333

@gnzlbg
Copy link
Contributor

gnzlbg commented May 10, 2019

@leo60228 do you have a link to these definitions in newlib upstream ?

@gnzlbg
Copy link
Contributor

gnzlbg commented May 10, 2019

Also, the Nintendo Switch libc bindings live here: https://github.com/rust-lang/libc/blob/master/src/switch.rs

But maybe those aren't necessary anymore and can be deleted ?


It would be great if you could add at least a test that builds libc for your target. Check https://github.com/rust-lang/libc/blob/master/ci/build.sh for how we do that for some targets, or stdsimd/.travis.yml for how we do that for, e.g., the game boy advance targets.

@leo60228
Copy link
Contributor Author

@gnzlbg There's two Switch Rust toolchains; one based on newlib, and one based on pure Rust. switch.rs is for the pure Rust one.

@leo60228
Copy link
Contributor Author

Newlib upstream doesn't support sockets beyond copying the headers from Linux when built for Linux. The Switch's sockets are ported directly from FreeBSD, so I copied them over. I could possibly add a cfg flag so that the constants are only used on the Switch?

@leo60228
Copy link
Contributor Author

leo60228 commented May 10, 2019

That .travis.yml says that it's using the dkp linker solely due to the outdated GBA CPU having problems with lld. I've been using dkp's linker for the Switch. Should I try to get it working with lld, or just use dkp's linker like the GBA does? DKP will still be necessary due to providing newlib for the Switch.

@leo60228
Copy link
Contributor Author

All of the newlib Switch-specific stuff is in the libnx repo: https://github.com/switchbrew/libnx/tree/master/nx/external/bsd/include/sys

I don't know why it's done this way when newlib includes headers itself for Cygwin and Linux, but...

@leo60228
Copy link
Contributor Author

@gnzlbg The CI seems to work.

@gnzlbg
Copy link
Contributor

gnzlbg commented May 13, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented May 13, 2019

📌 Commit a92266b has been approved by gnzlbg

bors added a commit that referenced this pull request May 13, 2019
Improve newlib constants

This is necessary to set socket options on the Nintendo Switch, which uses a socket implementation directly ported from FreeBSD. Reopened from #1334 because I accidentally closed that.
@bors
Copy link
Contributor

bors commented May 13, 2019

⌛ Testing commit a92266b with merge 23046f8...

@bors
Copy link
Contributor

bors commented May 13, 2019

💔 Test failed - checks-travis

@leo60228
Copy link
Contributor Author

#1333 still hasn't been fixed yet. I'm on mobile, but I'm pretty sure that's what's causing Travis to fail.

@gnzlbg
Copy link
Contributor

gnzlbg commented May 16, 2019

@bors: retry

bors added a commit that referenced this pull request May 16, 2019
Improve newlib constants

This is necessary to set socket options on the Nintendo Switch, which uses a socket implementation directly ported from FreeBSD. Reopened from #1334 because I accidentally closed that.
@bors
Copy link
Contributor

bors commented May 16, 2019

⌛ Testing commit a92266b with merge 8b14a7e...

@bors
Copy link
Contributor

bors commented May 16, 2019

☀️ Test successful - checks-cirrus, checks-travis, status-appveyor
Approved by: gnzlbg
Pushing 8b14a7e to master...

@bors bors merged commit a92266b into rust-lang:master May 16, 2019
@bors bors mentioned this pull request May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants