Driver.html 27 KB

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