Skip to content

Commit da6de7b

Browse files
committed
fix: linux x86_64 openssl build for docker arm64 image
1 parent f546979 commit da6de7b

File tree

9 files changed

+59
-49
lines changed

9 files changed

+59
-49
lines changed

Makefile

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,61 +57,64 @@ test:
5757
bash -c 'set -eu; make test-app; make test-zlib; make test-openssl'
5858
.PHONY: test
5959

60+
test-all: test-app test-zlib test-openssl
61+
.PHONY: test-all
62+
6063
test-app:
6164
@echo "Checking Debian version..."
6265
@cat /etc/debian_version
6366
@echo
6467
@echo "Testing cross-compiling application..."
6568
@rustc -vV
6669
@echo
67-
@cd tests/hello-world \
70+
@cd tests/app \
6871
\
6972
&& echo "Compiling application (linux-gnu x86_64)..." \
7073
&& cargo build -v --release --target x86_64-unknown-linux-gnu \
7174
&& if [ "$$(uname -m)" = "x86_64" ]; then \
72-
target/x86_64-unknown-linux-gnu/release/hello-world-test; \
75+
target/x86_64-unknown-linux-gnu/release/app-test; \
7376
fi \
74-
&& du -sh target/x86_64-unknown-linux-gnu/release/hello-world-test \
75-
&& file target/x86_64-unknown-linux-gnu/release/hello-world-test \
77+
&& du -sh target/x86_64-unknown-linux-gnu/release/app-test \
78+
&& file target/x86_64-unknown-linux-gnu/release/app-test \
7679
&& echo \
7780
\
7881
&& echo "Compiling application (linux-musl x86_64)..." \
7982
&& cargo build -v --release --target x86_64-unknown-linux-musl \
8083
&& if [ "$$(uname -m)" = "x86_64" ]; then \
81-
target/x86_64-unknown-linux-musl/release/hello-world-test; \
84+
target/x86_64-unknown-linux-musl/release/app-test; \
8285
fi \
83-
&& du -sh target/x86_64-unknown-linux-musl/release/hello-world-test \
84-
&& file target/x86_64-unknown-linux-musl/release/hello-world-test \
86+
&& du -sh target/x86_64-unknown-linux-musl/release/app-test \
87+
&& file target/x86_64-unknown-linux-musl/release/app-test \
8588
&& echo \
8689
\
8790
&& echo "Cross-compiling application (apple-darwin x86_64)..." \
8891
&& cargo build -v --release --target x86_64-apple-darwin \
89-
&& du -sh target/x86_64-apple-darwin/release/hello-world-test \
90-
&& file target/x86_64-apple-darwin/release/hello-world-test \
92+
&& du -sh target/x86_64-apple-darwin/release/app-test \
93+
&& file target/x86_64-apple-darwin/release/app-test \
9194
&& echo \
9295
\
9396
&& echo "Cross-compiling application (linux-gnu aarch64)..." \
9497
&& cargo build -v --release --target aarch64-unknown-linux-gnu \
9598
&& if [ "$$(uname -m)" = "aarch64" ]; then \
96-
target/aarch64-unknown-linux-gnu/release/hello-world-test; \
99+
target/aarch64-unknown-linux-gnu/release/app-test; \
97100
fi \
98-
&& du -sh target/aarch64-unknown-linux-gnu/release/hello-world-test \
99-
&& file target/aarch64-unknown-linux-gnu/release/hello-world-test \
101+
&& du -sh target/aarch64-unknown-linux-gnu/release/app-test \
102+
&& file target/aarch64-unknown-linux-gnu/release/app-test \
100103
&& echo \
101104
\
102105
&& echo "Cross-compiling application (linux-musl aarch64)..." \
103106
&& cargo build -v --release --target aarch64-unknown-linux-musl \
104107
&& if [ "$$(uname -m)" = "aarch64" ]; then \
105-
target/aarch64-unknown-linux-musl/release/hello-world-test; \
108+
target/aarch64-unknown-linux-musl/release/app-test; \
106109
fi \
107-
&& du -sh target/aarch64-unknown-linux-musl/release/hello-world-test \
108-
&& file target/aarch64-unknown-linux-musl/release/hello-world-test \
110+
&& du -sh target/aarch64-unknown-linux-musl/release/app-test \
111+
&& file target/aarch64-unknown-linux-musl/release/app-test \
109112
&& echo \
110113
\
111114
&& echo "Cross-compiling application (apple-darwin aarch64)..." \
112115
&& cargo build -v --release --target aarch64-apple-darwin \
113-
&& du -sh target/aarch64-apple-darwin/release/hello-world-test \
114-
&& file target/aarch64-apple-darwin/release/hello-world-test \
116+
&& du -sh target/aarch64-apple-darwin/release/app-test \
117+
&& file target/aarch64-apple-darwin/release/app-test \
115118
&& echo
116119
.ONESHELL: test-app
117120

@@ -189,56 +192,56 @@ test-openssl:
189192
&& echo "Compiling application (linux-gnu x86_64)..." \
190193
&& cargo build -v --release --target x86_64-unknown-linux-gnu \
191194
&& if [ "$$(uname -m)" = "x86_64" ]; then \
192-
target/x86_64-unknown-linux-gnu/release/openssl; \
195+
target/x86_64-unknown-linux-gnu/release/openssl-test; \
193196
fi \
194-
&& du -sh target/x86_64-unknown-linux-gnu/release/openssl \
195-
&& file target/x86_64-unknown-linux-gnu/release/openssl \
197+
&& du -sh target/x86_64-unknown-linux-gnu/release/openssl-test \
198+
&& file target/x86_64-unknown-linux-gnu/release/openssl-test \
196199
&& echo \
197200
\
198201
&& echo "Cross-compiling application (linux-gnu aarch64)..." \
199202
&& CC=aarch64-linux-gnu-gcc \
200203
cargo build -v --release --target aarch64-unknown-linux-gnu \
201204
&& if [ "$$(uname -m)" = "aarch64" ]; then \
202-
target/aarch64-unknown-linux-gnu/release/openssl; \
205+
target/aarch64-unknown-linux-gnu/release/openssl-test; \
203206
fi \
204-
&& du -sh target/aarch64-unknown-linux-gnu/release/openssl \
205-
&& file target/aarch64-unknown-linux-gnu/release/openssl \
207+
&& du -sh target/aarch64-unknown-linux-gnu/release/openssl-test \
208+
&& file target/aarch64-unknown-linux-gnu/release/openssl-test \
206209
&& echo \
207210
\
208211
&& echo "Compiling application (linux-musl x86_64)..." \
209212
&& OPENSSL_STATIC=1 \
210213
cargo build -v --release --target x86_64-unknown-linux-musl \
211214
&& if [ "$$(uname -m)" = "x86_64" ]; then \
212-
target/x86_64-unknown-linux-musl/release/openssl; \
215+
target/x86_64-unknown-linux-musl/release/openssl-test; \
213216
fi \
214-
&& du -sh target/x86_64-unknown-linux-musl/release/openssl \
215-
&& file target/x86_64-unknown-linux-musl/release/openssl \
217+
&& du -sh target/x86_64-unknown-linux-musl/release/openssl-test \
218+
&& file target/x86_64-unknown-linux-musl/release/openssl-test \
216219
&& echo \
217220
\
218221
&& echo "Cross-compiling application (apple-darwin x86_64)..." \
219222
&& OPENSSL_STATIC=1 \
220223
CC=o64-clang CXX=o64-clang++ \
221224
cargo build -v --release --target x86_64-apple-darwin \
222-
&& du -sh target/x86_64-apple-darwin/release/openssl \
223-
&& file target/x86_64-apple-darwin/release/openssl \
225+
&& du -sh target/x86_64-apple-darwin/release/openssl-test \
226+
&& file target/x86_64-apple-darwin/release/openssl-test \
224227
&& echo \
225228
\
226229
&& echo "Cross-compiling application (linux-musl aarch64)..." \
227230
&& OPENSSL_STATIC=1 \
228231
cargo build -v --release --target aarch64-unknown-linux-musl \
229232
&& if [ "$$(uname -m)" = "aarch64" ]; then \
230-
target/aarch64-unknown-linux-musl/release/openssl;
233+
target/aarch64-unknown-linux-musl/release/openssl-test;
231234
fi \
232-
&& du -sh target/aarch64-unknown-linux-musl/release/openssl \
233-
&& file target/aarch64-unknown-linux-musl/release/openssl \
235+
&& du -sh target/aarch64-unknown-linux-musl/release/openssl-test \
236+
&& file target/aarch64-unknown-linux-musl/release/openssl-test \
234237
&& echo \
235238
\
236239
&& echo "Cross-compiling application (apple-darwin aarch64)..." \
237240
&& OPENSSL_STATIC=1 \
238241
CC=oa64-clang CXX=oa64-clang++ \
239242
cargo build -v --release --target aarch64-apple-darwin \
240-
&& du -sh target/aarch64-apple-darwin/release/openssl \
241-
&& file target/aarch64-apple-darwin/release/openssl \
243+
&& du -sh target/aarch64-apple-darwin/release/openssl-test \
244+
&& file target/aarch64-apple-darwin/release/openssl-test \
242245
&& echo
243246

244247
.ONESHELL: test-openssl

docker/arm64/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ RUN set -eux \
207207
&& mkdir -p /usr/local/x86_64-linux-musl/include \
208208
&& ln -s "/usr/include/x86_64-linux-gnu/asm" /usr/local/x86_64-linux-musl/include/asm \
209209
&& env CC=x86_64-linux-musl-gcc \
210-
./Configure no-asm no-shared no-zlib no-tests no-fuzz-libfuzzer no-fuzz-afl \
210+
./Configure no-asm no-engine no-shared no-zlib no-tests no-fuzz-libfuzzer no-fuzz-afl \
211211
-fPIC --prefix=/usr/local/x86_64-linux-musl \
212212
-DOPENSSL_NO_SECURE_MEMORY "linux-x86_64" \
213213
&& env C_INCLUDE_PATH=/usr/local/x86_64-linux-musl/include/ make depend \

tests/hello-world/Cargo.lock renamed to tests/app/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/hello-world/Cargo.toml renamed to tests/app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hello-world-test"
2+
name = "app-test"
33
version = "0.0.0"
44
authors = ["Jose Quintana <https://github.com/joseluisq>"]
55
edition = "2021"
File renamed without changes.

tests/openssl/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/openssl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "openssl"
2+
name = "openssl-test"
33
version = "0.0.0"
44
authors = ["Jose Quintana <https://github.com/joseluisq>"]
5-
edition = "2018"
5+
edition = "2021"
66

77
[dependencies]
88
openssl = { version = "0.10.73" }

tests/zlib/Cargo.lock

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/zlib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Jose Quintana <https://github.com/joseluisq>"]
55
edition = "2021"
66

77
[dependencies]
8-
flate2 = { version = "1.1.2", features = [ "zlib-default" ] }
8+
flate2 = { version = "1.1.4", features = [ "zlib-default" ] }
99

1010
[profile.release]
1111
lto = true

0 commit comments

Comments
 (0)