<html lang="en"> <head> <title>Host Common - GNU Compiler Collection (GCC) Internals</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Compiler Collection (GCC) Internals"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Host-Config.html#Host-Config" title="Host Config"> <link rel="next" href="Filesystem.html#Filesystem" title="Filesystem"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being ``Funding Free Software'', the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled ``GNU Free Documentation License''. (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Host-Common"></a> <p> Next: <a rel="next" accesskey="n" href="Filesystem.html#Filesystem">Filesystem</a>, Up: <a rel="up" accesskey="u" href="Host-Config.html#Host-Config">Host Config</a> <hr> </div> <h3 class="section">18.1 Host Common</h3> <p><a name="index-host-hooks-5022"></a><a name="index-host-functions-5023"></a> Some things are just not portable, even between similar operating systems, and are too difficult for autoconf to detect. They get implemented using hook functions in the file specified by the <var>host_hook_obj</var> variable in <samp><span class="file">config.gcc</span></samp>. <div class="defun"> — Host Hook: void <b>HOST_HOOKS_EXTRA_SIGNALS</b> (<var>void</var>)<var><a name="index-HOST_005fHOOKS_005fEXTRA_005fSIGNALS-5024"></a></var><br> <blockquote><p>This host hook is used to set up handling for extra signals. The most common thing to do in this hook is to detect stack overflow. </p></blockquote></div> <div class="defun"> — Host Hook: void * <b>HOST_HOOKS_GT_PCH_GET_ADDRESS</b> (<var>size_t size, int fd</var>)<var><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fGET_005fADDRESS-5025"></a></var><br> <blockquote><p>This host hook returns the address of some space that is likely to be free in some subsequent invocation of the compiler. We intend to load the PCH data at this address such that the data need not be relocated. The area should be able to hold <var>size</var> bytes. If the host uses <code>mmap</code>, <var>fd</var> is an open file descriptor that can be used for probing. </p></blockquote></div> <div class="defun"> — Host Hook: int <b>HOST_HOOKS_GT_PCH_USE_ADDRESS</b> (<var>void * address, size_t size, int fd, size_t offset</var>)<var><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fUSE_005fADDRESS-5026"></a></var><br> <blockquote><p>This host hook is called when a PCH file is about to be loaded. We want to load <var>size</var> bytes from <var>fd</var> at <var>offset</var> into memory at <var>address</var>. The given address will be the result of a previous invocation of <code>HOST_HOOKS_GT_PCH_GET_ADDRESS</code>. Return −1 if we couldn't allocate <var>size</var> bytes at <var>address</var>. Return 0 if the memory is allocated but the data is not loaded. Return 1 if the hook has performed everything. <p>If the implementation uses reserved address space, free any reserved space beyond <var>size</var>, regardless of the return value. If no PCH will be loaded, this hook may be called with <var>size</var> zero, in which case all reserved address space should be freed. <p>Do not try to handle values of <var>address</var> that could not have been returned by this executable; just return −1. Such values usually indicate an out-of-date PCH file (built by some other GCC executable), and such a PCH file won't work. </p></blockquote></div> <div class="defun"> — Host Hook: size_t <b>HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY</b> (<var>void</var>)<var>;<a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fALLOC_005fGRANULARITY-5027"></a></var><br> <blockquote><p>This host hook returns the alignment required for allocating virtual memory. Usually this is the same as getpagesize, but on some hosts the alignment for reserving memory differs from the pagesize for committing memory. </p></blockquote></div> </body></html>