Next:DEC Alpha Options, Previous:Cygwin and MinGW Options, Up:Machine-Dependent Options [Contents][Index]
These options are defined for all architectures running the Darwin operatingsystem.
FSF GCC on Darwin does not create “fat” object files; it createsan object file for the single architecture that GCC was built totarget. Apple’s GCC on Darwin does create “fat” files if multiple-arch options are used; it does so by running the compiler orlinker multiple times and joining the results together withlipo.
The subtype of the file created (like ‘ppc7400’ or ‘ppc970’ or‘i686’) is determined by the flags that specify the ISAthat GCC is targeting, like-mcpu or-march. The-force_cpusubtype_ALL option can be used to override this.
The Darwin tools vary in their behavior when presented with an ISAmismatch. The assembler,as, only permits instructions tobe used that are valid for the subtype of the file it is generating,so you cannot put 64-bit instructions in a ‘ppc750’ object file.The linker for shared libraries,/usr/bin/libtool, failsand prints an error if asked to create a shared library with a lessrestrictive subtype than its input files (for instance, trying to puta ‘ppc970’ object file in a ‘ppc7400’ library). The linkerfor executables,ld, quietly gives the executable the mostrestrictive subtype of any of its input files.
-Fdir ¶Add the framework directorydir to the head of the list ofdirectories to be searched for header files. These directories areinterleaved with those specified by-I options and arescanned in a left-to-right order.
A framework directory is a directory with frameworks in it. Aframework is a directory with aHeaders and/orPrivateHeaders directory contained directly in it that endsin.framework. The name of a framework is the name of thisdirectory excluding the.framework. Headers associated withthe framework are found in one of those two directories, withHeaders being searched first. A subframework is a frameworkdirectory that is in a framework’sFrameworks directory.Includes of subframework headers can only appear in a header of aframework that contains the subframework, or in a sibling subframeworkheader. Two subframeworks are siblings if they occur in the sameframework. A subframework should not have the same name as aframework; a warning is issued if this is violated. Currently asubframework cannot have subframeworks; in the future, the mechanismmay be extended to support this. The standard frameworks can be foundin/System/Library/Frameworks and/Library/Frameworks. An example include looks like#include <Framework/header.h>, whereFramework denotesthe name of the framework andheader.h is found in thePrivateHeaders orHeaders directory.
-iframeworkdir ¶Like-F except the directory is a treated as a systemdirectory. The main difference between this-iframework and-F is that with-iframework the compiler does notwarn about constructs contained within header files found viadir. This option is valid only for the C family of languages.
-archname ¶Generate output for architecturename. As described above, GCCgenerates output for the architecture it was configured for, using itsusual options to select subarchitecture variants. The-archoption is accepted for compatibility, but an error is diagnosed ifname is inconsistent with GCC’s own idea of the target architecture.
-dependency-filefilename ¶Alias for the preprocessor option-MFfilename.SeeOptions Controlling the Preprocessor.
-fapple-kext ¶Generate code for Darwin loadable kernel extensions.
-gused ¶Emit debugging information for symbols that are used. For stabsdebugging format, this enables-feliminate-unused-debug-symbols.This is by default ON.
-gfull ¶Emit debugging information for all symbols and types.
-matt-stubs ¶-mno-att-stubsEnable AT&T-style PIC stubs. This is the default when supported bythe target architecture (currently x86 only).
-mconstant-cfstrings ¶-fconstant-cfstringsWhen the NeXT runtime is being used (the default on these systems), overrideany-fconstant-string-class setting and cause@"…"literals to be laid out as constant CoreFoundation strings.
-fconstant-cfstrings is an alias for-mconstant-cfstrings.
-mdynamic-no-pic ¶Generate code suitable for executables (not shared libraries). Thisoption is incompatible with-fpic,-fPIC,-fpie,or-fPIE.
-mfix-and-continue ¶-ffix-and-continue-findirect-dataGenerate code suitable for fast turnaround development, such as toallow GDB to dynamically load.o files into already-runningprograms.-findirect-data and-ffix-and-continueare provided for backwards compatibility.
-mkernel ¶Enable kernel development mode. The-mkernel option sets-static,-fno-common,-fno-use-cxa-atexit,-fno-exceptions,-fno-non-call-exceptions,-fapple-kext,-fno-weak and-fno-rtti whereapplicable. This mode also sets-mno-altivec,-msoft-float,-fno-builtin and-mlong-branch for PowerPC targets.
-mmacosx-version-min=version ¶-asm_macosx_version_min=versionThe-mmacosx-version-min option specifiesthe earliest version of MacOS X that this executable will run on isversion. Typical values supported forversion include12,10.12, and10.5.8.
If the compiler was built to use the system’s headers by default,then the default for this option is the system version on which thecompiler is running, otherwise the default is to make choices thatare compatible with as many systems and code bases as possible.
-asm_macosx_version_min=version is similar, but the GCCdriver passes itsversion information only to the assembler.
-mone-byte-bool ¶Override the defaults forbool so thatsizeof(bool)==1.By defaultsizeof(bool) is4 when compiling forDarwin/PowerPC and1 when compiling for Darwin/x86, so thisoption has no effect on x86.
Warning: The-mone-byte-bool switch causes GCCto generate code that is not binary compatible with code generatedwithout that switch. Using this switch may require recompiling allother modules in a program, including system libraries. Use thisswitch to conform to a non-default data model.
-msymbol-stubs ¶-mno-symbol-stubsForce generation of external symbol indirection stubs for PIC references.By default, this option is enabled automatically if the target linkerversion (-mtarget-linker) is old enough to require them.
-mtarget-linker=version ¶-mtarget-linkerversionSpecify the targetld64 version, overriding any version specifiedin the GCC configuration. Newer linker versions support improved codegeneration in some cases, for example for PIC code.
-ObjC ¶Equivalent to ‘-x objective-c’; specifies that the input isis Objective-C source code.
-ObjC++ ¶Equivalent to ‘-x objective-c++’; specifies that the input isis Objective-C++ source code.
-Wnonportable-cfstrings ¶-Wno-nonportable-cfstringsWarn if constant CoreFoundation string objects contain non-portablecharacters. This warning is enabled by default.
-all_load ¶Loads all members of static archive libraries.See man ld(1) for more information.
-arch_errors_fatal ¶Cause the errors having to do with files that have the wrong architectureto be fatal.
-bind_at_load ¶Causes the output file to be marked such that the dynamic linker willbind all undefined references when the file is loaded or launched.
-bundle ¶Produce a Mach-o bundle format file.See man ld(1) for more information.
-bundle_loaderexecutable ¶This option specifies theexecutable that will load the buildoutput file being linked. See man ld(1) for more information.
-dynamiclib ¶When passed this option, GCC produces a dynamic library instead ofan executable when linking, using the Darwinlibtool command.
-force_cpusubtype_ALL ¶This causes GCC’s output file to have the ‘ALL’ subtype, instead ofone controlled by the-mcpu or-march option.
-nodefaultrpaths ¶Do not add default run paths for the compiler library directories toexecutables, modules or dynamic libraries. On macOS 10.5 and later,the embedded runpath is added by default unless the user adds-nodefaultrpaths to the link line. Run paths are needed(and therefore enforced) to build on macOS version 10.11 or later.
-nodefaultexport ¶Do not add default symbol exports to modules or dynamic libraries.
-allowable_clientclient_name ¶-client_name-compatibility_version-current_version-dead_strip-dylib_file-dylinker-dylinker_install_name-dynamic-exported_symbols_list-filelist-flat_namespace-force_flat_namespace-framework-headerpad_max_install_names-image_base-initsymbol-name-install_name-keep_private_externs-pagezero_size-preload-read_only_relocs-sectalign-sectcreate-seg_addr_table-seg1addr-segaddr-segprot-segs_read_only_addr-segs_read_write_addr-sub_library-sub_umbrella-twolevel_namespace-twolevel_namespace_hints-umbrella-undefined-unexported_symbols_list-weak_framework-weak_reference_mismatches-whatsloaded-whyloadThese options are passed to the Darwin linker. The Darwin linker man pagedescribes them in detail.
Next:DEC Alpha Options, Previous:Cygwin and MinGW Options, Up:Machine-Dependent Options [Contents][Index]