回答の試み (gcc.c
ドライバーのソースと Makefile 環境を数分間見て収集した結果)。
これらのパスは、実行時に次のものから構築されます。
- GCC exec プレフィックス (のGCC ドキュメントを参照
GCC_EXEC_PREFIX
)
- 環境
$LIBRARY_PATH
変数
$LPATH
環境変数 (のように扱われます$LIBRARY_PATH
)
-B
コマンドライン スイッチに渡される値
- 標準の実行可能プレフィックス (コンパイル時に指定)
- ツールディレクトリプレフィックス
最後のもの (tooldir プレフィックス) は通常、相対パスとして定義されます: gcc からMakefile.in
# Directory in which the compiler finds libraries etc.
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
# Directory in which the compiler finds executables
libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
# Used to produce a relative $(gcc_tooldir) in gcc.o
unlibsubdir = ../../..
....
# These go as compilation flags, so they define the tooldir base prefix
# as ../../../../, and the one of the library search prefixes as ../../../
# These get PREFIX appended, and then machine for which gcc is built
# i.e i484-linux-gnu, to get something like:
# /usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../i486-linux-gnu/lib/../lib/
DRIVER_DEFINES = \
-DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
-DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
ただし、これらはコンパイラ バージョン固有のパス用です。あなたの例は、上に挙げた環境変数の影響を受けている可能性があります ( LIBRARY_PATH
, LPATH
)