1; Processor-independent options for Darwin. 2 3; Copyright (C) 2005-2020 Free Software Foundation, Inc. 4; 5; This file is part of GCC. 6; 7; GCC is free software; you can redistribute it and/or modify it under 8; the terms of the GNU General Public License as published by the Free 9; Software Foundation; either version 3, or (at your option) any later 10; version. 11; 12; GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13; WARRANTY; without even the implied warranty of MERCHANTABILITY or 14; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15; for more details. 16; 17; You should have received a copy of the GNU General Public License 18; along with GCC; see the file COPYING3. If not see 19; <http://www.gnu.org/licenses/>. 20 21; We have a lot of Driver options, many of which are obsolete or very very 22; rarely used so, to keep this file easier to manage: 23 24; Please place all Non-driver options first (in alphabetical order), followed 25; by Driver-only options. 26 27; Non-driver options. 28 29dependency-file 30C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs) 31 32fapple-kext 33Target Report C++ Var(flag_apple_kext) 34Generate code for darwin loadable kernel extensions. 35 36iframework 37Target RejectNegative C ObjC C++ ObjC++ Joined Separate 38-iframework <dir> Add <dir> to the end of the system framework include path. 39 40mconstant-cfstrings 41Target Report Var(darwin_constant_cfstrings) Init(1) 42Generate compile-time CFString objects. 43 44Wnonportable-cfstrings 45Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning 46Warn if constant CFString objects contain non-portable characters. 47 48; Use new-style pic stubs if this is true, x86 only so far. 49matt-stubs 50Target Report Var(darwin_macho_att_stub) Init(1) 51Generate AT&T-style stubs for Mach-O. 52 53mdynamic-no-pic 54Target Common Report Mask(MACHO_DYNAMIC_NO_PIC) 55Generate code suitable for executables (NOT shared libs). 56 57mfix-and-continue 58Target Report Var(darwin_fix_and_continue) 59Generate code suitable for fast turn around debugging. 60 61mkernel 62Target Report Var(flag_mkernel) 63Generate code for the kernel or loadable kernel extensions. 64 65; The Init here is for the convenience of GCC developers, so that cc1 66; and cc1plus don't crash if no -mmacosx-version-min is passed. The 67; driver will always pass a -mmacosx-version-min, so in normal use the 68; Init is never used. 69mmacosx-version-min= 70Target RejectNegative Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION) 71The earliest macOS version on which this program will run. 72 73; Really, only relevant to PowerPC which has a 4 byte bool by default. 74mone-byte-bool 75Target RejectNegative Report Var(darwin_one_byte_bool) 76Set sizeof(bool) to 1. 77 78msymbol-stubs 79Target Report Var(darwin_symbol_stubs) Init(0) 80Force generation of external symbol indirection stubs. 81 82; Some code-gen may be improved / adjusted if the linker is sufficiently modern. 83mtarget-linker= 84Target RejectNegative Joined Report Alias(mtarget-linker) 85 86mtarget-linker 87Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION) 88-mtarget-linker <version> Specify that ld64 <version> is the toolchain linker for the current invocation. 89 90; Driver options. 91 92all_load 93Driver RejectNegative 94Load all members of archive libraries, rather than only those that satisfy undefined symbols. 95 96allowable_client 97Driver RejectNegative Separate 98-allowable_client <name> The output dylib is private to the client <name>. 99 100arch 101Driver RejectNegative Separate 102-arch <name> Generate output for architecture <name>. 103 104arch_errors_fatal 105Driver RejectNegative 106Mismatches between file architecture and one specified by \"-arch\" are errors instead of warnings. 107 108asm_macosx_version_min= 109Driver RejectNegative Joined 110The earliest macOS version on which this program will run (formatted for the assembler). 111 112bind_at_load 113Driver RejectNegative 114Generate an output executable that binds symbols on load, rather than lazily. 115 116bundle 117Driver RejectNegative 118Generate a Mach-O bundle (file type MH_BUNDLE). 119 120bundle_loader 121Driver RejectNegative Separate 122-bundle_loader <executable> Treat <executable> (that will be loading this bundle) as if it was one of the dynamic libraries the bundle is linked against for symbol resolution. 123 124client_name 125Driver RejectNegative Separate 126-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client). 127 128compatibility_version 129Driver RejectNegative Separate 130-compatibility_version <number> Set the version for the client interface. Client programs must record a value less than or equal to <number>, or the binding will fail at runtime. 131 132current_version 133Driver RejectNegative Separate 134-current_version <number> Set the current version for the library to <number>. 135 136dead_strip 137Driver RejectNegative 138Remove code and data that is unreachable from any exported symbol (including the entry point). 139 140dylib_file 141Driver RejectNegative Separate 142-dylib_file install_name:file_name This allows linking of a dylib with \"install_name\" but to be found in a different install position \"file_name\" 143 144dylinker 145Driver RejectNegative 146Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld. 147 148dylinker_install_name 149Driver RejectNegative Separate 150-dylinker_install_name <path> Only used for building dyld. 151 152dynamic 153Driver RejectNegative 154The default (and opposite of -static), implied by user mode executables, shared libraries and bundles. 155 156dynamiclib 157Driver RejectNegative 158Produce a Mach-O shared library (file type MH_DYLIB), synonym for \"-shared\". 159 160exported_symbols_list 161Driver RejectNegative Separate 162-exported_symbols_list <filename> Export global symbols in <filename> in linked output file; any symbols not mentioned will be treated as \"hidden\". 163 164filelist 165Driver RejectNegative Separate 166Supply a list of objects to be linked from a file, rather than the command line. 167 168findirect-virtual-calls 169Driver RejectNegative 170Used for generating code for some older kernel revisions. 171 172flat_namespace 173Driver RejectNegative 174Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol. 175 176force_cpusubtype_ALL 177Driver RejectNegative 178For the assembler (and linker) permit any architecture sub-variant to be used without error. 179 180force_flat_namespace 181Driver RejectNegative 182Set the output object such that, on loading, dyld will ignore any two-level namespace information and resolve symbols in the discovery order for loaded libs. 183 184framework 185Driver RejectNegative Separate 186-framework <name> The linker should search for the framework <name> in the framework search path. 187 188fterminated-vtables 189Driver RejectNegative 190Used for generating code for some older kernel revisions. 191 192gfull 193Driver RejectNegative 194Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\". 195 196gused 197Driver RejectNegative 198Abbreviation for \"-g -feliminate-unused-debug-symbols\". 199 200headerpad_max_install_names 201Driver RejectNegative 202Automatically adds space for longer path names in load commands (up to MAXPATHLEN). 203 204image_base 205Driver RejectNegative Separate 206-image_base <address> Specify <address> as the base address for a dylib or bundle. 207 208init 209Driver RejectNegative Separate 210-init <symbol_name> The symbol <symbol_name> will be used as the first initialiser for a dylib. 211 212install_name 213Driver RejectNegative Separate 214-install_name <name> Set the install name for a dylib. 215 216keep_private_externs 217Driver RejectNegative 218Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported. 219 220multi_module 221Driver RejectNegative 222(Obsolete after 10.4) Multi modules are ignored at runtime since macOS 10.4. 223 224multiply_defined 225Driver RejectNegative Separate 226(Obsolete after 10.4) -multiply_defined <treatment> Provided a mechanism for warning about symbols defined in multiple dylibs. 227 228multiply_defined_unused 229Driver RejectNegative Separate 230(Obsolete after 10.4) -multiply_defined_unused <treatment> Provided a mechanism for warning about symbols defined in the current executable also being defined in linked dylibs. 231 232no_dead_strip_inits_and_terms 233Driver RejectNegative 234(Obsolete) Current linkers never dead-strip these items, so the option is not needed. 235 236nodefaultexport 237Driver RejectNegative 238Do not add a default symbol exports to modules or dynamic libraries. 239 240nofixprebinding 241Driver RejectNegative 242(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an executable. 243 244nomultidefs 245Driver RejectNegative 246(Obsolete after 10.4) Set MH_NOMULTIDEFS in an umbrella framework. 247 248noprebind 249Driver RejectNegative Negative(prebind) 250(Obsolete) LD_PREBIND is no longer supported. 251 252noseglinkedit 253Driver RejectNegative Negative(seglinkedit) 254(Obsolete) This is the default. 255 256object 257Driver RejectNegative 258 259pagezero_size 260Driver RejectNegative Separate 261-pagezero_size <size> Allows setting the page 0 size to 4kb when required. 262 263prebind 264Driver RejectNegative Negative(noprebind) 265(Obsolete) LD_PREBIND is no longer supported. 266 267prebind_all_twolevel_modules 268Driver RejectNegative 269(Obsolete) LD_PREBIND is no longer supported. 270 271preload 272Driver RejectNegative 273Produces a Mach-O file suitable for embedded/ROM use. 274 275private_bundle 276Driver RejectNegative 277(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable. 278 279pthread 280Driver RejectNegative 281 282rdynamic 283Driver RejectNegative 284Synonym for \"-export-dynamic\" for linker versions that support it. 285 286read_only_relocs 287Driver RejectNegative Separate 288-read_only_relocs <treatment> Allow relocations in read-only pages (not recommended). 289 290sectalign 291Driver RejectNegative Separate Args(3) 292-sectalign <segname> <sectname> <value> Set section <sectname> in segment <segname> to have alignment <value> which must be an integral power of two expressed in hexadecimal form. 293 294sectcreate 295Driver RejectNegative Separate Args(3) 296-sectcreate <segname> <sectname> <file> Create section <sectname> in segment <segname> from the contents of <file>. 297 298sectobjectsymbols 299Driver RejectNegative Separate Args(2) 300(Obsolete) -sectobjectsymbols <segname> <sectname> Setting a local symbol at the start of a section is no longer supported. 301 302sectorder 303Driver RejectNegative Separate Args(3) 304(Obsolete) -sectorder <segname> <sectname> <orderfile> Replaced by a more general option \"-order_file\". 305 306seg_addr_table 307Driver RejectNegative Separate 308-seg_addr_table <file> Specify the base addresses for dynamic libraries; <file> contains a line for each library. 309 310; This is only usable by the ld_classic linker. 311seg_addr_table_filename 312Driver RejectNegative Separate 313(Obsolete, ld_classic only) -seg_addr_table_filename <path>. 314 315seg1addr 316Driver RejectNegative Separate 317Synonym for \"image_base\". 318 319segaddr 320Driver RejectNegative Separate Args(2) 321-segaddr <name> <address> Set the base address of segment <name> to <address> which must be aligned to a page boundary (currently 4kb). 322 323; This is only usable by the ld_classic linker. 324segcreate 325Driver RejectNegative Separate Args(3) 326(Obsolete, ld_classic only) -sectcreate <segname> <sectname> <file> Allowed creation of a section from a file. 327 328seglinkedit 329Driver RejectNegative Negative(noseglinkedit) 330(Obsolete) Object files with LINKEDIT sections are no longer supported. 331 332segprot 333Driver RejectNegative Separate Args(3) 334-segprot <segname> <max_prot> <init_prot> The virtual memory protections for segment <segname> have maximum and initial values <max_prot> and <init_prot> respectively. The specified values may contain \"r\", \"w\", \"x\" or \"-\" the latter meaning \"no access\". 335 336segs_read_only_addr 337Driver RejectNegative Separate 338-segs_read_only_addr <address> Specify that <address> is the base address of the read-only segments of a dylib. 339 340segs_read_write_addr 341Driver RejectNegative Separate 342-segs_read_write_addr <address> Specify that <address> is the base address address of the read-write segments of a dylib. 343 344single_module 345Driver RejectNegative 346(Obsolete) This is the default. 347 348sub_library 349Driver RejectNegative Separate 350-sub_library <name> Library named <name> will be re-exported (only useful for dylibs). 351 352sub_umbrella 353Driver RejectNegative Separate 354-sub_umbrella <name> Framework named <name> will be re-exported (only useful for dylibs). 355 356twolevel_namespace 357Driver RejectNegative 358This is the default. 359 360twolevel_namespace_hints 361Driver RejectNegative 362Add extra information to the executable that can speed up dynamic loading (provided that dependent libraries are unchanged). 363 364umbrella 365Driver RejectNegative 366-umbrella <framework> The specified framework will be re-exported. 367 368undefined 369Driver RejectNegative Separate 370-undefined <treatment> Specify the handling for undefined symbols (default is error). 371 372unexported_symbols_list 373Driver RejectNegative Separate 374-unexported_symbols_list <filename> Do not export the global symbols listed in <filename>. 375 376weak_reference_mismatches 377Driver RejectNegative Separate 378-weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak. 379 380whatsloaded 381Driver RejectNegative 382Logs which object files the linker loads. 383 384whyload 385Driver RejectNegative 386Logs which symbol(s) caused an object to be loaded. 387 388;(Obsolete, ignored) Strip symbols starting with "L", this is the default. 389X 390Driver RejectNegative 391 392y 393Driver RejectNegative Joined 394(Obsolete, ignored) Old support similar to \"-whyload\". 395 396Mach 397Driver RejectNegative 398(Obsolete and unhandled by ld64, ignored) ld should produce an executable (only handled by ld_classic). 399