gccint: Driver

1 
1 18.2 Controlling the Compilation Driver, 'gcc'
1 ==============================================
1 
1 You can control the compilation driver.
1 
1  -- Macro: DRIVER_SELF_SPECS
1      A list of specs for the driver itself.  It should be a suitable
1      initializer for an array of strings, with no surrounding braces.
1 
1      The driver applies these specs to its own command line between
1      loading default 'specs' files (but not command-line specified ones)
1      and choosing the multilib directory or running any subcommands.  It
1      applies them in the order given, so each spec can depend on the
1      options added by earlier ones.  It is also possible to remove
1      options using '%<OPTION' in the usual way.
1 
1      This macro can be useful when a port has several interdependent
1      target options.  It provides a way of standardizing the command
1      line so that the other specs are easier to write.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: OPTION_DEFAULT_SPECS
1      A list of specs used to support configure-time default options
1      (i.e. '--with' options) in the driver.  It should be a suitable
1      initializer for an array of structures, each containing two
1      strings, without the outermost pair of surrounding braces.
1 
1      The first item in the pair is the name of the default.  This must
1      match the code in 'config.gcc' for the target.  The second item is
1      a spec to apply if a default with this name was specified.  The
1      string '%(VALUE)' in the spec will be replaced by the value of the
1      default everywhere it occurs.
1 
1      The driver will apply these specs to its own command line between
1      loading default 'specs' files and processing 'DRIVER_SELF_SPECS',
1      using the same mechanism as 'DRIVER_SELF_SPECS'.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: CPP_SPEC
1      A C string constant that tells the GCC driver program options to
1      pass to CPP.  It can also specify how to translate options you give
1      to GCC into options for GCC to pass to the CPP.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: CPLUSPLUS_CPP_SPEC
1      This macro is just like 'CPP_SPEC', but is used for C++, rather
1      than C.  If you do not define this macro, then the value of
1      'CPP_SPEC' (if any) will be used instead.
1 
1  -- Macro: CC1_SPEC
1      A C string constant that tells the GCC driver program options to
1      pass to 'cc1', 'cc1plus', 'f771', and the other language front
1      ends.  It can also specify how to translate options you give to GCC
1      into options for GCC to pass to front ends.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: CC1PLUS_SPEC
1      A C string constant that tells the GCC driver program options to
1      pass to 'cc1plus'.  It can also specify how to translate options
1      you give to GCC into options for GCC to pass to the 'cc1plus'.
1 
1      Do not define this macro if it does not need to do anything.  Note
1      that everything defined in CC1_SPEC is already passed to 'cc1plus'
1      so there is no need to duplicate the contents of CC1_SPEC in
1      CC1PLUS_SPEC.
1 
1  -- Macro: ASM_SPEC
1      A C string constant that tells the GCC driver program options to
1      pass to the assembler.  It can also specify how to translate
1      options you give to GCC into options for GCC to pass to the
1      assembler.  See the file 'sun3.h' for an example of this.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: ASM_FINAL_SPEC
1      A C string constant that tells the GCC driver program how to run
1      any programs which cleanup after the normal assembler.  Normally,
1      this is not needed.  See the file 'mips.h' for an example of this.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: AS_NEEDS_DASH_FOR_PIPED_INPUT
1      Define this macro, with no value, if the driver should give the
1      assembler an argument consisting of a single dash, '-', to instruct
1      it to read from its standard input (which will be a pipe connected
1      to the output of the compiler proper).  This argument is given
1      after any '-o' option specifying the name of the output file.
1 
1      If you do not define this macro, the assembler is assumed to read
1      its standard input if given no non-option arguments.  If your
1      assembler cannot read standard input at all, use a '%{pipe:%e}'
1      construct; see 'mips.h' for instance.
1 
1  -- Macro: LINK_SPEC
1      A C string constant that tells the GCC driver program options to
1      pass to the linker.  It can also specify how to translate options
1      you give to GCC into options for GCC to pass to the linker.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: LIB_SPEC
1      Another C string constant used much like 'LINK_SPEC'.  The
1      difference between the two is that 'LIB_SPEC' is used at the end of
1      the command given to the linker.
1 
1      If this macro is not defined, a default is provided that loads the
1      standard C library from the usual place.  See 'gcc.c'.
1 
1  -- Macro: LIBGCC_SPEC
1      Another C string constant that tells the GCC driver program how and
1      when to place a reference to 'libgcc.a' into the linker command
1      line.  This constant is placed both before and after the value of
1      'LIB_SPEC'.
1 
1      If this macro is not defined, the GCC driver provides a default
1      that passes the string '-lgcc' to the linker.
1 
1  -- Macro: REAL_LIBGCC_SPEC
1      By default, if 'ENABLE_SHARED_LIBGCC' is defined, the 'LIBGCC_SPEC'
1      is not directly used by the driver program but is instead modified
1      to refer to different versions of 'libgcc.a' depending on the
1      values of the command line flags '-static', '-shared',
1      '-static-libgcc', and '-shared-libgcc'.  On targets where these
1      modifications are inappropriate, define 'REAL_LIBGCC_SPEC' instead.
1      'REAL_LIBGCC_SPEC' tells the driver how to place a reference to
1      'libgcc' on the link command line, but, unlike 'LIBGCC_SPEC', it is
1      used unmodified.
1 
1  -- Macro: USE_LD_AS_NEEDED
1      A macro that controls the modifications to 'LIBGCC_SPEC' mentioned
1      in 'REAL_LIBGCC_SPEC'.  If nonzero, a spec will be generated that
1      uses '--as-needed' or equivalent options and the shared 'libgcc' in
1      place of the static exception handler library, when linking without
1      any of '-static', '-static-libgcc', or '-shared-libgcc'.
1 
1  -- Macro: LINK_EH_SPEC
1      If defined, this C string constant is added to 'LINK_SPEC'.  When
1      'USE_LD_AS_NEEDED' is zero or undefined, it also affects the
1      modifications to 'LIBGCC_SPEC' mentioned in 'REAL_LIBGCC_SPEC'.
1 
1  -- Macro: STARTFILE_SPEC
1      Another C string constant used much like 'LINK_SPEC'.  The
1      difference between the two is that 'STARTFILE_SPEC' is used at the
1      very beginning of the command given to the linker.
1 
1      If this macro is not defined, a default is provided that loads the
1      standard C startup file from the usual place.  See 'gcc.c'.
1 
1  -- Macro: ENDFILE_SPEC
1      Another C string constant used much like 'LINK_SPEC'.  The
1      difference between the two is that 'ENDFILE_SPEC' is used at the
1      very end of the command given to the linker.
1 
1      Do not define this macro if it does not need to do anything.
1 
1  -- Macro: THREAD_MODEL_SPEC
1      GCC '-v' will print the thread model GCC was configured to use.
1      However, this doesn't work on platforms that are multilibbed on
1      thread models, such as AIX 4.3.  On such platforms, define
1      'THREAD_MODEL_SPEC' such that it evaluates to a string without
1      blanks that names one of the recognized thread models.  '%*', the
1      default value of this macro, will expand to the value of
1      'thread_file' set in 'config.gcc'.
1 
1  -- Macro: SYSROOT_SUFFIX_SPEC
1      Define this macro to add a suffix to the target sysroot when GCC is
1      configured with a sysroot.  This will cause GCC to search for
1      usr/lib, et al, within sysroot+suffix.
1 
1  -- Macro: SYSROOT_HEADERS_SUFFIX_SPEC
1      Define this macro to add a headers_suffix to the target sysroot
1      when GCC is configured with a sysroot.  This will cause GCC to pass
1      the updated sysroot+headers_suffix to CPP, causing it to search for
1      usr/include, et al, within sysroot+headers_suffix.
1 
1  -- Macro: EXTRA_SPECS
1      Define this macro to provide additional specifications to put in
1      the 'specs' file that can be used in various specifications like
1      'CC1_SPEC'.
1 
1      The definition should be an initializer for an array of structures,
1      containing a string constant, that defines the specification name,
1      and a string constant that provides the specification.
1 
1      Do not define this macro if it does not need to do anything.
1 
1      'EXTRA_SPECS' is useful when an architecture contains several
1      related targets, which have various '..._SPECS' which are similar
1      to each other, and the maintainer would like one central place to
1      keep these definitions.
1 
1      For example, the PowerPC System V.4 targets use 'EXTRA_SPECS' to
1      define either '_CALL_SYSV' when the System V calling sequence is
1      used or '_CALL_AIX' when the older AIX-based calling sequence is
1      used.
1 
1      The 'config/rs6000/rs6000.h' target file defines:
1 
1           #define EXTRA_SPECS \
1             { "cpp_sysv_default", CPP_SYSV_DEFAULT },
1 
1           #define CPP_SYS_DEFAULT ""
1 
1      The 'config/rs6000/sysv.h' target file defines:
1           #undef CPP_SPEC
1           #define CPP_SPEC \
1           "%{posix: -D_POSIX_SOURCE } \
1           %{mcall-sysv: -D_CALL_SYSV } \
1           %{!mcall-sysv: %(cpp_sysv_default) } \
1           %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
1 
1           #undef CPP_SYSV_DEFAULT
1           #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
1 
1      while the 'config/rs6000/eabiaix.h' target file defines
1      'CPP_SYSV_DEFAULT' as:
1 
1           #undef CPP_SYSV_DEFAULT
1           #define CPP_SYSV_DEFAULT "-D_CALL_AIX"
1 
1  -- Macro: LINK_LIBGCC_SPECIAL_1
1      Define this macro if the driver program should find the library
1      'libgcc.a'.  If you do not define this macro, the driver program
1      will pass the argument '-lgcc' to tell the linker to do the search.
1 
1  -- Macro: LINK_GCC_C_SEQUENCE_SPEC
1      The sequence in which libgcc and libc are specified to the linker.
1      By default this is '%G %L %G'.
1 
1  -- Macro: POST_LINK_SPEC
1      Define this macro to add additional steps to be executed after
1      linker.  The default value of this macro is empty string.
1 
1  -- Macro: LINK_COMMAND_SPEC
1      A C string constant giving the complete command line need to
1      execute the linker.  When you do this, you will need to update your
1      port each time a change is made to the link command line within
1      'gcc.c'.  Therefore, define this macro only if you need to
1      completely redefine the command line for invoking the linker and
1      there is no other way to accomplish the effect you need.
1      Overriding this macro may be avoidable by overriding
1      'LINK_GCC_C_SEQUENCE_SPEC' instead.
1 
1  -- Common Target Hook: bool TARGET_ALWAYS_STRIP_DOTDOT
1      True if '..' components should always be removed from directory
1      names computed relative to GCC's internal directories, false
1      (default) if such components should be preserved and directory
1      names containing them passed to other tools such as the linker.
1 
1  -- Macro: MULTILIB_DEFAULTS
1      Define this macro as a C expression for the initializer of an array
1      of string to tell the driver program which options are defaults for
1      this target and thus do not need to be handled specially when using
1      'MULTILIB_OPTIONS'.
1 
1      Do not define this macro if 'MULTILIB_OPTIONS' is not defined in
1      the target makefile fragment or if none of the options listed in
1      'MULTILIB_OPTIONS' are set by default.  ⇒Target Fragment.
1 
1  -- Macro: RELATIVE_PREFIX_NOT_LINKDIR
1      Define this macro to tell 'gcc' that it should only translate a
1      '-B' prefix into a '-L' linker option if the prefix indicates an
1      absolute file name.
1 
1  -- Macro: MD_EXEC_PREFIX
1      If defined, this macro is an additional prefix to try after
1      'STANDARD_EXEC_PREFIX'.  'MD_EXEC_PREFIX' is not searched when the
1      compiler is built as a cross compiler.  If you define
1      'MD_EXEC_PREFIX', then be sure to add it to the list of directories
1      used to find the assembler in 'configure.ac'.
1 
1  -- Macro: STANDARD_STARTFILE_PREFIX
1      Define this macro as a C string constant if you wish to override
1      the standard choice of 'libdir' as the default prefix to try when
1      searching for startup files such as 'crt0.o'.
1      'STANDARD_STARTFILE_PREFIX' is not searched when the compiler is
1      built as a cross compiler.
1 
1  -- Macro: STANDARD_STARTFILE_PREFIX_1
1      Define this macro as a C string constant if you wish to override
1      the standard choice of '/lib' as a prefix to try after the default
1      prefix when searching for startup files such as 'crt0.o'.
1      'STANDARD_STARTFILE_PREFIX_1' is not searched when the compiler is
1      built as a cross compiler.
1 
1  -- Macro: STANDARD_STARTFILE_PREFIX_2
1      Define this macro as a C string constant if you wish to override
1      the standard choice of '/lib' as yet another prefix to try after
1      the default prefix when searching for startup files such as
1      'crt0.o'.  'STANDARD_STARTFILE_PREFIX_2' is not searched when the
1      compiler is built as a cross compiler.
1 
1  -- Macro: MD_STARTFILE_PREFIX
1      If defined, this macro supplies an additional prefix to try after
1      the standard prefixes.  'MD_EXEC_PREFIX' is not searched when the
1      compiler is built as a cross compiler.
1 
1  -- Macro: MD_STARTFILE_PREFIX_1
1      If defined, this macro supplies yet another prefix to try after the
1      standard prefixes.  It is not searched when the compiler is built
1      as a cross compiler.
1 
1  -- Macro: INIT_ENVIRONMENT
1      Define this macro as a C string constant if you wish to set
1      environment variables for programs called by the driver, such as
1      the assembler and loader.  The driver passes the value of this
1      macro to 'putenv' to initialize the necessary environment
1      variables.
1 
1  -- Macro: LOCAL_INCLUDE_DIR
1      Define this macro as a C string constant if you wish to override
1      the standard choice of '/usr/local/include' as the default prefix
1      to try when searching for local header files.  'LOCAL_INCLUDE_DIR'
1      comes before 'NATIVE_SYSTEM_HEADER_DIR' (set in 'config.gcc',
1      normally '/usr/include') in the search order.
1 
1      Cross compilers do not search either '/usr/local/include' or its
1      replacement.
1 
1  -- Macro: NATIVE_SYSTEM_HEADER_COMPONENT
1      The "component" corresponding to 'NATIVE_SYSTEM_HEADER_DIR'.  See
1      'INCLUDE_DEFAULTS', below, for the description of components.  If
1      you do not define this macro, no component is used.
1 
1  -- Macro: INCLUDE_DEFAULTS
1      Define this macro if you wish to override the entire default search
1      path for include files.  For a native compiler, the default search
1      path usually consists of 'GCC_INCLUDE_DIR', 'LOCAL_INCLUDE_DIR',
1      'GPLUSPLUS_INCLUDE_DIR', and 'NATIVE_SYSTEM_HEADER_DIR'.  In
1      addition, 'GPLUSPLUS_INCLUDE_DIR' and 'GCC_INCLUDE_DIR' are defined
1      automatically by 'Makefile', and specify private search areas for
1      GCC.  The directory 'GPLUSPLUS_INCLUDE_DIR' is used only for C++
1      programs.
1 
1      The definition should be an initializer for an array of structures.
1      Each array element should have four elements: the directory name (a
1      string constant), the component name (also a string constant), a
1      flag for C++-only directories, and a flag showing that the includes
1      in the directory don't need to be wrapped in 'extern 'C'' when
1      compiling C++.  Mark the end of the array with a null element.
1 
1      The component name denotes what GNU package the include file is
1      part of, if any, in all uppercase letters.  For example, it might
1      be 'GCC' or 'BINUTILS'.  If the package is part of a
1      vendor-supplied operating system, code the component name as '0'.
1 
1      For example, here is the definition used for VAX/VMS:
1 
1           #define INCLUDE_DEFAULTS \
1           {                                       \
1             { "GNU_GXX_INCLUDE:", "G++", 1, 1},   \
1             { "GNU_CC_INCLUDE:", "GCC", 0, 0},    \
1             { "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0},  \
1             { ".", 0, 0, 0},                      \
1             { 0, 0, 0, 0}                         \
1           }
1 
1  Here is the order of prefixes tried for exec files:
1 
1   1. Any prefixes specified by the user with '-B'.
1 
1   2. The environment variable 'GCC_EXEC_PREFIX' or, if 'GCC_EXEC_PREFIX'
1      is not set and the compiler has not been installed in the
1      configure-time PREFIX, the location in which the compiler has
1      actually been installed.
1 
1   3. The directories specified by the environment variable
1      'COMPILER_PATH'.
1 
1   4. The macro 'STANDARD_EXEC_PREFIX', if the compiler has been
1      installed in the configured-time PREFIX.
1 
1   5. The location '/usr/libexec/gcc/', but only if this is a native
1      compiler.
1 
1   6. The location '/usr/lib/gcc/', but only if this is a native
1      compiler.
1 
1   7. The macro 'MD_EXEC_PREFIX', if defined, but only if this is a
1      native compiler.
1 
1  Here is the order of prefixes tried for startfiles:
1 
1   1. Any prefixes specified by the user with '-B'.
1 
1   2. The environment variable 'GCC_EXEC_PREFIX' or its automatically
1      determined value based on the installed toolchain location.
1 
1   3. The directories specified by the environment variable
1      'LIBRARY_PATH' (or port-specific name; native only, cross compilers
1      do not use this).
1 
1   4. The macro 'STANDARD_EXEC_PREFIX', but only if the toolchain is
1      installed in the configured PREFIX or this is a native compiler.
1 
1   5. The location '/usr/lib/gcc/', but only if this is a native
1      compiler.
1 
1   6. The macro 'MD_EXEC_PREFIX', if defined, but only if this is a
1      native compiler.
1 
1   7. The macro 'MD_STARTFILE_PREFIX', if defined, but only if this is a
1      native compiler, or we have a target system root.
1 
1   8. The macro 'MD_STARTFILE_PREFIX_1', if defined, but only if this is
1      a native compiler, or we have a target system root.
1 
1   9. The macro 'STANDARD_STARTFILE_PREFIX', with any sysroot
1      modifications.  If this path is relative it will be prefixed by
1      'GCC_EXEC_PREFIX' and the machine suffix or 'STANDARD_EXEC_PREFIX'
1      and the machine suffix.
1 
1   10. The macro 'STANDARD_STARTFILE_PREFIX_1', but only if this is a
1      native compiler, or we have a target system root.  The default for
1      this macro is '/lib/'.
1 
1   11. The macro 'STANDARD_STARTFILE_PREFIX_2', but only if this is a
1      native compiler, or we have a target system root.  The default for
1      this macro is '/usr/lib/'.
1