-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
41: use LLD as the default linker r=therealprof a=japaric closes #39 I added instructions on how to switch to a different linker to .cargo/config but I don't think that's too visible. Beginners are unlikely to look into that file if they run into problems with the default linker. Any suggestions to improve the visibility of that information? Also, don't merge this until the default linker changes for the Cortex-M targets on nightly as this relies on that change. r? @rust-embedded/cortex-m Co-authored-by: Jorge Aparicio <jorge@japaric.io>
- Loading branch information
Showing
9 changed files
with
90 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,56 @@ | ||
[target.thumbv6m-none-eabi] | ||
runner = 'arm-none-eabi-gdb' | ||
rustflags = [ | ||
"-C", "link-arg=-Wl,-Tlink.x", | ||
"-C", "link-arg=-nostartfiles", | ||
# LLD (shipped with the Rust toolchain) is used as the default linker | ||
"-C", "link-arg=-Tlink.x", | ||
|
||
# if you run into problems with LLD switch to the GNU linker by commenting out | ||
# this line | ||
# "-C", "linker=arm-none-eabi-ld", | ||
|
||
# if you need to link to pre-compiled C libraries provided by a C toolchain | ||
# use GCC as the linker by commenting out both lines above and then | ||
# uncommenting the three lines below | ||
# "-C", "linker=arm-none-eabi-gcc", | ||
# "-C", "link-arg=-Wl,-Tlink.x", | ||
# "-C", "link-arg=-nostartfiles", | ||
] | ||
|
||
[target.thumbv7m-none-eabi] | ||
runner = 'arm-none-eabi-gdb' | ||
rustflags = [ | ||
"-C", "link-arg=-Wl,-Tlink.x", | ||
"-C", "link-arg=-nostartfiles", | ||
# the comments under `[target.thumbv6m-none-eabi]` also apply here | ||
"-C", "link-arg=-Tlink.x", | ||
|
||
# "-C", "linker=arm-none-eabi-ld", | ||
|
||
# "-C", "linker=arm-none-eabi-gcc", | ||
# "-C", "link-arg=-Wl,-Tlink.x", | ||
# "-C", "link-arg=-nostartfiles", | ||
] | ||
|
||
[target.thumbv7em-none-eabi] | ||
runner = 'arm-none-eabi-gdb' | ||
rustflags = [ | ||
"-C", "link-arg=-Wl,-Tlink.x", | ||
"-C", "link-arg=-nostartfiles", | ||
# the comments under `[target.thumbv6m-none-eabi]` also apply here | ||
"-C", "link-arg=-Tlink.x", | ||
|
||
# "-C", "linker=arm-none-eabi-ld", | ||
|
||
# "-C", "linker=arm-none-eabi-gcc", | ||
# "-C", "link-arg=-Wl,-Tlink.x", | ||
# "-C", "link-arg=-nostartfiles", | ||
] | ||
|
||
[target.thumbv7em-none-eabihf] | ||
runner = 'arm-none-eabi-gdb' | ||
rustflags = [ | ||
"-C", "link-arg=-Wl,-Tlink.x", | ||
"-C", "link-arg=-nostartfiles", | ||
# the comments under `[target.thumbv6m-none-eabi]` also apply here | ||
"-C", "link-arg=-Tlink.x", | ||
|
||
# "-C", "linker=arm-none-eabi-ld", | ||
|
||
# "-C", "linker=arm-none-eabi-gcc", | ||
# "-C", "link-arg=-Wl,-Tlink.x", | ||
# "-C", "link-arg=-nostartfiles", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set -euxo pipefail | ||
|
||
main() { | ||
cargo doc | ||
|
||
mkdir ghp-import | ||
|
||
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | | ||
tar --strip-components 1 -C ghp-import -xz | ||
|
||
./ghp-import/ghp_import.py target/doc | ||
|
||
set +x | ||
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK | ||
} | ||
|
||
# only publish on successful merges to master | ||
if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TARGET = x86_64-unknown-linux-gnu ]; then | ||
main | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
set -euxo pipefail | ||
|
||
main() { | ||
rustup target add $TARGET | ||
if [ $TARGET != x86_64-unknown-linux-gnu ]; then | ||
rustup target add $TARGET | ||
fi | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters