Skip to content

Commit 5ade525

Browse files
author
Claudio Raimondi
committed
Fix strip, Add TODOs [skip ci]
1 parent cc7da09 commit 5ade525

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,23 @@ ARG target_arch=x86_64-linux-gnu
9999
ARG target_arch_gcc=x86-64-linux-gnu
100100
ARG target_arch_dpkg=amd64
101101
ARG target_arch_rust=x86_64-unknown-linux-gnu
102-
ARG target_arch_cflags=x86-64
102+
ARG COPTFLAGS="-march=x86-64"
103103

104104
FROM base-builder AS base-builder-linux-arm64
105105

106106
ARG target_arch=aarch64-linux-gnu
107107
ARG target_arch_gcc=aarch64-linux-gnu
108108
ARG target_arch_dpkg=arm64
109109
ARG target_arch_rust=aarch64-unknown-linux-gnu
110-
ARG target_arch_cflags=armv8-a
110+
ARG COPTFLAGS="-march=armv8-a"
111111

112112
FROM base-builder AS base-builder-linux-arm
113113

114114
ARG target_arch=arm-linux-gnueabihf
115115
ARG target_arch_gcc=arm-linux-gnueabihf
116116
ARG target_arch_dpkg=armhf
117117
ARG target_arch_rust=armv7-unknown-linux-gnueabihf
118-
ARG target_arch_cflags=armv7-a
118+
ARG COPTFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
119119

120120
FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
121121

@@ -140,7 +140,7 @@ ARG CXX=${target_arch}-g++
140140
ARG LD=${target_arch}-ld
141141
ARG STRIP=${target_arch}-strip
142142
ARG TARGET=${target_arch_rust}
143-
ARG COPTFLAGS="-O2 -march=${target_arch_cflags}"
143+
ARG COPTFLAGS="-O2 ${COPTFLAGS}"
144144

145145
WORKDIR /opt
146146

@@ -157,12 +157,17 @@ linker = "${target_arch}-gcc"
157157
rustflags = ["-C", "target-cpu=generic"]
158158
EOF
159159

160+
#TODO: Fix unaligned access on armv7
160161
RUN ./configure --prefix=/tmp/lightning_install --enable-static --disable-compat --disable-valgrind
161162
COPY .git/ .git/
162163
RUN git submodule update --init --recursive --jobs $(nproc) --depth 1
163164
RUN uv run make -j$(nproc) install
164165

165-
RUN ${STRIP} --strip-unneeded #TODO: fix
166+
RUN for f in /tmp/lightning_install/bin/*; do \
167+
if file "$f" | grep -q 'ELF'; then \
168+
${STRIP} --strip-unneeded "$f"; \
169+
fi; \
170+
done
166171

167172
FROM base-target AS final
168173

@@ -177,7 +182,7 @@ RUN apt-get update && \
177182

178183
COPY --from=downloader /opt/bitcoin/bin/bitcoin-cli /usr/bin/
179184
COPY --from=downloader /opt/litecoin/bin/litecoin-cli /usr/bin/
180-
COPY --from=builder /tmp/lightning_install /usr/local/
185+
COPY --from=builder /tmp/lightning_install/ /usr/local/
181186

182187
COPY tools/docker-entrypoint.sh /entrypoint.sh
183188

0 commit comments

Comments
 (0)