Solaris 10では、64ビットgcc 4.9.0を構築しました。少なくとも私はそうだったと思います。 Apacheやその他の必要なツールに基づいてスタックを構築しています。
Apacheをビルドすると、file
64ビットhttpdが表示されます。
file apache-test/bin/httpd
apache-test/bin/httpd: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
したがって、これは私のGCCが64ビットであることを示しています。ただし、バイナリをビルドしたディレクトリからfor f in *; do file $f; done
取得したディレクトリ全体に対してファイルを実行します。
for f in *; do file $f; done
a.out: empty file
addr2line: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
ar: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
as: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
c_rehash: executable /usr/bin/perl script
c++: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
c++filt: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
compile_et: executable shell script
cpp: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
elfedit: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
g++: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
gcc: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
gcc-ar: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
gcc-nm: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
gcc-ranlib: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
gcov: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS POPC], dynamically linked, not stripped
gprof: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
gss-client: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
k5srvutil: executable shell script
kadmin: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
kdestroy: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
kinit: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
klist: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
kpasswd: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
krb5-config: executable shell script
kswitch: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
ktutil: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
kvno: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
ld: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
ld.bfd: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
nm: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
objcopy: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
objdump: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
openssl: ELF 64-bit MSB executable SPARCV9 Version 1, UltraSPARC1 Extensions Required, dynamically linked, not stripped, no debugging information available
pcre-config: executable shell script
pcregrep: ELF 64-bit MSB executable SPARCV9 Version 1, UltraSPARC3 Extensions Required, dynamically linked, not stripped
pcretest: ELF 64-bit MSB executable SPARCV9 Version 1, UltraSPARC3 Extensions Required, dynamically linked, not stripped
ranlib: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
readelf: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
sclient: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
sim_client: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
size: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
sparc-sun-solaris2.10-c++: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
sparc-sun-solaris2.10-g++: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
sparc-sun-solaris2.10-gcc: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
sparc-sun-solaris2.10-gcc-4.9.0: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 FMAF VIS], dynamically linked, not stripped
sparc-sun-solaris2.10-gcc-ar: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
sparc-sun-solaris2.10-gcc-nm: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
sparc-sun-solaris2.10-gcc-ranlib: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3], dynamically linked, not stripped
strings: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
strip: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [CBCOND VIS3 VIS], dynamically linked, not stripped
uuclient: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
なぜそれほど多くの32ビットバージョンが表示されますか? gccを使用してApacheをビルドする場合、gccファイルに32ビットとマークされていますが、どのように64ビットになりますか?
答え1
SolarisのGCCには、LinuxのGCCとは異なるデフォルト値があります。
64 個のバイナリをコンパイルするには、以下を追加する必要があります。
-m64
コンパイルとリンク行に。
これに関して、GCCはSolaris Studio Cコンパイラと互換性があります。
SPARCでは、プログラムを32ビットにコンパイルしても、64ビットが追加のレジスタを提供するx86と同じ欠点はありません。
答え2
コンパイラを一部の入力から出力を生成する関数と考える必要があります。
output_program = compile_function(input_source, args)
compile_function
32ビットまたは64ビットのバイナリがある場合は影響します。どのように操作は実行されますが、出力はありません。
64ビットの役割を単にアドレス指定可能なメモリ量を増やすことで大幅に簡素化する場合、技術的には32ビットコンパイラは出力を生成するために4 GB以上のアドレス指定可能メモリが必要な場合にのみ問題が発生するはずです。このシナリオは基本的に今日では考えられないことです(一部の人がこれに対する人為的な例を思い出すことができると確信していますが)。