私のツールチェーンは arm-gcc の最近のバージョンです。
条件付きでインクルード/アセンブルする必要があるアセンブリ ファイルにコードがあります。
.ifdef MACRO_FROM_CMDLINE
Assembly instr1
Assembly instr2
.endif
カプセル化されたコードは最近追加されました。
私は両方を試しました:
gcc -x assembler-with-cpp --defsym MACRO_FROM_CMDLINE=1 <along with other necessary options>
gcc -x assembler-with-cpp -D MACRO_FROM_CMDLINE=1 <along with other necessary options>
その-D
結果、「.ifdef の無効な識別子」および「.if なしの .endif」エラーが発生します。
その--defsym
結果、「MACRO_FROM_CMDLINE=1 : そのようなファイルまたはディレクトリはありません」、「認識されないオプション --defsym」エラーが発生します。