gcc: Darwin Options

1 
1 3.18.10 Darwin Options
1 ----------------------
1 
1 These options are defined for all architectures running the Darwin
1 operating system.
1 
1  FSF GCC on Darwin does not create "fat" object files; it creates an
1 object file for the single architecture that GCC was built to target.
1 Apple's GCC on Darwin does create "fat" files if multiple '-arch'
1 options are used; it does so by running the compiler or linker multiple
1 times and joining the results together with 'lipo'.
1 
1  The subtype of the file created (like 'ppc7400' or 'ppc970' or 'i686')
1 is determined by the flags that specify the ISA that GCC is targeting,
1 like '-mcpu' or '-march'.  The '-force_cpusubtype_ALL' option can be
1 used to override this.
1 
1  The Darwin tools vary in their behavior when presented with an ISA
1 mismatch.  The assembler, 'as', only permits instructions to be used
1 that are valid for the subtype of the file it is generating, so you
1 cannot put 64-bit instructions in a 'ppc750' object file.  The linker
1 for shared libraries, '/usr/bin/libtool', fails and prints an error if
1 asked to create a shared library with a less restrictive subtype than
1 its input files (for instance, trying to put a 'ppc970' object file in a
1 'ppc7400' library).  The linker for executables, 'ld', quietly gives the
1 executable the most restrictive subtype of any of its input files.
1 
1 '-FDIR'
1      Add the framework directory DIR to the head of the list of
1      directories to be searched for header files.  These directories are
1      interleaved with those specified by '-I' options and are scanned in
1      a left-to-right order.
1 
1      A framework directory is a directory with frameworks in it.  A
1      framework is a directory with a 'Headers' and/or 'PrivateHeaders'
1      directory contained directly in it that ends in '.framework'.  The
1      name of a framework is the name of this directory excluding the
1      '.framework'.  Headers associated with the framework are found in
1      one of those two directories, with 'Headers' being searched first.
1      A subframework is a framework directory that is in a framework's
1      'Frameworks' directory.  Includes of subframework headers can only
1      appear in a header of a framework that contains the subframework,
1      or in a sibling subframework header.  Two subframeworks are
1      siblings if they occur in the same framework.  A subframework
1      should not have the same name as a framework; a warning is issued
1      if this is violated.  Currently a subframework cannot have
1      subframeworks; in the future, the mechanism may be extended to
1      support this.  The standard frameworks can be found in
1      '/System/Library/Frameworks' and '/Library/Frameworks'.  An example
1      include looks like '#include <Framework/header.h>', where
1      'Framework' denotes the name of the framework and 'header.h' is
1      found in the 'PrivateHeaders' or 'Headers' directory.
1 
1 '-iframeworkDIR'
1      Like '-F' except the directory is a treated as a system directory.
1      The main difference between this '-iframework' and '-F' is that
1      with '-iframework' the compiler does not warn about constructs
1      contained within header files found via DIR.  This option is valid
1      only for the C family of languages.
1 
1 '-gused'
1      Emit debugging information for symbols that are used.  For stabs
1      debugging format, this enables '-feliminate-unused-debug-symbols'.
1      This is by default ON.
1 
1 '-gfull'
1      Emit debugging information for all symbols and types.
1 
1 '-mmacosx-version-min=VERSION'
1      The earliest version of MacOS X that this executable will run on is
1      VERSION.  Typical values of VERSION include '10.1', '10.2', and
1      '10.3.9'.
1 
1      If the compiler was built to use the system's headers by default,
1      then the default for this option is the system version on which the
1      compiler is running, otherwise the default is to make choices that
1      are compatible with as many systems and code bases as possible.
1 
1 '-mkernel'
1      Enable kernel development mode.  The '-mkernel' option sets
1      '-static', '-fno-common', '-fno-use-cxa-atexit', '-fno-exceptions',
1      '-fno-non-call-exceptions', '-fapple-kext', '-fno-weak' and
1      '-fno-rtti' where applicable.  This mode also sets '-mno-altivec',
1      '-msoft-float', '-fno-builtin' and '-mlong-branch' for PowerPC
1      targets.
1 
1 '-mone-byte-bool'
1      Override the defaults for 'bool' so that 'sizeof(bool)==1'.  By
1      default 'sizeof(bool)' is '4' when compiling for Darwin/PowerPC and
1      '1' when compiling for Darwin/x86, so this option has no effect on
1      x86.
1 
1      *Warning:* The '-mone-byte-bool' switch causes GCC to generate code
1      that is not binary compatible with code generated without that
1      switch.  Using this switch may require recompiling all other
1      modules in a program, including system libraries.  Use this switch
1      to conform to a non-default data model.
1 
1 '-mfix-and-continue'
1 '-ffix-and-continue'
1 '-findirect-data'
1      Generate code suitable for fast turnaround development, such as to
1      allow GDB to dynamically load '.o' files into already-running
1      programs.  '-findirect-data' and '-ffix-and-continue' are provided
1      for backwards compatibility.
1 
1 '-all_load'
1      Loads all members of static archive libraries.  See man ld(1) for
1      more information.
1 
1 '-arch_errors_fatal'
1      Cause the errors having to do with files that have the wrong
1      architecture to be fatal.
1 
1 '-bind_at_load'
1      Causes the output file to be marked such that the dynamic linker
1      will bind all undefined references when the file is loaded or
1      launched.
1 
1 '-bundle'
1      Produce a Mach-o bundle format file.  See man ld(1) for more
1      information.
1 
1 '-bundle_loader EXECUTABLE'
1      This option specifies the EXECUTABLE that will load the build
1      output file being linked.  See man ld(1) for more information.
1 
1 '-dynamiclib'
1      When passed this option, GCC produces a dynamic library instead of
1      an executable when linking, using the Darwin 'libtool' command.
1 
1 '-force_cpusubtype_ALL'
1      This causes GCC's output file to have the 'ALL' subtype, instead of
1      one controlled by the '-mcpu' or '-march' option.
1 
1 '-allowable_client CLIENT_NAME'
1 '-client_name'
1 '-compatibility_version'
1 '-current_version'
1 '-dead_strip'
1 '-dependency-file'
1 '-dylib_file'
1 '-dylinker_install_name'
1 '-dynamic'
1 '-exported_symbols_list'
1 '-filelist'
1 '-flat_namespace'
1 '-force_flat_namespace'
1 '-headerpad_max_install_names'
1 '-image_base'
1 '-init'
1 '-install_name'
1 '-keep_private_externs'
1 '-multi_module'
1 '-multiply_defined'
1 '-multiply_defined_unused'
1 '-noall_load'
1 '-no_dead_strip_inits_and_terms'
1 '-nofixprebinding'
1 '-nomultidefs'
1 '-noprebind'
1 '-noseglinkedit'
1 '-pagezero_size'
1 '-prebind'
1 '-prebind_all_twolevel_modules'
1 '-private_bundle'
1 '-read_only_relocs'
1 '-sectalign'
1 '-sectobjectsymbols'
1 '-whyload'
1 '-seg1addr'
1 '-sectcreate'
1 '-sectobjectsymbols'
1 '-sectorder'
1 '-segaddr'
1 '-segs_read_only_addr'
1 '-segs_read_write_addr'
1 '-seg_addr_table'
1 '-seg_addr_table_filename'
1 '-seglinkedit'
1 '-segprot'
1 '-segs_read_only_addr'
1 '-segs_read_write_addr'
1 '-single_module'
1 '-static'
1 '-sub_library'
1 '-sub_umbrella'
1 '-twolevel_namespace'
1 '-umbrella'
1 '-undefined'
1 '-unexported_symbols_list'
1 '-weak_reference_mismatches'
1 '-whatsloaded'
1      These options are passed to the Darwin linker.  The Darwin linker
1      man page describes them in detail.
1