Movatterモバイル変換


[0]ホーム

URL:


Next:, Up:Host Configuration   [Contents][Index]


18.1 Host Common

Some things are just not portable, even between similar operating systems,and are too difficult for autoconf to detect. They get implemented usinghook functions in the file specified by thehost_hook_objvariable inconfig.gcc.

Host Hook:voidHOST_HOOKS_EXTRA_SIGNALS(void)

This host hook is used to set up handling for extra signals. The mostcommon thing to do in this hook is to detect stack overflow.

Host Hook:void *HOST_HOOKS_GT_PCH_GET_ADDRESS(size_tsize, intfd)

This host hook returns the address of some space that is likely to befree in some subsequent invocation of the compiler. We intend to loadthe PCH data at this address such that the data need not be relocated.The area should be able to holdsize bytes. If the host usesmmap,fd is an open file descriptor that can be used forprobing.

Host Hook:intHOST_HOOKS_GT_PCH_USE_ADDRESS(void *address, size_tsize, intfd, size_toffset)

This host hook is called when a PCH file is about to be loaded.We want to loadsize bytes fromfd atoffsetinto memory ataddress. The given address will be the result ofa previous invocation ofHOST_HOOKS_GT_PCH_GET_ADDRESS.Return −1 if we couldn’t allocatesize bytes ataddress.Return 0 if the memory is allocated but the data is not loaded. Return 1if the hook has performed everything.

If the implementation uses reserved address space, free any reservedspace beyondsize, regardless of the return value. If no PCH willbe loaded, this hook may be called withsize zero, in which caseall reserved address space should be freed.

Do not try to handle values ofaddress that could not have beenreturned by this executable; just return −1. Such values usuallyindicate an out-of-date PCH file (built by some other GCC executable),and such a PCH file won’t work.

Host Hook:size_tHOST_HOOKS_GT_PCH_ALLOC_GRANULARITY(void);

This host hook returns the alignment required for allocating virtualmemory. Usually this is the same as getpagesize, but on some hosts thealignment for reserving memory differs from the pagesize for committingmemory.


Next:Host Filesystem, Up:Host Configuration   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp