Host Configuration
******************

Most details about the machine and system on which the compiler is actually running are detected by the configure script.  Some things are impossible for configure to detect; these are described in two ways, either by macros defined in a file named xm-MACHINE.h or by hook functions in the file specified by the OUT_HOST_HOOK_OBJ variable in config.gcc.  (The intention is that very few hosts will need a header file but nearly every fully supported host will need to override some hooks.)

If you need to define only a few macros, and they have simple definitions, consider using the xm_defines variable in your config.gcc entry instead of creating a host configuration header.  See System Config.

Host Common
===========

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 HOST_HOOK_OBJ variable in config.gcc.

 -- Host Hook: void HOST_HOOKS_EXTRA_SIGNALS (void)
     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.

 -- Host Hook: void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t SIZE, int FD)
     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 SIZE bytes.  If the host uses mmap, FD is an open file descriptor that can be used for probing.

 -- Host Hook: int HOST_HOOKS_GT_PCH_USE_ADDRESS (void * ADDRESS, size_t SIZE, int FD, size_t OFFSET)
     This host hook is called when a PCH file is about to be loaded. We want to load SIZE bytes from FD at OFFSET into memory at ADDRESS.  The given address will be the result of a previous invocation of HOST_HOOKS_GT_PCH_GET_ADDRESS. Return -1 if we couldn't allocate SIZE bytes at ADDRESS. Return 0 if the memory is allocated but the data is not loaded.  Return 1 if the hook has performed everything.

     If the implementation uses reserved address space, free any reserved space beyond SIZE, regardless of the return value.  If no PCH will be loaded, this hook may be called with SIZE zero, in which case all reserved address space should be freed.

     Do not try to handle values of ADDRESS 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.

 -- Host Hook: size_t HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY (void);
     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.

Host Filesystem
===============

GCC needs to know a number of things about the semantics of the host machine's filesystem.  Filesystems with Unix and MS-DOS semantics are automatically detected.  For other systems, you can define the following macros in xm-MACHINE.h.

HAVE_DOS_BASED_FILE_SYSTEM
     This macro is automatically defined by system.h if the host file system obeys the semantics defined by MS-DOS instead of Unix. DOS file systems are case insensitive, file specifications may begin with a drive letter, and both forward slash and backslash (/ and \) are directory separators.

DIR_SEPARATOR
DIR_SEPARATOR_2
     If defined, these macros expand to character constants specifying separators for directory names within a file specification. system.h will automatically give them appropriate values on Unix and MS-DOS file systems.  If your file system is neither of these, define one or both appropriately in xm-MACHINE.h.

     However, operating systems like VMS, where constructing a pathname is more complicated than just stringing together directory names separated by a special character, should not define either of these macros.

PATH_SEPARATOR
     If defined, this macro should expand to a character constant specifying the separator for elements of search paths.  The default value is a colon (:).  DOS-based systems usually, but not always, use semicolon (;).

VMS
     Define this macro if the host system is VMS.

HOST_OBJECT_SUFFIX
     Define this macro to be a C string representing the suffix for object files on your host machine.  If you do not define this macro, GCC will use .o as the suffix for object files.

HOST_EXECUTABLE_SUFFIX
     Define this macro to be a C string representing the suffix for executable files on your host machine.  If you do not define this macro, GCC will use the null string as the suffix for executable files.

HOST_BIT_BUCKET
     A pathname defined by the host operating system, which can be opened as a file and written to, but all the information written is discarded. This is commonly known as a bit bucket or null device.  If you do not define this macro, GCC will use /dev/null as the bit bucket.  If the host does not support a bit bucket, define this macro to an invalid filename.

UPDATE_PATH_HOST_CANONICALIZE (PATH)
     If defined, a C statement (sans semicolon) that performs host-dependent canonicalization when a path used in a compilation driver or preprocessor is canonicalized.  PATH is a malloc-ed path to be canonicalized.  If the C statement does canonicalize PATH into a different buffer, the old path should be freed and the new buffer should have been allocated with malloc.

DUMPFILE_FORMAT
     Define this macro to be a C string representing the format to use for constructing the index part of debugging dump file names.  The resultant string must fit in fifteen bytes.  The full filename will be the concatenation of: the prefix of the assembler file name, the string resulting from applying this format to an index number, and a string unique to each dump file kind, e.g. rtl.

     If you do not define this macro, GCC will use .%02d..  You should define this macro if using the default will create an invalid file name.

DELETE_IF_ORDINARY
     Define this macro to be a C statement (sans semicolon) that performs host-dependent removal of ordinary temp files in the compilation driver.

     If you do not define this macro, GCC will use the default version.  You should define this macro if the default version does not reliably remove the temp file as, for example, on VMS which allows multiple versions of a file.

HOST_LACKS_INODE_NUMBERS
     Define this macro if the host filesystem does not report meaningful inode numbers in struct stat.

Host Misc
=========

FATAL_EXIT_CODE
     A C expression for the status code to be returned when the compiler exits after serious errors.  The default is the system-provided macro EXIT_FAILURE, or 1 if the system doesn't define that macro.  Define this macro only if these defaults are incorrect.

SUCCESS_EXIT_CODE
     A C expression for the status code to be returned when the compiler exits without serious errors.  (Warnings are not serious errors.)  The default is the system-provided macro EXIT_SUCCESS, or 0 if the system doesn't define that macro.  Define this macro only if these defaults are incorrect.

USE_C_ALLOCA
     Define this macro if GCC should use the C implementation of alloca provided by libiberty.a.  This only affects how some parts of the compiler itself allocate memory.  It does not change code generation.

     When GCC is built with a compiler other than itself, the C alloca is always used.  This is because most other implementations have serious bugs.  You should define this macro only on a system where no stack-based alloca can possibly work.  For instance, if a system has a small limit on the size of the stack, GCC's builtin alloca will not work reliably.

COLLECT2_HOST_INITIALIZATION
     If defined, a C statement (sans semicolon) that performs host-dependent initialization when collect2 is being initialized.

GCC_DRIVER_HOST_INITIALIZATION
     If defined, a C statement (sans semicolon) that performs host-dependent initialization when a compilation driver is being initialized.

HOST_LONG_LONG_FORMAT
     If defined, the string used to indicate an argument of type long long to functions like printf.  The default value is "ll".

HOST_LONG_FORMAT
     If defined, the string used to indicate an argument of type long to functions like printf.  The default value is "l".

HOST_PTR_PRINTF
     If defined, the string used to indicate an argument of type void * to functions like printf.  The default value is "%p".

In addition, if configure generates an incorrect definition of any of the macros in auto-host.h, you can override that definition in a host configuration header.  If you need to do this, first see if it is possible to fix configure.