[ssh] Add an ARM64 build of SSH
Adds the definitions and flags needed to supporting building SSH for ARM64.
Bug: 123559
Change-Id: I6a94af38effa207c4e8bfaeeb46be963342c8097
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/3pp/+/822947
Reviewed-by: Ina Huh <ihuh@google.com>
Commit-Queue: Anirudh Mathukumilli <rudymathu@google.com>
Reviewed-by: Catherine Duncan <catduncan@google.com>
diff --git a/openssh-portable/3pp.pb b/openssh-portable/3pp.pb
index 614c7e3..cb3a3c1 100644
--- a/openssh-portable/3pp.pb
+++ b/openssh-portable/3pp.pb
@@ -18,4 +18,27 @@
verify {
test: "verify.sh"
}
-}
\ No newline at end of file
+}
+
+create {
+ platform_re: "linux-arm64"
+ source {
+ git {
+ repo: "https://fuchsia.googlesource.com/third_party/openssh-portable"
+ tag_pattern: "V_%s_P1"
+ version_join: "_"
+ version_restriction {
+ op: LE
+ val: "9.1"
+ }
+ }
+ }
+ build {
+ external_dep: "infra/3pp/static_libs/openssl/linux-arm64@2@1.1.1j.chromium.2"
+ external_dep: "infra/3pp/static_libs/zlib/linux-arm64@2@1.2.12.chromium.1"
+ }
+
+ verify {
+ test: "verify.sh"
+ }
+}
diff --git a/openssh-portable/install.sh b/openssh-portable/install.sh
index f24107f..0f8090e 100644
--- a/openssh-portable/install.sh
+++ b/openssh-portable/install.sh
@@ -8,10 +8,20 @@
PREFIX="$1"
DEPS="$2"
+CFLAGS="-fPIC"
LDFLAGS="-L$DEPS/lib/ $LDFLAGS -pthread -lpthread"
autoreconf
-./configure --prefix="$PREFIX" --with-ssl-dir=$DEPS
+if [ "$_3PP_PLATFORM" == linux-arm64 ] ; then
+ arch=arm
+else
+ arch=x86_64
+fi
-make && make install
\ No newline at end of file
+# This install is only supported on Linux -- enforced by platform_re in 3pp.pb
+os=linux
+
+./configure --host=$arch-$os --prefix="$PREFIX" --with-ssl-dir=$DEPS --with-zlib=$DEPS --disable-strip
+
+make && make install-nokeys