FreeBASIC マニュアルのトップに戻る

FreeBASIC CompilerOptarch

目次→コンパイラ→コマンド・ラインを使うCompiler Option: -arch←オリジナル・サイト
目次コンパイラ・オプション一覧Compiler Option: -arch←オリジナル・サイト

コンパイラ・オプション: -arch 左にメニュー・フレームが表示されていない場合は、ここをクリックして下さい

←リンク元に戻る プログラム開発関連に戻る

改良/制限のためのコード生成や、クロスコンパイルのための、目標アーキテクチャを設定

Syntax:
-arch < architecture >

Parameters:
architecture
The target architecture. Recognized values:

  • Related to 32bit x86:
    • 386
    • 486
    • 586 (default for x86 on DOS)
    • 686 (default for x86 except on DOS)
    • athlon
    • athlon-xp
    • athlon-fx
    • k8-sse3
    • pentium-mmx
    • pentium2
    • pentium3
    • pentium4
    • pentium4-sse3
    • x86
  • Related to 64bit x86_64:
    • x86_64, x86-64, amd64
  • Related to 32bit ARM:
    • armeabi
    • armeabi-v7a (default for arm-android)
    • armv5 (alias for armv5te)
    • armv5te (default for armeabi)
    • armv6
    • armv7 (alias for armv7-a)
    • armv7a (alias for armv7-a)
    • armv7-a (default for ARM, but the toolchain may interpret as armv7-a+fp)
    • armv7-a+fp
    • 実際のアーム・アーキテクチャには様々なバリエーションがあり、その解釈はツールチェーンや時代によって異なります。
  • Related to 64bit ARM (AArch64):
    • aarch64
  • Related to 32bit PowerPC:
    • powerpc (big endian)
  • Related to 64bit PowerPC:
    • powerpc64 (big endian)
    • powerpc64le (little endian)
  • Others:
    • native: For compiling to the architecture which the compiler is running on.
    • 32, 64: For quick cross-compiling to the 32bit or 64bit version of the default architecture.

Description:
The -arch compiler option sets the target CPU architecture. This can be used for multiple purposes:


The exact impact which the -arch setting has on code generation depends on the code generation backend that is being used. The x86 ASM backend (-gen gas) handles the -arch setting and adjusts code generation accordingly in some cases. When using the GCC backend (-gen gcc), the specified architecture will be passed on to gcc via gcc -march=<...>, causing gcc to generate code for the specified architecture.

However, -arch only affects newly generated code, but not pre-compiled code such as the FreeBASIC runtime libraries, or any other library from the lib/ directory. For example, using -arch 386 is not necessarily enough to get a pure i386 executable -- it also depends on how all the libraries that will be linked in were compiled.

The -arch 32 and -arch 64 shortcuts are similar to gcc's -m32/-m64 options. On 32bit architectures, -arch 64 is an abbreviation for cross-compiling to the default 64bit version of the architecture (e.g. from 32bit x86 to 64bit x86_64, or 32bit ARM to 64bit AArch64, or 32bit PowerPC to 64bit PowerPC), and -arch 32 does nothing. On 64bit systems, it is the other way round: -arch 32 cross-compiles to the default 32bit architecture, while -arch 64 does nothing.

The -arch native shortcut is similar to gcc's -march=native option. On x86, it causes fbc to try and detect the host CPU automatically based on the cpuid instruction and its availability or results. On other architectures, this will currently simply use the architecture which the compiler itself was built for. Under -gen gcc this will use gcc -march=native.

Specifying an -arch setting incompatible to the native architecture will trigger cross-compilation, just like the -target option, except that only the target architecture, but not the target operating system, is changed.

バージョン:
参照:

コマンド・ラインを使う に戻る
コンパイラ・オプション一覧 に戻る
←リンク元に戻る プログラム開発関連に戻る


ページ歴史:2024-01-07 08:06:11
日本語翻訳:WATANABE Makoto、原文著作者:JeffMarshall

ホームページのトップに戻る

表示-非営利-継承