MIPS用Opensslクロスコンパイル

MIPS用Opensslクロスコンパイル

MIPSアーキテクチャ(ビッグエンディアン)用にNcatをクロスコンパイルしようとしましたが、SSLサポートが必要なので、まずOpenSSLをコンパイルする必要があります。私のツールチェーンバイナリの名前は 'mips-gcc mips-ld...etc'と同じなので、Githubから最新バージョンをダウンロードして次のように設定しました。

export PATH=$PATH:/path/to/toolchain
./Configure linux-mips32 --cross-compile-prefix=mips-

makefile は、クロスツールチェーンを使用して構成されます。たとえば、次のようになります。

CC=mips-gcc 
LD=mips-ld 
AR=mips-ar 
RANLIB=mips-ranlib

だから私は走ったmake

初めて実行すると、次のエラーが発生します。

../libcrypto.a(async_posix.o): In function `async_global_init':
async_posix.c:(.text+0x278): undefined reference to `pthread_key_create'
async_posix.c:(.text+0x2a4): undefined reference to `pthread_key_create'
make[2]: *** [link_app.] Error 1
make[2]: Leaving directory `/home/anon/Source/openssl/apps'
make[1]: *** [openssl] Error 2
make[1]: Leaving directory `/home/anon/Source/openssl/apps'
make: *** [build_apps] Error 1

-lpthreadCFLAGSにオプションを追加する方法について別のスレッドを読みましたが、まだ同じエラーが発生します。他の人はGCCの代わりにG ++を使うように提案しました(これは何ですか?)。これで、次のエラーが発生します。

s_socket.o: In function `do_server':
s_socket.c:(.text+0x6d4): warning: gethostbyaddr is obsolescent, usegetaddrinfo() instead.
s_socket.o: In function `host_ip':
s_socket.c:(.text+0x100): warning: gethostbyname is obsolescent, use getnameinfo() instead.
../libcrypto.a(async.o): In function `async_fibre_swapcontext':
async.c:(.text+0x248): undefined reference to `setcontext'
../libcrypto.a(async_posix.o): In function `async_fibre_makecontext':
async_posix.c:(.text+0x154): undefined reference to `getcontext'
async_posix.c:(.text+0x1b4): undefined reference to `makecontext'
make[2]: *** [link_app.] Error 1
make[2]: Leaving directory `/home/anon/Source/openssl/apps'
make[1]: *** [openssl] Error 2
make[1]: Leaving directory `/home/anon/Source/openssl/apps'
make: *** [build_apps] Error 1

私が使用するcflagは次のとおりです。

CFLAG= -DOPENSSL_THREADS -pthread -DDSO_DLFCN -DHAVE_DLFCN_H -mips2 -mabi=32 -Wall -DBN_DIV3W -O3 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DAES_ASM -lpthread

オプションは次のとおりです。

--cross-compile-prefix=mips- no-deprecated no-ec_nistp_64_gcc_128 no-jpake no-md2 no-rc5 no-sctp no-shared no-ssl-trace no-store no-unit-test no-zlib no-zlib-dynamic static-engine

解決策を見つけるためにウェブ全体を検索しました。私はCコンパイルの経験があまりなく、この時点で詰まっていました。助けてくれて本当にありがとうございます。私は何が間違っていましたか?

ベストアンサー1

おすすめ記事