Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

594 lines
27KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Driver (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Driver (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Driver (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Target-Macros.html#Target-Macros" rel="up" title="Target Macros">
  30. <link href="Run_002dtime-Target.html#Run_002dtime-Target" rel="next" title="Run-time Target">
  31. <link href="Target-Structure.html#Target-Structure" rel="prev" title="Target Structure">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Driver"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Run_002dtime-Target.html#Run_002dtime-Target" accesskey="n" rel="next">Run-time Target</a>, Previous: <a href="Target-Structure.html#Target-Structure" accesskey="p" rel="prev">Target Structure</a>, Up: <a href="Target-Macros.html#Target-Macros" accesskey="u" rel="up">Target Macros</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Controlling-the-Compilation-Driver_002c-gcc"></a>
  68. <h3 class="section">18.2 Controlling the Compilation Driver, <samp>gcc</samp></h3>
  69. <a name="index-driver"></a>
  70. <a name="index-controlling-the-compilation-driver"></a>
  71. <p>You can control the compilation driver.
  72. </p>
  73. <dl>
  74. <dt><a name="index-DRIVER_005fSELF_005fSPECS"></a>Macro: <strong>DRIVER_SELF_SPECS</strong></dt>
  75. <dd><p>A list of specs for the driver itself. It should be a suitable
  76. initializer for an array of strings, with no surrounding braces.
  77. </p>
  78. <p>The driver applies these specs to its own command line between loading
  79. default <samp>specs</samp> files (but not command-line specified ones) and
  80. choosing the multilib directory or running any subcommands. It
  81. applies them in the order given, so each spec can depend on the
  82. options added by earlier ones. It is also possible to remove options
  83. using &lsquo;<samp>%&lt;<var>option</var></samp>&rsquo; in the usual way.
  84. </p>
  85. <p>This macro can be useful when a port has several interdependent target
  86. options. It provides a way of standardizing the command line so
  87. that the other specs are easier to write.
  88. </p>
  89. <p>Do not define this macro if it does not need to do anything.
  90. </p></dd></dl>
  91. <dl>
  92. <dt><a name="index-OPTION_005fDEFAULT_005fSPECS"></a>Macro: <strong>OPTION_DEFAULT_SPECS</strong></dt>
  93. <dd><p>A list of specs used to support configure-time default options (i.e.
  94. <samp>--with</samp> options) in the driver. It should be a suitable initializer
  95. for an array of structures, each containing two strings, without the
  96. outermost pair of surrounding braces.
  97. </p>
  98. <p>The first item in the pair is the name of the default. This must match
  99. the code in <samp>config.gcc</samp> for the target. The second item is a spec
  100. to apply if a default with this name was specified. The string
  101. &lsquo;<samp>%(VALUE)</samp>&rsquo; in the spec will be replaced by the value of the default
  102. everywhere it occurs.
  103. </p>
  104. <p>The driver will apply these specs to its own command line between loading
  105. default <samp>specs</samp> files and processing <code>DRIVER_SELF_SPECS</code>, using
  106. the same mechanism as <code>DRIVER_SELF_SPECS</code>.
  107. </p>
  108. <p>Do not define this macro if it does not need to do anything.
  109. </p></dd></dl>
  110. <dl>
  111. <dt><a name="index-CPP_005fSPEC"></a>Macro: <strong>CPP_SPEC</strong></dt>
  112. <dd><p>A C string constant that tells the GCC driver program options to
  113. pass to CPP. It can also specify how to translate options you
  114. give to GCC into options for GCC to pass to the CPP.
  115. </p>
  116. <p>Do not define this macro if it does not need to do anything.
  117. </p></dd></dl>
  118. <dl>
  119. <dt><a name="index-CPLUSPLUS_005fCPP_005fSPEC"></a>Macro: <strong>CPLUSPLUS_CPP_SPEC</strong></dt>
  120. <dd><p>This macro is just like <code>CPP_SPEC</code>, but is used for C++, rather
  121. than C. If you do not define this macro, then the value of
  122. <code>CPP_SPEC</code> (if any) will be used instead.
  123. </p></dd></dl>
  124. <dl>
  125. <dt><a name="index-CC1_005fSPEC"></a>Macro: <strong>CC1_SPEC</strong></dt>
  126. <dd><p>A C string constant that tells the GCC driver program options to
  127. pass to <code>cc1</code>, <code>cc1plus</code>, <code>f771</code>, and the other language
  128. front ends.
  129. It can also specify how to translate options you give to GCC into options
  130. for GCC to pass to front ends.
  131. </p>
  132. <p>Do not define this macro if it does not need to do anything.
  133. </p></dd></dl>
  134. <dl>
  135. <dt><a name="index-CC1PLUS_005fSPEC"></a>Macro: <strong>CC1PLUS_SPEC</strong></dt>
  136. <dd><p>A C string constant that tells the GCC driver program options to
  137. pass to <code>cc1plus</code>. It can also specify how to translate options you
  138. give to GCC into options for GCC to pass to the <code>cc1plus</code>.
  139. </p>
  140. <p>Do not define this macro if it does not need to do anything.
  141. Note that everything defined in CC1_SPEC is already passed to
  142. <code>cc1plus</code> so there is no need to duplicate the contents of
  143. CC1_SPEC in CC1PLUS_SPEC.
  144. </p></dd></dl>
  145. <dl>
  146. <dt><a name="index-ASM_005fSPEC"></a>Macro: <strong>ASM_SPEC</strong></dt>
  147. <dd><p>A C string constant that tells the GCC driver program options to
  148. pass to the assembler. It can also specify how to translate options
  149. you give to GCC into options for GCC to pass to the assembler.
  150. See the file <samp>sun3.h</samp> for an example of this.
  151. </p>
  152. <p>Do not define this macro if it does not need to do anything.
  153. </p></dd></dl>
  154. <dl>
  155. <dt><a name="index-ASM_005fFINAL_005fSPEC"></a>Macro: <strong>ASM_FINAL_SPEC</strong></dt>
  156. <dd><p>A C string constant that tells the GCC driver program how to
  157. run any programs which cleanup after the normal assembler.
  158. Normally, this is not needed. See the file <samp>mips.h</samp> for
  159. an example of this.
  160. </p>
  161. <p>Do not define this macro if it does not need to do anything.
  162. </p></dd></dl>
  163. <dl>
  164. <dt><a name="index-AS_005fNEEDS_005fDASH_005fFOR_005fPIPED_005fINPUT"></a>Macro: <strong>AS_NEEDS_DASH_FOR_PIPED_INPUT</strong></dt>
  165. <dd><p>Define this macro, with no value, if the driver should give the assembler
  166. an argument consisting of a single dash, <samp>-</samp>, to instruct it to
  167. read from its standard input (which will be a pipe connected to the
  168. output of the compiler proper). This argument is given after any
  169. <samp>-o</samp> option specifying the name of the output file.
  170. </p>
  171. <p>If you do not define this macro, the assembler is assumed to read its
  172. standard input if given no non-option arguments. If your assembler
  173. cannot read standard input at all, use a &lsquo;<samp>%{pipe:%e}</samp>&rsquo; construct;
  174. see <samp>mips.h</samp> for instance.
  175. </p></dd></dl>
  176. <dl>
  177. <dt><a name="index-LINK_005fSPEC"></a>Macro: <strong>LINK_SPEC</strong></dt>
  178. <dd><p>A C string constant that tells the GCC driver program options to
  179. pass to the linker. It can also specify how to translate options you
  180. give to GCC into options for GCC to pass to the linker.
  181. </p>
  182. <p>Do not define this macro if it does not need to do anything.
  183. </p></dd></dl>
  184. <dl>
  185. <dt><a name="index-LIB_005fSPEC"></a>Macro: <strong>LIB_SPEC</strong></dt>
  186. <dd><p>Another C string constant used much like <code>LINK_SPEC</code>. The difference
  187. between the two is that <code>LIB_SPEC</code> is used at the end of the
  188. command given to the linker.
  189. </p>
  190. <p>If this macro is not defined, a default is provided that
  191. loads the standard C library from the usual place. See <samp>gcc.c</samp>.
  192. </p></dd></dl>
  193. <dl>
  194. <dt><a name="index-LIBGCC_005fSPEC"></a>Macro: <strong>LIBGCC_SPEC</strong></dt>
  195. <dd><p>Another C string constant that tells the GCC driver program
  196. how and when to place a reference to <samp>libgcc.a</samp> into the
  197. linker command line. This constant is placed both before and after
  198. the value of <code>LIB_SPEC</code>.
  199. </p>
  200. <p>If this macro is not defined, the GCC driver provides a default that
  201. passes the string <samp>-lgcc</samp> to the linker.
  202. </p></dd></dl>
  203. <dl>
  204. <dt><a name="index-REAL_005fLIBGCC_005fSPEC"></a>Macro: <strong>REAL_LIBGCC_SPEC</strong></dt>
  205. <dd><p>By default, if <code>ENABLE_SHARED_LIBGCC</code> is defined, the
  206. <code>LIBGCC_SPEC</code> is not directly used by the driver program but is
  207. instead modified to refer to different versions of <samp>libgcc.a</samp>
  208. depending on the values of the command line flags <samp>-static</samp>,
  209. <samp>-shared</samp>, <samp>-static-libgcc</samp>, and <samp>-shared-libgcc</samp>. On
  210. targets where these modifications are inappropriate, define
  211. <code>REAL_LIBGCC_SPEC</code> instead. <code>REAL_LIBGCC_SPEC</code> tells the
  212. driver how to place a reference to <samp>libgcc</samp> on the link command
  213. line, but, unlike <code>LIBGCC_SPEC</code>, it is used unmodified.
  214. </p></dd></dl>
  215. <dl>
  216. <dt><a name="index-USE_005fLD_005fAS_005fNEEDED"></a>Macro: <strong>USE_LD_AS_NEEDED</strong></dt>
  217. <dd><p>A macro that controls the modifications to <code>LIBGCC_SPEC</code>
  218. mentioned in <code>REAL_LIBGCC_SPEC</code>. If nonzero, a spec will be
  219. generated that uses <samp>--as-needed</samp> or equivalent options and the
  220. shared <samp>libgcc</samp> in place of the
  221. static exception handler library, when linking without any of
  222. <code>-static</code>, <code>-static-libgcc</code>, or <code>-shared-libgcc</code>.
  223. </p></dd></dl>
  224. <dl>
  225. <dt><a name="index-LINK_005fEH_005fSPEC"></a>Macro: <strong>LINK_EH_SPEC</strong></dt>
  226. <dd><p>If defined, this C string constant is added to <code>LINK_SPEC</code>.
  227. When <code>USE_LD_AS_NEEDED</code> is zero or undefined, it also affects
  228. the modifications to <code>LIBGCC_SPEC</code> mentioned in
  229. <code>REAL_LIBGCC_SPEC</code>.
  230. </p></dd></dl>
  231. <dl>
  232. <dt><a name="index-STARTFILE_005fSPEC"></a>Macro: <strong>STARTFILE_SPEC</strong></dt>
  233. <dd><p>Another C string constant used much like <code>LINK_SPEC</code>. The
  234. difference between the two is that <code>STARTFILE_SPEC</code> is used at
  235. the very beginning of the command given to the linker.
  236. </p>
  237. <p>If this macro is not defined, a default is provided that loads the
  238. standard C startup file from the usual place. See <samp>gcc.c</samp>.
  239. </p></dd></dl>
  240. <dl>
  241. <dt><a name="index-ENDFILE_005fSPEC"></a>Macro: <strong>ENDFILE_SPEC</strong></dt>
  242. <dd><p>Another C string constant used much like <code>LINK_SPEC</code>. The
  243. difference between the two is that <code>ENDFILE_SPEC</code> is used at
  244. the very end of the command given to the linker.
  245. </p>
  246. <p>Do not define this macro if it does not need to do anything.
  247. </p></dd></dl>
  248. <dl>
  249. <dt><a name="index-THREAD_005fMODEL_005fSPEC"></a>Macro: <strong>THREAD_MODEL_SPEC</strong></dt>
  250. <dd><p>GCC <code>-v</code> will print the thread model GCC was configured to use.
  251. However, this doesn&rsquo;t work on platforms that are multilibbed on thread
  252. models, such as AIX 4.3. On such platforms, define
  253. <code>THREAD_MODEL_SPEC</code> such that it evaluates to a string without
  254. blanks that names one of the recognized thread models. <code>%*</code>, the
  255. default value of this macro, will expand to the value of
  256. <code>thread_file</code> set in <samp>config.gcc</samp>.
  257. </p></dd></dl>
  258. <dl>
  259. <dt><a name="index-SYSROOT_005fSUFFIX_005fSPEC"></a>Macro: <strong>SYSROOT_SUFFIX_SPEC</strong></dt>
  260. <dd><p>Define this macro to add a suffix to the target sysroot when GCC is
  261. configured with a sysroot. This will cause GCC to search for usr/lib,
  262. et al, within sysroot+suffix.
  263. </p></dd></dl>
  264. <dl>
  265. <dt><a name="index-SYSROOT_005fHEADERS_005fSUFFIX_005fSPEC"></a>Macro: <strong>SYSROOT_HEADERS_SUFFIX_SPEC</strong></dt>
  266. <dd><p>Define this macro to add a headers_suffix to the target sysroot when
  267. GCC is configured with a sysroot. This will cause GCC to pass the
  268. updated sysroot+headers_suffix to CPP, causing it to search for
  269. usr/include, et al, within sysroot+headers_suffix.
  270. </p></dd></dl>
  271. <dl>
  272. <dt><a name="index-EXTRA_005fSPECS"></a>Macro: <strong>EXTRA_SPECS</strong></dt>
  273. <dd><p>Define this macro to provide additional specifications to put in the
  274. <samp>specs</samp> file that can be used in various specifications like
  275. <code>CC1_SPEC</code>.
  276. </p>
  277. <p>The definition should be an initializer for an array of structures,
  278. containing a string constant, that defines the specification name, and a
  279. string constant that provides the specification.
  280. </p>
  281. <p>Do not define this macro if it does not need to do anything.
  282. </p>
  283. <p><code>EXTRA_SPECS</code> is useful when an architecture contains several
  284. related targets, which have various <code>&hellip;_SPECS</code> which are similar
  285. to each other, and the maintainer would like one central place to keep
  286. these definitions.
  287. </p>
  288. <p>For example, the PowerPC System V.4 targets use <code>EXTRA_SPECS</code> to
  289. define either <code>_CALL_SYSV</code> when the System V calling sequence is
  290. used or <code>_CALL_AIX</code> when the older AIX-based calling sequence is
  291. used.
  292. </p>
  293. <p>The <samp>config/rs6000/rs6000.h</samp> target file defines:
  294. </p>
  295. <div class="smallexample">
  296. <pre class="smallexample">#define EXTRA_SPECS \
  297. { &quot;cpp_sysv_default&quot;, CPP_SYSV_DEFAULT },
  298. #define CPP_SYS_DEFAULT &quot;&quot;
  299. </pre></div>
  300. <p>The <samp>config/rs6000/sysv.h</samp> target file defines:
  301. </p><div class="smallexample">
  302. <pre class="smallexample">#undef CPP_SPEC
  303. #define CPP_SPEC \
  304. &quot;%{posix: -D_POSIX_SOURCE } \
  305. %{mcall-sysv: -D_CALL_SYSV } \
  306. %{!mcall-sysv: %(cpp_sysv_default) } \
  307. %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}&quot;
  308. #undef CPP_SYSV_DEFAULT
  309. #define CPP_SYSV_DEFAULT &quot;-D_CALL_SYSV&quot;
  310. </pre></div>
  311. <p>while the <samp>config/rs6000/eabiaix.h</samp> target file defines
  312. <code>CPP_SYSV_DEFAULT</code> as:
  313. </p>
  314. <div class="smallexample">
  315. <pre class="smallexample">#undef CPP_SYSV_DEFAULT
  316. #define CPP_SYSV_DEFAULT &quot;-D_CALL_AIX&quot;
  317. </pre></div>
  318. </dd></dl>
  319. <dl>
  320. <dt><a name="index-LINK_005fLIBGCC_005fSPECIAL_005f1"></a>Macro: <strong>LINK_LIBGCC_SPECIAL_1</strong></dt>
  321. <dd><p>Define this macro if the driver program should find the library
  322. <samp>libgcc.a</samp>. If you do not define this macro, the driver program will pass
  323. the argument <samp>-lgcc</samp> to tell the linker to do the search.
  324. </p></dd></dl>
  325. <dl>
  326. <dt><a name="index-LINK_005fGCC_005fC_005fSEQUENCE_005fSPEC"></a>Macro: <strong>LINK_GCC_C_SEQUENCE_SPEC</strong></dt>
  327. <dd><p>The sequence in which libgcc and libc are specified to the linker.
  328. By default this is <code>%G %L %G</code>.
  329. </p></dd></dl>
  330. <dl>
  331. <dt><a name="index-POST_005fLINK_005fSPEC"></a>Macro: <strong>POST_LINK_SPEC</strong></dt>
  332. <dd><p>Define this macro to add additional steps to be executed after linker.
  333. The default value of this macro is empty string.
  334. </p></dd></dl>
  335. <dl>
  336. <dt><a name="index-LINK_005fCOMMAND_005fSPEC"></a>Macro: <strong>LINK_COMMAND_SPEC</strong></dt>
  337. <dd><p>A C string constant giving the complete command line need to execute the
  338. linker. When you do this, you will need to update your port each time a
  339. change is made to the link command line within <samp>gcc.c</samp>. Therefore,
  340. define this macro only if you need to completely redefine the command
  341. line for invoking the linker and there is no other way to accomplish
  342. the effect you need. Overriding this macro may be avoidable by overriding
  343. <code>LINK_GCC_C_SEQUENCE_SPEC</code> instead.
  344. </p></dd></dl>
  345. <dl>
  346. <dt><a name="index-TARGET_005fALWAYS_005fSTRIP_005fDOTDOT"></a>Common Target Hook: <em>bool</em> <strong>TARGET_ALWAYS_STRIP_DOTDOT</strong></dt>
  347. <dd><p>True if <samp>..</samp> components should always be removed from directory names computed relative to GCC&rsquo;s internal directories, false (default) if such components should be preserved and directory names containing them passed to other tools such as the linker.
  348. </p></dd></dl>
  349. <dl>
  350. <dt><a name="index-MULTILIB_005fDEFAULTS"></a>Macro: <strong>MULTILIB_DEFAULTS</strong></dt>
  351. <dd><p>Define this macro as a C expression for the initializer of an array of
  352. string to tell the driver program which options are defaults for this
  353. target and thus do not need to be handled specially when using
  354. <code>MULTILIB_OPTIONS</code>.
  355. </p>
  356. <p>Do not define this macro if <code>MULTILIB_OPTIONS</code> is not defined in
  357. the target makefile fragment or if none of the options listed in
  358. <code>MULTILIB_OPTIONS</code> are set by default.
  359. See <a href="Target-Fragment.html#Target-Fragment">Target Fragment</a>.
  360. </p></dd></dl>
  361. <dl>
  362. <dt><a name="index-RELATIVE_005fPREFIX_005fNOT_005fLINKDIR"></a>Macro: <strong>RELATIVE_PREFIX_NOT_LINKDIR</strong></dt>
  363. <dd><p>Define this macro to tell <code>gcc</code> that it should only translate
  364. a <samp>-B</samp> prefix into a <samp>-L</samp> linker option if the prefix
  365. indicates an absolute file name.
  366. </p></dd></dl>
  367. <dl>
  368. <dt><a name="index-MD_005fEXEC_005fPREFIX"></a>Macro: <strong>MD_EXEC_PREFIX</strong></dt>
  369. <dd><p>If defined, this macro is an additional prefix to try after
  370. <code>STANDARD_EXEC_PREFIX</code>. <code>MD_EXEC_PREFIX</code> is not searched
  371. when the compiler is built as a cross
  372. compiler. If you define <code>MD_EXEC_PREFIX</code>, then be sure to add it
  373. to the list of directories used to find the assembler in <samp>configure.ac</samp>.
  374. </p></dd></dl>
  375. <dl>
  376. <dt><a name="index-STANDARD_005fSTARTFILE_005fPREFIX"></a>Macro: <strong>STANDARD_STARTFILE_PREFIX</strong></dt>
  377. <dd><p>Define this macro as a C string constant if you wish to override the
  378. standard choice of <code>libdir</code> as the default prefix to
  379. try when searching for startup files such as <samp>crt0.o</samp>.
  380. <code>STANDARD_STARTFILE_PREFIX</code> is not searched when the compiler
  381. is built as a cross compiler.
  382. </p></dd></dl>
  383. <dl>
  384. <dt><a name="index-STANDARD_005fSTARTFILE_005fPREFIX_005f1"></a>Macro: <strong>STANDARD_STARTFILE_PREFIX_1</strong></dt>
  385. <dd><p>Define this macro as a C string constant if you wish to override the
  386. standard choice of <code>/lib</code> as a prefix to try after the default prefix
  387. when searching for startup files such as <samp>crt0.o</samp>.
  388. <code>STANDARD_STARTFILE_PREFIX_1</code> is not searched when the compiler
  389. is built as a cross compiler.
  390. </p></dd></dl>
  391. <dl>
  392. <dt><a name="index-STANDARD_005fSTARTFILE_005fPREFIX_005f2"></a>Macro: <strong>STANDARD_STARTFILE_PREFIX_2</strong></dt>
  393. <dd><p>Define this macro as a C string constant if you wish to override the
  394. standard choice of <code>/lib</code> as yet another prefix to try after the
  395. default prefix when searching for startup files such as <samp>crt0.o</samp>.
  396. <code>STANDARD_STARTFILE_PREFIX_2</code> is not searched when the compiler
  397. is built as a cross compiler.
  398. </p></dd></dl>
  399. <dl>
  400. <dt><a name="index-MD_005fSTARTFILE_005fPREFIX"></a>Macro: <strong>MD_STARTFILE_PREFIX</strong></dt>
  401. <dd><p>If defined, this macro supplies an additional prefix to try after the
  402. standard prefixes. <code>MD_EXEC_PREFIX</code> is not searched when the
  403. compiler is built as a cross compiler.
  404. </p></dd></dl>
  405. <dl>
  406. <dt><a name="index-MD_005fSTARTFILE_005fPREFIX_005f1"></a>Macro: <strong>MD_STARTFILE_PREFIX_1</strong></dt>
  407. <dd><p>If defined, this macro supplies yet another prefix to try after the
  408. standard prefixes. It is not searched when the compiler is built as a
  409. cross compiler.
  410. </p></dd></dl>
  411. <dl>
  412. <dt><a name="index-INIT_005fENVIRONMENT"></a>Macro: <strong>INIT_ENVIRONMENT</strong></dt>
  413. <dd><p>Define this macro as a C string constant if you wish to set environment
  414. variables for programs called by the driver, such as the assembler and
  415. loader. The driver passes the value of this macro to <code>putenv</code> to
  416. initialize the necessary environment variables.
  417. </p></dd></dl>
  418. <dl>
  419. <dt><a name="index-LOCAL_005fINCLUDE_005fDIR"></a>Macro: <strong>LOCAL_INCLUDE_DIR</strong></dt>
  420. <dd><p>Define this macro as a C string constant if you wish to override the
  421. standard choice of <samp>/usr/local/include</samp> as the default prefix to
  422. try when searching for local header files. <code>LOCAL_INCLUDE_DIR</code>
  423. comes before <code>NATIVE_SYSTEM_HEADER_DIR</code> (set in
  424. <samp>config.gcc</samp>, normally <samp>/usr/include</samp>) in the search order.
  425. </p>
  426. <p>Cross compilers do not search either <samp>/usr/local/include</samp> or its
  427. replacement.
  428. </p></dd></dl>
  429. <dl>
  430. <dt><a name="index-NATIVE_005fSYSTEM_005fHEADER_005fCOMPONENT"></a>Macro: <strong>NATIVE_SYSTEM_HEADER_COMPONENT</strong></dt>
  431. <dd><p>The &ldquo;component&rdquo; corresponding to <code>NATIVE_SYSTEM_HEADER_DIR</code>.
  432. See <code>INCLUDE_DEFAULTS</code>, below, for the description of components.
  433. If you do not define this macro, no component is used.
  434. </p></dd></dl>
  435. <dl>
  436. <dt><a name="index-INCLUDE_005fDEFAULTS"></a>Macro: <strong>INCLUDE_DEFAULTS</strong></dt>
  437. <dd><p>Define this macro if you wish to override the entire default search path
  438. for include files. For a native compiler, the default search path
  439. usually consists of <code>GCC_INCLUDE_DIR</code>, <code>LOCAL_INCLUDE_DIR</code>,
  440. <code>GPLUSPLUS_INCLUDE_DIR</code>, and
  441. <code>NATIVE_SYSTEM_HEADER_DIR</code>. In addition, <code>GPLUSPLUS_INCLUDE_DIR</code>
  442. and <code>GCC_INCLUDE_DIR</code> are defined automatically by <samp>Makefile</samp>,
  443. and specify private search areas for GCC. The directory
  444. <code>GPLUSPLUS_INCLUDE_DIR</code> is used only for C++ programs.
  445. </p>
  446. <p>The definition should be an initializer for an array of structures.
  447. Each array element should have four elements: the directory name (a
  448. string constant), the component name (also a string constant), a flag
  449. for C++-only directories,
  450. and a flag showing that the includes in the directory don&rsquo;t need to be
  451. wrapped in <code>extern &lsquo;<samp>C</samp>&rsquo;</code> when compiling C++. Mark the end of
  452. the array with a null element.
  453. </p>
  454. <p>The component name denotes what GNU package the include file is part of,
  455. if any, in all uppercase letters. For example, it might be &lsquo;<samp>GCC</samp>&rsquo;
  456. or &lsquo;<samp>BINUTILS</samp>&rsquo;. If the package is part of a vendor-supplied
  457. operating system, code the component name as &lsquo;<samp>0</samp>&rsquo;.
  458. </p>
  459. <p>For example, here is the definition used for VAX/VMS:
  460. </p>
  461. <div class="smallexample">
  462. <pre class="smallexample">#define INCLUDE_DEFAULTS \
  463. { \
  464. { &quot;GNU_GXX_INCLUDE:&quot;, &quot;G++&quot;, 1, 1}, \
  465. { &quot;GNU_CC_INCLUDE:&quot;, &quot;GCC&quot;, 0, 0}, \
  466. { &quot;SYS$SYSROOT:[SYSLIB.]&quot;, 0, 0, 0}, \
  467. { &quot;.&quot;, 0, 0, 0}, \
  468. { 0, 0, 0, 0} \
  469. }
  470. </pre></div>
  471. </dd></dl>
  472. <p>Here is the order of prefixes tried for exec files:
  473. </p>
  474. <ol>
  475. <li> Any prefixes specified by the user with <samp>-B</samp>.
  476. </li><li> The environment variable <code>GCC_EXEC_PREFIX</code> or, if <code>GCC_EXEC_PREFIX</code>
  477. is not set and the compiler has not been installed in the configure-time
  478. <var>prefix</var>, the location in which the compiler has actually been installed.
  479. </li><li> The directories specified by the environment variable <code>COMPILER_PATH</code>.
  480. </li><li> The macro <code>STANDARD_EXEC_PREFIX</code>, if the compiler has been installed
  481. in the configured-time <var>prefix</var>.
  482. </li><li> The location <samp>/usr/libexec/gcc/</samp>, but only if this is a native compiler.
  483. </li><li> The location <samp>/usr/lib/gcc/</samp>, but only if this is a native compiler.
  484. </li><li> The macro <code>MD_EXEC_PREFIX</code>, if defined, but only if this is a native
  485. compiler.
  486. </li></ol>
  487. <p>Here is the order of prefixes tried for startfiles:
  488. </p>
  489. <ol>
  490. <li> Any prefixes specified by the user with <samp>-B</samp>.
  491. </li><li> The environment variable <code>GCC_EXEC_PREFIX</code> or its automatically determined
  492. value based on the installed toolchain location.
  493. </li><li> The directories specified by the environment variable <code>LIBRARY_PATH</code>
  494. (or port-specific name; native only, cross compilers do not use this).
  495. </li><li> The macro <code>STANDARD_EXEC_PREFIX</code>, but only if the toolchain is installed
  496. in the configured <var>prefix</var> or this is a native compiler.
  497. </li><li> The location <samp>/usr/lib/gcc/</samp>, but only if this is a native compiler.
  498. </li><li> The macro <code>MD_EXEC_PREFIX</code>, if defined, but only if this is a native
  499. compiler.
  500. </li><li> The macro <code>MD_STARTFILE_PREFIX</code>, if defined, but only if this is a
  501. native compiler, or we have a target system root.
  502. </li><li> The macro <code>MD_STARTFILE_PREFIX_1</code>, if defined, but only if this is a
  503. native compiler, or we have a target system root.
  504. </li><li> The macro <code>STANDARD_STARTFILE_PREFIX</code>, with any sysroot modifications.
  505. If this path is relative it will be prefixed by <code>GCC_EXEC_PREFIX</code> and
  506. the machine suffix or <code>STANDARD_EXEC_PREFIX</code> and the machine suffix.
  507. </li><li> The macro <code>STANDARD_STARTFILE_PREFIX_1</code>, but only if this is a native
  508. compiler, or we have a target system root. The default for this macro is
  509. <samp>/lib/</samp>.
  510. </li><li> The macro <code>STANDARD_STARTFILE_PREFIX_2</code>, but only if this is a native
  511. compiler, or we have a target system root. The default for this macro is
  512. <samp>/usr/lib/</samp>.
  513. </li></ol>
  514. <hr>
  515. <div class="header">
  516. <p>
  517. Next: <a href="Run_002dtime-Target.html#Run_002dtime-Target" accesskey="n" rel="next">Run-time Target</a>, Previous: <a href="Target-Structure.html#Target-Structure" accesskey="p" rel="prev">Target Structure</a>, Up: <a href="Target-Macros.html#Target-Macros" accesskey="u" rel="up">Target Macros</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  518. </div>
  519. </body>
  520. </html>