📄 tm.texi
字号:
@c Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.@c This is part of the GCC manual.@c For copying conditions, see the file gcc.texi.@ifset INTERNALS@node Target Macros@chapter Target Description Macros@cindex machine description macros@cindex target description macros@cindex macros, target description@cindex @file{tm.h} macrosIn addition to the file @file{@var{machine}.md}, a machine descriptionincludes a C header file conventionally given the name@file{@var{machine}.h}. This header file defines numerous macrosthat convey the information about the target machine that does not fitinto the scheme of the @file{.md} file. The file @file{tm.h} should bea link to @file{@var{machine}.h}. The header file @file{config.h}includes @file{tm.h} and most compiler source files include@file{config.h}.@menu* Driver:: Controlling how the driver runs the compilation passes.* Run-time Target:: Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}.* Storage Layout:: Defining sizes and alignments of data.* Type Layout:: Defining sizes and properties of basic user data types.* Registers:: Naming and describing the hardware registers.* Register Classes:: Defining the classes of hardware registers.* Stack and Calling:: Defining which way the stack grows and by how much.* Varargs:: Defining the varargs macros.* Trampolines:: Code set up at run time to enter a nested function.* Library Calls:: Controlling how library routines are implicitly called.* Addressing Modes:: Defining addressing modes valid for memory operands.* Condition Code:: Defining how insns update the condition code.* Costs:: Defining relative costs of different operations.* Sections:: Dividing storage into text, data, and other sections.* PIC:: Macros for position independent code.* Assembler Format:: Defining how to write insns and pseudo-ops to output.* Debugging Info:: Defining the format of debugging output.* Cross-compilation:: Handling floating point for cross-compilers.* Misc:: Everything else.@end menu@node Driver@section Controlling the Compilation Driver, @file{gcc}@cindex driver@cindex controlling the compilation driver@table @code@findex SWITCH_TAKES_ARG@item SWITCH_TAKES_ARG (@var{char})A C expression which determines whether the option @samp{-@var{char}}takes arguments. The value should be the number of arguments thatoption takes--zero, for many options.By default, this macro is defined to handle the standard optionsproperly. You need not define it unless you wish to add additionaloptions which take arguments.@findex WORD_SWITCH_TAKES_ARG@item WORD_SWITCH_TAKES_ARG (@var{name})A C expression which determines whether the option @samp{-@var{name}}takes arguments. The value should be the number of arguments thatoption takes--zero, for many options. This macro rather than@code{SWITCH_TAKES_ARG} is used for multi-character option names.By default, this macro is defined to handle the standard optionsproperly. You need not define it unless you wish to add additionaloptions which take arguments.@findex SWITCHES_NEED_SPACES@item SWITCHES_NEED_SPACESA string-valued C expression which is nonempty if the linker needs aspace between the @samp{-L} or @samp{-o} option and its argument.If this macro is not defined, the default value is 0.@findex CPP_SPEC@item CPP_SPECA C string constant that tells the GNU CC driver program options topass to CPP. It can also specify how to translate options yougive to GNU CC into options for GNU CC to pass to the CPP.Do not define this macro if it does not need to do anything.@findex SIGNED_CHAR_SPEC@item SIGNED_CHAR_SPECA C string constant that tells the GNU CC driver program options topass to CPP. By default, this macro is defined to pass the option@samp{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as@code{unsigned char} by @code{cc1}.Do not define this macro unless you need to override the defaultdefinition.@findex CC1_SPEC@item CC1_SPECA C string constant that tells the GNU CC driver program options topass to @code{cc1}. It can also specify how to translate options yougive to GNU CC into options for GNU CC to pass to the @code{cc1}.Do not define this macro if it does not need to do anything.@findex CC1PLUS_SPEC@item CC1PLUS_SPECA C string constant that tells the GNU CC driver program options topass to @code{cc1plus}. It can also specify how to translate options yougive to GNU CC into options for GNU CC to pass to the @code{cc1plus}.Do not define this macro if it does not need to do anything.@findex ASM_SPEC@item ASM_SPECA C string constant that tells the GNU CC driver program options topass to the assembler. It can also specify how to translate optionsyou give to GNU CC into options for GNU CC to pass to the assembler.See the file @file{sun3.h} for an example of this.Do not define this macro if it does not need to do anything.@findex ASM_FINAL_SPEC@item ASM_FINAL_SPECA C string constant that tells the GNU CC driver program how torun any programs which cleanup after the normal assembler.Normally, this is not needed. See the file @file{mips.h} foran example of this.Do not define this macro if it does not need to do anything.@findex LINK_SPEC@item LINK_SPECA C string constant that tells the GNU CC driver program options topass to the linker. It can also specify how to translate options yougive to GNU CC into options for GNU CC to pass to the linker.Do not define this macro if it does not need to do anything.@findex LIB_SPEC@item LIB_SPECAnother C string constant used much like @code{LINK_SPEC}. The differencebetween the two is that @code{LIB_SPEC} is used at the end of thecommand given to the linker.If this macro is not defined, a default is provided thatloads the standard C library from the usual place. See @file{gcc.c}.@findex STARTFILE_SPEC@item STARTFILE_SPECAnother C string constant used much like @code{LINK_SPEC}. Thedifference between the two is that @code{STARTFILE_SPEC} is used atthe very beginning of the command given to the linker.If this macro is not defined, a default is provided that loads thestandard C startup file from the usual place. See @file{gcc.c}.@findex ENDFILE_SPEC@item ENDFILE_SPECAnother C string constant used much like @code{LINK_SPEC}. Thedifference between the two is that @code{ENDFILE_SPEC} is used atthe very end of the command given to the linker.Do not define this macro if it does not need to do anything.@findex LINK_LIBGCC_SPECIAL@item LINK_LIBGCC_SPECIALDefine this macro meaning that @code{gcc} should find thelibrary @file{libgcc.a} by hand, rather than passing the argument@samp{-lgcc} to tell the linker to do the search.@findex RELATIVE_PREFIX_NOT_LINKDIR@item RELATIVE_PREFIX_NOT_LINKDIRDefine this macro to tell @code{gcc} that it should only translatea @samp{-B} prefix into a @samp{-L} linker option if the prefixindicates an absolute file name.@findex STANDARD_EXEC_PREFIX@item STANDARD_EXEC_PREFIXDefine this macro as a C string constant if you wish to override thestandard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix totry when searching for the executable files of the compiler.@findex MD_EXEC_PREFIX@item MD_EXEC_PREFIXIf defined, this macro is an additional prefix to try after@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searchedwhen the @samp{-b} option is used, or the compiler is built as a crosscompiler.@findex STANDARD_STARTFILE_PREFIX@item STANDARD_STARTFILE_PREFIXDefine this macro as a C string constant if you wish to override thestandard choice of @file{/usr/local/lib/} as the default prefix totry when searching for startup files such as @file{crt0.o}.@findex MD_STARTFILE_PREFIX@item MD_STARTFILE_PREFIXIf defined, this macro supplies an additional prefix to try after thestandard prefixes. @code{MD_EXEC_PREFIX} is not searched when the@samp{-b} option is used, or when the compiler is built as a crosscompiler.@findex MD_STARTFILE_PREFIX_1@item MD_STARTFILE_PREFIX_1If defined, this macro supplies yet another prefix to try after thestandard prefixes. It is not searched when the @samp{-b} option isused, or when the compiler is built as a cross compiler.@findex LOCAL_INCLUDE_DIR@item LOCAL_INCLUDE_DIRDefine this macro as a C string constant if you wish to override thestandard choice of @file{/usr/local/include} as the default prefix totry when searching for local header files. @code{LOCAL_INCLUDE_DIR}comes before @code{SYSTEM_INCLUDE_DIR} in the search order.Cross compilers do not use this macro and do not search either@file{/usr/local/include} or its replacement.@findex SYSTEM_INCLUDE_DIR@item SYSTEM_INCLUDE_DIRDefine this macro as a C string constant if you wish to specify asystem-specific directory to search for header files before the standarddirectory. @code{SYSTEM_INCLUDE_DIR} comes before@code{STANDARD_INCLUDE_DIR} in the search order.Cross compilers do not use this macro and do not search the directoryspecified.@findex STANDARD_INCLUDE_DIR@item STANDARD_INCLUDE_DIRDefine this macro as a C string constant if you wish to override thestandard choice of @file{/usr/include} as the default prefix totry when searching for header files.Cross compilers do not use this macro and do not search either@file{/usr/include} or its replacement.@findex INCLUDE_DEFAULTS@item INCLUDE_DEFAULTSDefine this macro if you wish to override the entire default search pathfor include files. The default search path includes@code{GPLUSPLUS_INCLUDE_DIR}, @code{GCC_INCLUDE_DIR},@code{LOCAL_INCLUDE_DIR}, @code{SYSTEM_INCLUDE_DIR}, and@code{STANDARD_INCLUDE_DIR}. In addition, the macros@code{GPLUSPLUS_INCLUDE_DIR} and @code{GCC_INCLUDE_DIR} are definedautomatically by @file{Makefile}, and specify private search areas forGCC. The directory @code{GPLUSPLUS_INCLUDE_DIR} is used only for C++programs.The definition should be an initializer for an array of structures.Each array element should have two elements: the directory name (astring constant) and a flag for C++-only directories. Mark the end ofthe array with a null element. For example, here is the definition usedfor VMS:@example#define INCLUDE_DEFAULTS \@{ \ @{ "GNU_GXX_INCLUDE:", 1@}, \ @{ "GNU_CC_INCLUDE:", 0@}, \ @{ "SYS$SYSROOT:[SYSLIB.]", 0@}, \ @{ ".", 0@}, \ @{ 0, 0@} \@}@end example@end tableHere is the order of prefixes tried for exec files:@enumerate@itemAny prefixes specified by the user with @samp{-B}.@itemThe environment variable @code{GCC_EXEC_PREFIX}, if any.@itemThe directories specified by the environment variable @code{COMPILER_PATH}.@itemThe macro @code{STANDARD_EXEC_PREFIX}.@item@file{/usr/lib/gcc/}.@itemThe macro @code{MD_EXEC_PREFIX}, if any.@end enumerateHere is the order of prefixes tried for startfiles:@enumerate@itemAny prefixes specified by the user with @samp{-B}.@itemThe environment variable @code{GCC_EXEC_PREFIX}, if any.@itemThe directories specified by the environment variable @code{LIBRARY_PATH}.@itemThe macro @code{STANDARD_EXEC_PREFIX}.@item@file{/usr/lib/gcc/}.@itemThe macro @code{MD_EXEC_PREFIX}, if any.@itemThe macro @code{MD_STARTFILE_PREFIX}, if any.@itemThe macro @code{STANDARD_STARTFILE_PREFIX}.@item@file{/lib/}.@item@file{/usr/lib/}.@end enumerate@node Run-time Target@section Run-time Target Specification@cindex run-time target specification@cindex predefined macros@cindex target specifications
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -