Host-Common.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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: Host Common</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Host Common">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Host Common">
  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="Host-Config.html#Host-Config" rel="up" title="Host Config">
  30. <link href="Filesystem.html#Filesystem" rel="next" title="Filesystem">
  31. <link href="Host-Config.html#Host-Config" rel="prev" title="Host Config">
  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="Host-Common"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Filesystem.html#Filesystem" accesskey="n" rel="next">Filesystem</a>, Up: <a href="Host-Config.html#Host-Config" accesskey="u" rel="up">Host Config</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="Host-Common-1"></a>
  69. <h3 class="section">18.1 Host Common</h3>
  70. <a name="index-host-hooks"></a>
  71. <a name="index-host-functions"></a>
  72. <p>Some things are just not portable, even between similar operating systems,
  73. and are too difficult for autoconf to detect. They get implemented using
  74. hook functions in the file specified by the <var>host_hook_obj</var>
  75. variable in <samp>config.gcc</samp>.
  76. </p>
  77. <dl>
  78. <dt><a name="index-HOST_005fHOOKS_005fEXTRA_005fSIGNALS"></a>Host Hook: <em>void</em> <strong>HOST_HOOKS_EXTRA_SIGNALS</strong> <em>(void)</em></dt>
  79. <dd><p>This host hook is used to set up handling for extra signals. The most
  80. common thing to do in this hook is to detect stack overflow.
  81. </p></dd></dl>
  82. <dl>
  83. <dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fGET_005fADDRESS"></a>Host Hook: <em>void *</em> <strong>HOST_HOOKS_GT_PCH_GET_ADDRESS</strong> <em>(size_t <var>size</var>, int <var>fd</var>)</em></dt>
  84. <dd><p>This host hook returns the address of some space that is likely to be
  85. free in some subsequent invocation of the compiler. We intend to load
  86. the PCH data at this address such that the data need not be relocated.
  87. The area should be able to hold <var>size</var> bytes. If the host uses
  88. <code>mmap</code>, <var>fd</var> is an open file descriptor that can be used for
  89. probing.
  90. </p></dd></dl>
  91. <dl>
  92. <dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fUSE_005fADDRESS"></a>Host Hook: <em>int</em> <strong>HOST_HOOKS_GT_PCH_USE_ADDRESS</strong> <em>(void * <var>address</var>, size_t <var>size</var>, int <var>fd</var>, size_t <var>offset</var>)</em></dt>
  93. <dd><p>This host hook is called when a PCH file is about to be loaded.
  94. We want to load <var>size</var> bytes from <var>fd</var> at <var>offset</var>
  95. into memory at <var>address</var>. The given address will be the result of
  96. a previous invocation of <code>HOST_HOOKS_GT_PCH_GET_ADDRESS</code>.
  97. Return -1 if we couldn&rsquo;t allocate <var>size</var> bytes at <var>address</var>.
  98. Return 0 if the memory is allocated but the data is not loaded. Return 1
  99. if the hook has performed everything.
  100. </p>
  101. <p>If the implementation uses reserved address space, free any reserved
  102. space beyond <var>size</var>, regardless of the return value. If no PCH will
  103. be loaded, this hook may be called with <var>size</var> zero, in which case
  104. all reserved address space should be freed.
  105. </p>
  106. <p>Do not try to handle values of <var>address</var> that could not have been
  107. returned by this executable; just return -1. Such values usually
  108. indicate an out-of-date PCH file (built by some other GCC executable),
  109. and such a PCH file won&rsquo;t work.
  110. </p></dd></dl>
  111. <dl>
  112. <dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fALLOC_005fGRANULARITY"></a>Host Hook: <em>size_t</em> <strong>HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY</strong> <em>(void);</em></dt>
  113. <dd><p>This host hook returns the alignment required for allocating virtual
  114. memory. Usually this is the same as getpagesize, but on some hosts the
  115. alignment for reserving memory differs from the pagesize for committing
  116. memory.
  117. </p></dd></dl>
  118. <hr>
  119. <div class="header">
  120. <p>
  121. Next: <a href="Filesystem.html#Filesystem" accesskey="n" rel="next">Filesystem</a>, Up: <a href="Host-Config.html#Host-Config" accesskey="u" rel="up">Host Config</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>
  122. </div>
  123. </body>
  124. </html>