Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Update linker script to fix arm-none-eabi-gcc linking. Closes #259 #260

Closed
wants to merge 3 commits into from

Conversation

adamgreig
Copy link
Member

No description provided.

@adamgreig adamgreig requested a review from a team as a code owner April 3, 2020 11:37
@rust-highfive
Copy link

r? @korken89

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

Copy link
Contributor

@korken89 korken89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@korken89
Copy link
Contributor

korken89 commented Apr 3, 2020

bors r+

bors bot added a commit that referenced this pull request Apr 3, 2020
260: Update linker script to fix arm-none-eabi-gcc linking. Closes #259 r=korken89 a=adamgreig



Co-authored-by: Adam Greig <[email protected]>
@adamgreig
Copy link
Member Author

bors r-

@bors
Copy link
Contributor

bors bot commented Apr 3, 2020

Canceled

@adamgreig
Copy link
Member Author

I've been investigating a bit further and actually the -nostartfiles to gcc also fixes this problem, without changing the linker script. However, it still looks to me like we don't need to put __etext where we do; it makes no difference to the resulting binaries with any of the linkers, so possibly we should remove it anyway.

I definitely think we should still add gcc to the CI scripts.

@therealprof any recollection what the purpose of that line was in #207?

@adamgreig
Copy link
Member Author

@therealprof mentioned that the bug was hit in rust-lld when _stext was offset: rust-lang/rust#65391

I'll do some more tests in that configuration. Also, we should probably add a MSRV run to the CI, perhaps 1.32.0.

@adamgreig
Copy link
Member Author

Testing with a memory.x-overridden stext shows we do still need the full modification to the linker script. I'm going to close this PR and open a new one just for adding arm-none-eabi-gcc to the CI. Sorry for the noise!

@adamgreig adamgreig closed this Apr 4, 2020
@adamgreig adamgreig deleted the fix-linker branch April 4, 2020 17:43
bors bot added a commit that referenced this pull request Apr 4, 2020
262: Add testing linker=arm-none-eabi-gcc and MSRV to CI r=therealprof a=adamgreig

Replacing #260.

This PR extends our current tests with `linker=rust-lld` and `linker=arm-none-eabi-ld` to include `linker=arm-none-eabi-gcc`, since those options are all included in our example [`.cargo/config`](https://github.com/rust-embedded/cortex-m-rt/blob/master/.cargo/config). It looks like another linker only adds a handful of seconds to CI, since most time is spent building dependencies once.

It also adds a test with Rust 1.32.0 to the CI as a candidate MSRV. Building with 1.31.0 fails because of the dev-dependency on cortex-m-semihosting 0.3.5:

```
error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075)
   --> /home/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.5/src/macros.rs:111:25
    |
111 |     ($($val:expr),+ $(,)?) => {
    |                         ^

error: expected `*` or `+`
```
That's just a test error which end users wouldn't experience, so we could consider making 1.31.0 the MSRV and working around the c-m-semihosting issue. I don't know if there are other 1.31.0 issues.

Finally the PR removes the travis check preventing builds on pushes to master. In principle we know that builds to master succeed because bors tests them before pushing, so adding the extra check mostly means we get a well-defined build status from Travis for flags etc. The build times for cortex-m-rt (around 3min overall) are a bit longer than r0 (where we did the same thing), so we could just run a minimal test here instead. I don't think it's a significant overhead given how infrequently we push to master, though.

Co-authored-by: Adam Greig <[email protected]>
bors bot added a commit that referenced this pull request Apr 7, 2020
262: Add testing linker=arm-none-eabi-gcc and MSRV to CI r=therealprof a=adamgreig

Replacing #260.

This PR extends our current tests with `linker=rust-lld` and `linker=arm-none-eabi-ld` to include `linker=arm-none-eabi-gcc`, since those options are all included in our example [`.cargo/config`](https://github.com/rust-embedded/cortex-m-rt/blob/master/.cargo/config). It looks like another linker only adds a handful of seconds to CI, since most time is spent building dependencies once.

It also adds a test with Rust 1.32.0 to the CI as a candidate MSRV. Building with 1.31.0 fails because of the dev-dependency on cortex-m-semihosting 0.3.5:

```
error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075)
   --> /home/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.5/src/macros.rs:111:25
    |
111 |     ($($val:expr),+ $(,)?) => {
    |                         ^

error: expected `*` or `+`
```
That's just a test error which end users wouldn't experience, so we could consider making 1.31.0 the MSRV and working around the c-m-semihosting issue. I don't know if there are other 1.31.0 issues.

Finally the PR removes the travis check preventing builds on pushes to master. In principle we know that builds to master succeed because bors tests them before pushing, so adding the extra check mostly means we get a well-defined build status from Travis for flags etc. The build times for cortex-m-rt (around 3min overall) are a bit longer than r0 (where we did the same thing), so we could just run a minimal test here instead. I don't think it's a significant overhead given how infrequently we push to master, though.

Co-authored-by: Adam Greig <[email protected]>
bors bot added a commit that referenced this pull request Apr 7, 2020
262: Add testing linker=arm-none-eabi-gcc and MSRV to CI r=therealprof a=adamgreig

Replacing #260.

This PR extends our current tests with `linker=rust-lld` and `linker=arm-none-eabi-ld` to include `linker=arm-none-eabi-gcc`, since those options are all included in our example [`.cargo/config`](https://github.com/rust-embedded/cortex-m-rt/blob/master/.cargo/config). It looks like another linker only adds a handful of seconds to CI, since most time is spent building dependencies once.

It also adds a test with Rust 1.32.0 to the CI as a candidate MSRV. Building with 1.31.0 fails because of the dev-dependency on cortex-m-semihosting 0.3.5:

```
error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075)
   --> /home/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.5/src/macros.rs:111:25
    |
111 |     ($($val:expr),+ $(,)?) => {
    |                         ^

error: expected `*` or `+`
```
That's just a test error which end users wouldn't experience, so we could consider making 1.31.0 the MSRV and working around the c-m-semihosting issue. I don't know if there are other 1.31.0 issues.

Finally the PR removes the travis check preventing builds on pushes to master. In principle we know that builds to master succeed because bors tests them before pushing, so adding the extra check mostly means we get a well-defined build status from Travis for flags etc. The build times for cortex-m-rt (around 3min overall) are a bit longer than r0 (where we did the same thing), so we could just run a minimal test here instead. I don't think it's a significant overhead given how infrequently we push to master, though.

Co-authored-by: Adam Greig <[email protected]>
bors bot added a commit that referenced this pull request Apr 7, 2020
262: Add testing linker=arm-none-eabi-gcc and MSRV to CI r=therealprof a=adamgreig

Replacing #260.

This PR extends our current tests with `linker=rust-lld` and `linker=arm-none-eabi-ld` to include `linker=arm-none-eabi-gcc`, since those options are all included in our example [`.cargo/config`](https://github.com/rust-embedded/cortex-m-rt/blob/master/.cargo/config). It looks like another linker only adds a handful of seconds to CI, since most time is spent building dependencies once.

It also adds a test with Rust 1.32.0 to the CI as a candidate MSRV. Building with 1.31.0 fails because of the dev-dependency on cortex-m-semihosting 0.3.5:

```
error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075)
   --> /home/adam/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.5/src/macros.rs:111:25
    |
111 |     ($($val:expr),+ $(,)?) => {
    |                         ^

error: expected `*` or `+`
```
That's just a test error which end users wouldn't experience, so we could consider making 1.31.0 the MSRV and working around the c-m-semihosting issue. I don't know if there are other 1.31.0 issues.

Finally the PR removes the travis check preventing builds on pushes to master. In principle we know that builds to master succeed because bors tests them before pushing, so adding the extra check mostly means we get a well-defined build status from Travis for flags etc. The build times for cortex-m-rt (around 3min overall) are a bit longer than r0 (where we did the same thing), so we could just run a minimal test here instead. I don't think it's a significant overhead given how infrequently we push to master, though.

Co-authored-by: Adam Greig <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants