nabla-c0d3 / nassl

Experimental OpenSSL wrapper for Python 3.8+ and SSLyze.
GNU Affero General Public License v3.0
39 stars 35 forks source link

Add support for Linux aarch64 #86

Open nabla-c0d3 opened 2 years ago

nabla-c0d3 commented 2 years ago

Trying to run a build with no changes to the code base returns an error: https://github.com/nabla-c0d3/nassl/runs/4338996771?check_suite_focus=true

  /opt/rh/devtoolset-9/root/usr/libexec/gcc/aarch64-redhat-linux/9/ld: /project/deps/openssl-OpenSSL_1_0_2e/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
  /project/deps/openssl-OpenSSL_1_0_2e/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order':
  (.text+0x10c8): dangerous relocation: unsupported relocation
  collect2: error: ld returned 1 exit status
  error: command 'gcc' failed with exit status 1
stitch commented 2 years ago

Hi, just wanted to say this is very much welcomed by the internet.nl team :) This is the last dependency that was missing arm64/aarch64 support. Thank you very much for maintaining!

steev commented 2 years ago

@nabla-c0d3 the reason is that the legacy openssl needs https://github.com/openssl/openssl/commit/a135948ddaa4deff369cfaeb768efd603649f4de or something along these lines - I've been trying to apply the patch here in my build tree, but I'm failing horribly at it.

GavinDarkglider commented 2 years ago

@nabla-c0d3 @steev Apply these patches to openssl legacy and openssl modern, and it builds on arm64

I am not a perl or arm64 asm expert, so you might want to run some serious tests before working these into your build tree, I did test build though on my nintendo-switch in gentoo and it does build.

nassl-01-fix-arm64-openssl_modern_builds.txt nassl-02-fix-arm64-openssl_legacy-builds.txt

The legacy patch is a back port, where the modern version is just a copy/paste diff of the needed files from openssl at commit https://github.com/openssl/openssl/commit/a135948ddaa4deff369cfaeb768efd603649f4de