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

LLD is now shipped with Rust! #395

Merged
merged 3 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ install:
build: false

before_test:
- mkdir bin
- mklink "bin\ld.exe" "C:\Program Files\LLVM\bin\lld.exe"
- set PATH=%CD%\bin;C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- rustup component add rust-src
- set RUST_BACKTRACE=1
- if not exist %USERPROFILE%\.cargo\bin\cargo-install-update.exe cargo install cargo-update
Expand Down
17 changes: 0 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,12 @@ os:
- linux
- osx

addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- lld-5.0

cache:
directories:
- $HOME/.cargo
- $HOME/.xargo
- $TRAVIS_BUILD_DIR/target

before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
set -e
LLVM_URL="https://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz"
travis_retry wget -O llvm.tar.xz -nv ${LLVM_URL}
tar -xJ -f llvm.tar.xz
export PATH="`pwd`/clang+llvm-5.0.1-final-x86_64-apple-darwin/bin:$PATH"
fi

before_script:
- rustup component add rust-src
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
Expand Down
18 changes: 0 additions & 18 deletions blog/content/second-edition/extra/installing-lld/index.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ We add the following build-related entries:


```json
"linker-flavor": "ld",
"linker": "ld.lld",
"linker-flavor": "ld.lld",
```

Instead of using the platform's default linker (which might not support Linux targets), we use the cross platform [LLD] linker for linking our kernel.
Instead of using the platform's default linker (which might not support Linux targets), we use the cross platform [LLD] linker for linking our kernel. LLD is shipped with Rust since the `2018-03-05` nightly.

[LLD]: https://lld.llvm.org/

Expand Down Expand Up @@ -260,10 +259,6 @@ Let's try it:
Finished dev [unoptimized + debuginfo] target(s) in 0.29 secs
```

(If you're getting a linking error because LLD could not be found, see our “[Installing LLD]” guide.)

[Installing LLD]: ./second-edition/extra/installing-lld/index.md

It worked! We see that `xargo` cross-compiled the `core` library for our new custom target and then continued to compile our `blog_os` crate.

Now we are able to build our kernel for a bare metal target. However, our `_start` entry point, which will be called by the boot loader, is still empty. So let's output something to screen from it.
Expand Down
3 changes: 1 addition & 2 deletions x86_64-blog_os.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"target-pointer-width": "64",
"target-c-int-width": "32",
"os": "none",
"linker-flavor": "ld",
"linker": "ld.lld",
"linker-flavor": "ld.lld",
"executables": true,
"features": "-mmx,-sse,+soft-float",
"disable-redzone": true,
Expand Down