Skip to content

Commit

Permalink
arm: use the lld linker
Browse files Browse the repository at this point in the history
LLD version 8 has added support for armv6m:
    https://reviews.llvm.org/D55555
This means we can use LLD instead of arm-none-eabi-ld, eliminating our
dependency on GNU binutils.

There are small differences in code size, but never more than a few
bytes.
  • Loading branch information
aykevl authored and deadprogram committed Apr 4, 2019
1 parent 31d57fd commit 2523772
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ commands:
libclang<<parameters.llvm>>-dev \
lld<<parameters.llvm>> \
gcc-arm-linux-gnueabihf \
binutils-arm-none-eabi \
libc6-dev-armel-cross \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ matrix:
addons:
homebrew:
update: true
taps: ArmMbed/homebrew-formulae
packages:
- llvm@8
- qemu
- arm-none-eabi-gcc

install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.

RUN cd /go/src/github.com/tinygo-org/tinygo/ && \
apt-get update && \
apt-get install -y apt-utils python3 make binutils-arm-none-eabi clang-8 && \
apt-get install -y apt-utils python3 make clang-8 && \
make gen-device-nrf && make gen-device-stm32 && \
apt-get remove -y python3 make && \
apt-get autoremove -y && \
Expand All @@ -74,7 +74,7 @@ COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.

RUN cd /go/src/github.com/tinygo-org/tinygo/ && \
apt-get update && \
apt-get install -y apt-utils python3 make binutils-arm-none-eabi clang-8 binutils-avr gcc-avr avr-libc && \
apt-get install -y apt-utils python3 make clang-8 binutils-avr gcc-avr avr-libc && \
make gen-device && \
apt-get remove -y python3 make && \
apt-get autoremove -y && \
Expand Down
2 changes: 1 addition & 1 deletion commands_macos.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package main
var commands = map[string]string{
"ar": "llvm-ar",
"clang": "clang-8",
"ld.lld": "ld.lld-8",
"ld.lld": "ld.lld",
"wasm-ld": "wasm-ld",
}
1 change: 1 addition & 0 deletions targets/arm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ SECTIONS

/DISCARD/ :
{
*(.ARM.exidx) /* causes 'no memory region specified' error in lld */
*(.ARM.exidx.*) /* causes spurious 'undefined reference' errors */
}
}
Expand Down
2 changes: 1 addition & 1 deletion targets/cortex-m.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"goarch": "arm",
"compiler": "clang-8",
"gc": "marksweep",
"linker": "arm-none-eabi-ld",
"linker": "ld.lld",
"rtlib": "compiler-rt",
"cflags": [
"-Oz",
Expand Down

0 comments on commit 2523772

Please sign in to comment.