TunSafe Forum

Welcome to the TunSafe Community Forum. This is open for discussions related to TunSafe and the WireGuard protocol.

You are not logged in.

#1 2019-01-09 23:22:18

rhester72
Member
Registered: 2018-09-07
Posts: 14

build script for arm64

If there's any interest at all, this is the build_linux_arm64.sh script I cobbled together for compile on Arch Linux AARCH/ARM64:

#!/bin/sh

set -e
perl crypto/chacha20/chacha20-arm64.pl > crypto/chacha20/chacha20-arm64.s
perl crypto/poly1305/poly1305-arm64.pl > crypto/poly1305/poly1305-arm64.s

cpp crypto/chacha20/chacha20-arm64.s > crypto/chacha20/chacha20-arm64.preprocessed.s
cpp crypto/poly1305/poly1305-arm64.s > crypto/poly1305/poly1305-arm64.preprocessed.s

# a bug in chacha20-arm64.pl adds an inappropriate line at the end that reads ".size chacha20_512_neon,.-chacha20_512_neon"
sed -i '$ d' crypto/chacha20/chacha20-arm64.preprocessed.s

g++ -I . -g -O2 -DNDEBUG -DWITH_NETWORK_BSD=1 -fno-omit-frame-pointer -std=c++11 -pthread -lrt -o tunsafe \
tunsafe_amalgam.cpp \
crypto/chacha20/chacha20-arm64.preprocessed.s \
crypto/poly1305/poly1305-arm64.preprocessed.s \

Please note that it does _not_ take advantage of any ARMv7 or NEON extensions.

Rodney

Offline

#2 2019-10-04 16:51:03

logcabin
Member
Registered: 2018-04-30
Posts: 27

Re: build script for arm64

Here's one for Raspberry Pi 3 and later running Raspbian. The current Raspbian is 32 bits but there's a 64 bit kernel available for testing:

#!/bin/sh
set -e

g++ -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -mtune=cortex-a53 -I . -g -O3 -DNDEBUG -DWITH_NETWORK_BSD=1 -fno-omit-frame-pointer -std=c++11 -pthread -lrt -o tunsafe \
tunsafe_amalgam.cpp \
crypto/chacha20/chacha20-arm-linux.S \
crypto/poly1305/poly1305-arm-linux.S \

Last edited by logcabin (2019-10-04 16:53:27)

Offline

Board footer

Powered by FluxBB