我正在使用 freebsd AMD64 并尝试为在 ARM64 BSD-generic32 上运行的 nanopi R2S 交叉编译 openssl。
这是我迄今为止尝试过的:
自从我为裸机 aarch64 构建以来,我尝试运行不同的命令,如下所示:
pkg 安装 aarch64-none-elf-gcc
./Configure BSD-generic32 shared --prefix=/opt/openssl-custom --openssldir=/opt/openssl-custom -Wl,-rpath=/opt/openssl-custom/lib make CC=/usr/local/bin/aarch64-none-elf-gcc RANLIB=/usr/local/bin/aarch64-none-elf-gcc MAKEDEPPROG=/usr/local/bin/aarch64-none-elf-gcc PROCESSOR=ARM
该错误指出:
root@Client_Site1:~/Work File/openssl-1_1_k-custom-master/openssl-1_1_k-custom-master # make CC=/usr/l ocal/bin/aarch64-none-elf-gcc RANLIB=/usr/local/bin/aarch64-none-elf-gcc MAKEDEPPROG=/usr/local/bin/aa rch64-none-elf-gcc PROCESSOR=ARM
/usr/local/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/bn_conf.h.in > in clude/crypto/bn_conf.h
/usr/local/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/dso_conf.h.in > i nclude/crypto/dso_conf.h
/usr/local/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _all
/usr/local/bin/perl util/mkbuildinf.pl "/usr/local/bin/aarch64-none-elf-gcc -fPIC -pthread -Wa,--noexe cstack -Qunused-arguments -Wall -O3 -DOPENSSL_PIC -D_THREAD_SAFE -D_REENTRANT -DNDEBUG" "BSD-generic32 " > crypto/buildinf.h
/usr/local/bin/aarch64-none-elf-gcc -I. -Iinclude -Icrypto -fPIC -pthread -Wa,--noexecstack -Qunused- arguments -Wall -O3 -DOPENSSL_PIC -DOPENSSLDIR="\"/opt/openssl-custom\"" -DENGINESDIR="\"/opt/openssl- custom/lib/engines-1.1\"" -D_THREAD_SAFE -D_REENTRANT -DNDEBUG -MMD -MF crypto/cversion.d.tmp -MT cry pto/cversion.o -c -o crypto/cversion.o crypto/cversion.c
aarch64-none-elf-gcc: error: unrecognized command line option '-pthread'
aarch64-none-elf-gcc: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wun used-parameter'?
*** Error code 1
Stop.
make[1]: stopped in /root/Work File/openssl-1_1_k-custom-master/openssl-1_1_k-custom-master
*** Error code 1
我还尝试将配置链接到 sysroot,如下所示:
./配置BSD-generic32 --sysroot=/usr/local/freebsd-sysroot/aarch64 -prefix=/usr/local/openssl-custom --openssldir=/opt/openssl-custom -Wl,-rpath=/user/本地/openssl-自定义/lib
然后在运行make命令时出现如下错误:
o crypto/x509v3/v3_info.o crypto/x509v3/v3_int.o crypto/x509v3/v3_lib.o crypto/x509v3/v3_ncons.o crypto/x509v3/v3_pci.o crypto/x509v3/v3_pcia.o crypto/x509v3/v3_pcons.o crypto/x509v3/v3_pku.o crypto/x509v3/v3_pmaps.o crypto/x509v3/v3_prn.o crypto/x509v3/v3_purp.o crypto/x509v3/v3_skey.o crypto/x509v3/v3_sxnet.o crypto/x509v3/v3_tlsf.o crypto/x509v3/v3_utl.o crypto/x509v3/v3err.o -pthread
ld: error: crypto/aes/aes_cbc.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_cfb.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_core.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_ecb.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_ige.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_misc.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_ofb.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aes/aes_wrap.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/aria/aria.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_bitstr.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_d2i_fp.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_digest.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_dup.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_gentm.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_i2d_fp.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_int.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_mbstr.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_object.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_octet.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: crypto/asn1/a_print.o is incompatible with /usr/local/freebsd-sysroot/aarch64/usr/lib/crti.o
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
你们对如何为freebsd arm64交叉编译openssl有任何想法吗?
请与我分享您对此的想法,非常感谢您的帮助。