lxc コンテナで i386 debian システムを実行しています。ユーザーランドは 32 ビット、カーネルは 64 ビットです。したがって、configure はこれを検出します。
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
おそらく、これはuname -mの出力から取得したものです。
gcc で問題なくビルドできるパッケージがあり、結果は適切な 32 ビット バイナリです。残念ながら、別の C++ プロジェクトでは、次のようになります。
configure:8595: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
ここから、リンカーはこのスイッチを使用しているため、32 ビットではなく 64 ビットのライブラリをリンクしようとして失敗します。
/usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: cannot find -lboost_program_options
collect2: ld returned 1 exit status
ライブラリの .so ファイルは適切な 32 ビット ELF ですが、次のようになります。
file /usr/lib/libboost_program_options.so.*
/usr/lib/libboost_program_options.so.1.42.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
奇妙なのは、構成が他のプロジェクトで正常に機能し、リンカが適切なアーキテクチャ (elf_i386) を使用するように正しく検出されることです。
checking whether the gcc linker (/usr/bin/ld -m elf_i386) supports shared libraries... yes
ヒントはありますか?