Skip to content
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
3 changes: 3 additions & 0 deletions rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -q \
# Add rust binaries to PATH
ENV PATH="$PATH:/root/.cargo/bin"

# Set default build target to armv7
ENV CARGO_BUILD_TARGET="armv7-unknown-linux-gnueabihf"

# Target reMarkable architecture by default
COPY config /root/.cargo/config
10 changes: 7 additions & 3 deletions rust/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[build]
target = "armv7-unknown-linux-gnueabihf"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
rustflags = [
Expand All @@ -10,3 +7,10 @@ rustflags = [
"-C", "link-arg=-mfloat-abi=hard",
"-C", "link-arg=-mcpu=cortex-a9",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-remarkable-linux-gnu-gcc"
rustflags = [
"-C", "link-arg=-march=armv8-a+crc+crypto",
"-C", "link-arg=-mtune=cortex-a53",
]
8 changes: 5 additions & 3 deletions toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,23 @@ export CHOST="$CHOST"
export CROSS_COMPILE="$CHOST-"
export PKG_CONFIG_LIBDIR="/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot/usr/lib/pkgconfig:/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot/lib/pkgconfig:/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot/opt/lib/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot"
SYSROOT="/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot"
NGCONFIG="$NGCONFIG"
export SYSROOT="/opt/x-tools/$NGCONFIG/$NGCONFIG/sysroot"
export NGCONFIG="$NGCONFIG"
export TARGET_PREFIX="$CHOST"
export CARGO_BUILD_TARGET="armv7-unknown-linux-gnueabihf"
EOF

RUN touch /opt/x-tools/switch-aarch64.sh && chmod +x /opt/x-tools/switch-aarch64.sh && cat <<EOF > /opt/x-tools/switch-aarch64.sh
export ARCH=aarch64
export CHOST="$CHOST_AARCH64"
export CROSS_COMPILE="$CHOST_AARCH64-"
export PATH="$PATH:/opt/x-tools/$NGCONFIG_AARCH64/bin"
export PATH="\$PATH:/opt/x-tools/$NGCONFIG_AARCH64/bin"
export PKG_CONFIG_LIBDIR="/opt/x-tools/$NGCONFIG_AARCH64/$NGCONFIG_AARCH64/sysroot/usr/lib/pkgconfig:/opt/x-tools/$NGCONFIG_AARCH64/$NGCONFIG_AARCH64/sysroot/lib/pkgconfig:/opt/x-tools/$NGCONFIG_AARCH64/$NGCONFIG_AARCH64/sysroot/opt/lib/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="/opt/x-tools/$NGCONFIG_AARCH64/$NGCONFIG_AARCH64/sysroot"
export SYSROOT="/opt/x-tools/$NGCONFIG_AARCH64/$NGCONFIG_AARCH64/sysroot"
export NGCONFIG="$NGCONFIG_AARCH64"
export TARGET_PREFIX="$CHOST_AARCH64"
export CARGO_BUILD_TARGET="aarch64-unknown-linux-gnu"
EOF

# Configure Opkg
Expand Down