diff --git a/zircon/docs/gen/build_arguments.md b/zircon/docs/gen/build_arguments.md index 3ea595b82498ceeb820812d382da2043e32ed563..0a559b1f313d4705a7857059df71b22c9909f424 100644 --- a/zircon/docs/gen/build_arguments.md +++ b/zircon/docs/gen/build_arguments.md @@ -2,60 +2,23 @@ ## All builds -### toolchain -*This must never be set as a build argument.* -It exists only to be set via c_toolchain(). -See environment() for more information. - -**Current value (from the default):** -``` -{ - configs = [] - environment = "stub" - globals = { } - label = "//public/gn/toolchain:stub" -} -``` - -From //public/gn/BUILDCONFIG.gn:20 - -### asan_default_options -Default [AddressSanitizer](https://llvm.org/docs/AddressSanitizer.html) -options (before the `ASAN_OPTIONS` environment variable is read at -runtime). This can be set as a build argument to affect most "asan" -variants in $variants (which see), or overridden in $toolchain_args in -one of those variants. Note that setting this nonempty may conflict -with programs that define their own `__asan_default_options` C -function. - -**Current value (from the default):** `""` - -From //public/gn/config/instrumentation/BUILD.gn:13 - -### current_os - -**Current value (from the default):** `""` - -### detailed_scheduler_tracing -Enable detailed scheduler traces. - -**Current value (from the default):** `false` - -From //kernel/params.gni:41 - -### enable_fair_scheduler -Enable fair scheduler by default on all architectures. +### use_prebuilt_gcc +If $gcc_tool_dir is "", then this controls how the GCC toolchain +binaries are found. If true, the standard prebuilt is used. If false, +the tools are just expected to be found in PATH. **Current value (from the default):** `true` -From //kernel/params.gni:38 +From //public/gn/toolchain/gcc.gni:9 -### use_goma -Set to true to enable distributed compilation using Goma. +### assert_level +* 0 means no assertions, not even standard C `assert()`. +* 1 means `ZX_ASSERT` but not `ZX_DEBUG_ASSERT`. +* 2 means both `ZX_ASSERT` and `ZX_DEBUG_ASSERT`. -**Current value (from the default):** `false` +**Current value (from the default):** `2` -From //public/gn/toolchain/goma.gni:9 +From //public/gn/config/levels.gni:9 ### clang_tool_dir Directory where the Clang toolchain binaries ("clang", "llvm-nm", etc.) are @@ -66,64 +29,16 @@ This toolchain is expected to support both Fuchsia targets and the host. From //public/gn/toolchain/clang.gni:14 -### enable_acpi_debug -Enable debug output in the ACPI library (used by the ACPI bus driver). - -**Current value (from the default):** `false` - -From //third_party/lib/acpica/BUILD.gn:9 - -### malloc - -**Current value (from the default):** `"scudo"` - -From //third_party/ulib/musl/BUILD.gn:6 - -### tests_in_image -Whether to include all the Zircon tests in the main standalone ZBI. -TODO(mcgrathr): This will be replaced by a more sophisticated plan for -what images to build rather than a single "everything" image that needs -to be pared down. - -**Current value (from the default):** `true` - -From //BUILD.gn:16 - -### opt_level -* -1 means really unoptimized (-O0), usually only build-tested and not run. -* 0 means "optimized for debugging" (-Og), light enough to avoid confusion. - 1, 2, and 3 are increasing levels of optimization. -* 4 is optimized for space rather than purely for speed. - -**Current value (from the default):** `2` - -From //public/gn/config/levels.gni:15 - -### smp_max_clusters - -**Current value (from the default):** `2` - -From //kernel/params.gni:13 - -### smp_max_cpus -Maximum number of CPUs the kernel will run on (others will be ignored). - -**Current value (from the default):** `32` - -From //kernel/params.gni:7 - -### target_cpu +### current_os **Current value (from the default):** `""` -### use_prebuilt_gcc -If $gcc_tool_dir is "", then this controls how the GCC toolchain -binaries are found. If true, the standard prebuilt is used. If false, -the tools are just expected to be found in PATH. +### enable_fair_scheduler +Enable fair scheduler by default on all architectures. **Current value (from the default):** `true` -From //public/gn/toolchain/gcc.gni:9 +From //kernel/params.gni:38 ### kernel_aspace_base @@ -131,59 +46,28 @@ From //public/gn/toolchain/gcc.gni:9 From //kernel/params.gni:31 -### kernel_version_string -Version string embedded in the kernel for `zx_system_get_version`. -If set to the default "", a string is generated based on the -Zircon git revision of the checkout. +### kernel_base -**Current value (from the default):** `""` +**Current value (from the default):** `"0xffffffff80100000"` -From //kernel/lib/version/BUILD.gn:9 +From //kernel/params.gni:23 -### sysroot -The `--sysroot` directory for host compilations. -This can be a string, which only applies to $host_os-$host_cpu. -Or it can be a list of scopes containing `cpu`, `os`, and `sysroot`. -The empty list (or empty string) means don't use `--sysroot` at all. +### toolchain +*This must never be set as a build argument.* +It exists only to be set via c_toolchain(). +See environment() for more information. **Current value (from the default):** ``` -[{ - cpu = "arm64" - os = "linux" - sysroot = "//prebuilt/downloads/sysroot/linux-arm64" -}, { - cpu = "x64" - os = "linux" - sysroot = "//prebuilt/downloads/sysroot/linux-x64" -}] +{ + configs = [] + environment = "stub" + globals = { } + label = "//public/gn/toolchain:stub" +} ``` -From //public/gn/config/BUILD.gn:16 - -### use_prebuilt_clang -If $clang_tool_dir is "", then this controls how the Clang toolchain -binaries are found. If true, then the standard prebuilt is used. -Otherwise the tools are just expected to be found by the shell via `PATH`. - -**Current value (from the default):** `true` - -From //public/gn/toolchain/clang.gni:9 - -### host_cpu - -**Current value (from the default):** `"x64"` - -### host_os - -**Current value (from the default):** `"linux"` - -### use_ccache -Set to true to enable compiling with ccache. - -**Current value (from the default):** `false` - -From //public/gn/toolchain/ccache.gni:9 +From //public/gn/BUILDCONFIG.gn:20 ### variants List of "selectors" to request variant builds of certain targets. Each @@ -403,25 +287,65 @@ Variant scope parameters From //public/gn/toolchain/environment.gni:221 -### assert_level -* 0 means no assertions, not even standard C `assert()`. -* 1 means `ZX_ASSERT` but not `ZX_DEBUG_ASSERT`. -* 2 means both `ZX_ASSERT` and `ZX_DEBUG_ASSERT`. +### asan_default_options +Default [AddressSanitizer](https://llvm.org/docs/AddressSanitizer.html) +options (before the `ASAN_OPTIONS` environment variable is read at +runtime). This can be set as a build argument to affect most "asan" +variants in $variants (which see), or overridden in $toolchain_args in +one of those variants. Note that setting this nonempty may conflict +with programs that define their own `__asan_default_options` C +function. + +**Current value (from the default):** `""` + +From //public/gn/config/instrumentation/BUILD.gn:13 + +### host_os + +**Current value (from the default):** `"linux"` + +### malloc + +**Current value (from the default):** `"scudo"` + +From //third_party/ulib/musl/BUILD.gn:6 + +### symbol_level +* 0 means no debugging information. +* 1 means minimal debugging information sufficient to symbolize backtraces. +* 2 means full debugging information for use with a symbolic debugger. **Current value (from the default):** `2` -From //public/gn/config/levels.gni:9 +From //public/gn/config/levels.gni:20 -### build_id_dir -Directory to populate with `xx/yyy` and `xx/yyy.debug` links to ELF -files. For every ELF binary built, with build ID `xxyyy` (lowercase -hexadecimal of any length), `xx/yyy` is a hard link to the stripped -file and `xx/yyy.debug` is a hard link to the unstripped file. -Symbolization tools and debuggers find symbolic information this way. +### sysroot +The `--sysroot` directory for host compilations. +This can be a string, which only applies to $host_os-$host_cpu. +Or it can be a list of scopes containing `cpu`, `os`, and `sysroot`. +The empty list (or empty string) means don't use `--sysroot` at all. -**Current value (from the default):** `"/b/s/w/ir/k/out/build-zircon/.build-id"` +**Current value (from the default):** +``` +[{ + cpu = "arm64" + os = "linux" + sysroot = "//prebuilt/downloads/sysroot/linux-arm64" +}, { + cpu = "x64" + os = "linux" + sysroot = "//prebuilt/downloads/sysroot/linux-x64" +}] +``` -From //public/gn/toolchain/c_toolchain.gni:17 +From //public/gn/config/BUILD.gn:16 + +### use_goma +Set to true to enable distributed compilation using Goma. + +**Current value (from the default):** `false` + +From //public/gn/toolchain/goma.gni:9 ### default_deps Defines the `//:default` target: what `ninja` with no arguments does. @@ -430,31 +354,23 @@ Defines the `//:default` target: what `ninja` with no arguments does. From //BUILD.gn:19 -### goma_dir -Absolute directory containing the Goma source code. - -**Current value (from the default):** `"/home/swarming/goma"` - -From //public/gn/toolchain/goma.gni:12 +### detailed_scheduler_tracing +Enable detailed scheduler traces. -### zx -*This must never be set as a build argument*. +**Current value (from the default):** `false` -"$zx/" is the prefix for GN "source-absolute" paths in the Zircon -build. When Zircon is built standalone, the Zircon repository is the -root of the build (where `.gn` is found) so "$zx/" becomes "//". When -Zircon is part of a larger unified build, there is a higher-level `.gn` -file that uses `default_args` to set "$zx/" to "//zircon/". +From //kernel/params.gni:41 -**Current value (from the default):** `"/"` +### enable_acpi_debug +Enable debug output in the ACPI library (used by the ACPI bus driver). -From //public/gn/BUILDCONFIG.gn:13 +**Current value (from the default):** `false` -### kernel_base +From //third_party/lib/acpica/BUILD.gn:9 -**Current value (from the default):** `"0xffffffff80100000"` +### host_cpu -From //kernel/params.gni:23 +**Current value (from the default):** `"x64"` ### kernel_extra_defines Extra macro definitions for kernel code, e.g. "DISABLE_KASLR", @@ -464,9 +380,22 @@ Extra macro definitions for kernel code, e.g. "DISABLE_KASLR", From //kernel/params.gni:48 -### target_os +### opt_level +* -1 means really unoptimized (-O0), usually only build-tested and not run. +* 0 means "optimized for debugging" (-Og), light enough to avoid confusion. + 1, 2, and 3 are increasing levels of optimization. +* 4 is optimized for space rather than purely for speed. -**Current value (from the default):** `""` +**Current value (from the default):** `2` + +From //public/gn/config/levels.gni:15 + +### smp_max_cpus +Maximum number of CPUs the kernel will run on (others will be ignored). + +**Current value (from the default):** `32` + +From //kernel/params.gni:7 ### crash_diagnostics_dir Clang crash reports directory path. Use empty path to disable altogether. @@ -475,19 +404,16 @@ Clang crash reports directory path. Use empty path to disable altogether. From //public/gn/config/BUILD.gn:10 -### enable_lock_dep -Enable kernel lock dependency tracking. - -**Current value (from the default):** `false` +### netsvc_debug_commands +Whether to enable debug commands in netsvc. -From //kernel/params.gni:35 +**Current value (from the default):** `true` -### enable_user_pci -Enable userspace PCI and disable kernel PCI. +From //system/core/netsvc/BUILD.gn:7 -**Current value (from the default):** `false` +### target_cpu -From //kernel/params.gni:44 +**Current value (from the default):** `""` ### gcc_tool_dir Directory where the GCC toolchain binaries ("gcc", "nm", etc.) are @@ -501,10 +427,28 @@ system-installed tools found by the shell via `PATH` will be used. From //public/gn/toolchain/gcc.gni:17 -### current_cpu +### goma_dir +Absolute directory containing the Goma source code. + +**Current value (from the default):** `"/home/swarming/goma"` + +From //public/gn/toolchain/goma.gni:12 + +### target_os **Current value (from the default):** `""` +### build_id_dir +Directory to populate with `xx/yyy` and `xx/yyy.debug` links to ELF +files. For every ELF binary built, with build ID `xxyyy` (lowercase +hexadecimal of any length), `xx/yyy` is a hard link to the stripped +file and `xx/yyy.debug` is a hard link to the unstripped file. +Symbolization tools and debuggers find symbolic information this way. + +**Current value (from the default):** `"/b/s/w/ir/k/out/build-zircon/.build-id"` + +From //public/gn/toolchain/c_toolchain.gni:17 + ### enable_lock_dep_tests Enable kernel lock dependency tracking tests. By default this is enabled when tracking is enabled, but can also be eanbled independently @@ -515,19 +459,75 @@ disabled. From //kernel/params.gni:56 -### netsvc_debug_commands -Whether to enable debug commands in netsvc. +### enable_user_pci +Enable userspace PCI and disable kernel PCI. -**Current value (from the default):** `true` +**Current value (from the default):** `false` -From //system/core/netsvc/BUILD.gn:7 +From //kernel/params.gni:44 -### symbol_level -* 0 means no debugging information. -* 1 means minimal debugging information sufficient to symbolize backtraces. -* 2 means full debugging information for use with a symbolic debugger. +### smp_max_clusters **Current value (from the default):** `2` -From //public/gn/config/levels.gni:20 +From //kernel/params.gni:13 + +### tests_in_image +Whether to include all the Zircon tests in the main standalone ZBI. +TODO(mcgrathr): This will be replaced by a more sophisticated plan for +what images to build rather than a single "everything" image that needs +to be pared down. + +**Current value (from the default):** `true` + +From //BUILD.gn:16 + +### use_prebuilt_clang +If $clang_tool_dir is "", then this controls how the Clang toolchain +binaries are found. If true, then the standard prebuilt is used. +Otherwise the tools are just expected to be found by the shell via `PATH`. + +**Current value (from the default):** `true` + +From //public/gn/toolchain/clang.gni:9 + +### kernel_version_string +Version string embedded in the kernel for `zx_system_get_version`. +If set to the default "", a string is generated based on the +Zircon git revision of the checkout. + +**Current value (from the default):** `""` + +From //kernel/lib/version/BUILD.gn:9 + +### current_cpu + +**Current value (from the default):** `""` + +### enable_lock_dep +Enable kernel lock dependency tracking. + +**Current value (from the default):** `false` + +From //kernel/params.gni:35 + +### use_ccache +Set to true to enable compiling with ccache. + +**Current value (from the default):** `false` + +From //public/gn/toolchain/ccache.gni:9 + +### zx +*This must never be set as a build argument*. + +"$zx/" is the prefix for GN "source-absolute" paths in the Zircon +build. When Zircon is built standalone, the Zircon repository is the +root of the build (where `.gn` is found) so "$zx/" becomes "//". When +Zircon is part of a larger unified build, there is a higher-level `.gn` +file that uses `default_args` to set "$zx/" to "//zircon/". + +**Current value (from the default):** `"/"` + +From //public/gn/BUILDCONFIG.gn:13