Skip to content

Commit 2523772

Browse files
aykevldeadprogram
authored andcommitted
arm: use the lld linker
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.
1 parent 31d57fd commit 2523772

File tree

6 files changed

+5
-7
lines changed

6 files changed

+5
-7
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ commands:
2424
libclang<<parameters.llvm>>-dev \
2525
lld<<parameters.llvm>> \
2626
gcc-arm-linux-gnueabihf \
27-
binutils-arm-none-eabi \
2827
libc6-dev-armel-cross \
2928
gcc-aarch64-linux-gnu \
3029
libc6-dev-arm64-cross \

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ matrix:
1111
addons:
1212
homebrew:
1313
update: true
14-
taps: ArmMbed/homebrew-formulae
1514
packages:
1615
- llvm@8
1716
- qemu
18-
- arm-none-eabi-gcc
1917

2018
install:
2119
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.
5959

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

7575
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \
7676
apt-get update && \
77-
apt-get install -y apt-utils python3 make binutils-arm-none-eabi clang-8 binutils-avr gcc-avr avr-libc && \
77+
apt-get install -y apt-utils python3 make clang-8 binutils-avr gcc-avr avr-libc && \
7878
make gen-device && \
7979
apt-get remove -y python3 make && \
8080
apt-get autoremove -y && \

commands_macos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ package main
66
var commands = map[string]string{
77
"ar": "llvm-ar",
88
"clang": "clang-8",
9-
"ld.lld": "ld.lld-8",
9+
"ld.lld": "ld.lld",
1010
"wasm-ld": "wasm-ld",
1111
}

targets/arm.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ SECTIONS
5454

5555
/DISCARD/ :
5656
{
57+
*(.ARM.exidx) /* causes 'no memory region specified' error in lld */
5758
*(.ARM.exidx.*) /* causes spurious 'undefined reference' errors */
5859
}
5960
}

targets/cortex-m.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"goarch": "arm",
55
"compiler": "clang-8",
66
"gc": "marksweep",
7-
"linker": "arm-none-eabi-ld",
7+
"linker": "ld.lld",
88
"rtlib": "compiler-rt",
99
"cflags": [
1010
"-Oz",

0 commit comments

Comments
 (0)