ARM用のGNU画面をクロスコンパイルできません。

ARM用のGNU画面をクロスコンパイルできません。

私はUbuntuを使用しており、Busyboxを実行している古いARMデバイス用のGNU画面を構築しようとしています。 /usr/local/toolchainにカスタムクロスコンパイルツールチェーンをインストールしました。私は画面4.3.1(私のツールチェーンがその時代のものであることを考慮すると適切に見える7年前のバージョン)をダウンロードしました。画面の構成スクリプトは、ホストPCがターゲットであると仮定し、Busyboxには存在しないさまざまな機能を検出するため、ホストの代わりにツールチェーンファイルを使用するようにいくつかのオプションを設定する必要があります。私の最後のコマンドとその結果は次のとおりです。

$ CC=/usr/local/toolchain/usr/bin/arm-linux-gcc ./configure --host=arm-linux-gnueabi --prefix=/usr/local/toolchain/usr 
this is screen version 4.3.1
checking for arm-linux-gnueabi-gcc... /usr/local/toolchain/usr/bin/arm-linux-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/toolchain/usr/bin/arm-linux-gcc accepts -g... yes
checking for /usr/local/toolchain/usr/bin/arm-linux-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/local/toolchain/usr/bin/arm-linux-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether /usr/local/toolchain/usr/bin/arm-linux-gcc needs -traditional... no
checking for library containing strerror... none required
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
configure: error: in `/home/user1/dev/playground/screen-v.4.3.1/src':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

config.logの関連部分:

...
 292   │ configure:3633: checking whether it is safe to define __EXTENSIONS__
 293   │ configure:3651: /usr/local/toolchain/usr/bin/arm-linux-gcc -c -g -O2  conftest.c >&5
 294   │ configure:3651: $? = 0
 295   │ configure:3658: result: yes
 296   │ configure:3674: error: in `/home/user1/dev/playground/screen-v.4.3.1/src':
 297   │ configure:3676: error: cannot run test program while cross compiling
 298   │ See `config.log' for more details

cross_compilingという設定テストに失敗しましたが、理由は明確ではありません。この問題を発見しましたglibクロスコンパイル時にテストプログラムを無効にする方法、サイトファイルを使用してテストを無効にする方法を教えていますが、cross_compilingを無効にすると、「Cコンパイラは実行可能ファイルを生成できません」というメッセージで失敗します。これは無効にできるテストではありません。

もちろん、同じコンパイラでクロスコンパイルしたので問題ありません。初心者が見るには画面構成が複雑すぎて詰まったんですね。どんな提案がありますか?

ベストアンサー1

上記のようにクロスコンパイル時にテストプログラムを実行できない - クロスコンパイルFirebirdすべての「AC_TRY_RUN」機能ブロックを削除して、configure.inファイルを「改善」することができます。このソリューションが可能です。

それ以外の場合は、ビルドコンテナを使用してその中のすべてを実行できます。

おすすめ記事