@imp/rules/c/gcc

Module: @imp/rules/c/gcc.

GCC

Documentation is not yet available for this implementation export.

Source: rules/c/gcc/index.luau:26.

GCC_GRAPH_TOOL_NAMES

Documentation is not yet available for this implementation export.

Source: rules/c/gcc/index.luau:35.

artifact_name(version, plat)

The toolchain archive filename for a version and platform: a Bootlin tarball on Linux, and a WinLibs zip on Windows.

Source: rules/c/gcc/index.luau:106.

cache_key(version, plat)

The named-cache key for a gcc version and platform.

Source: rules/c/gcc/index.luau:137.

cmake_compiler_args(exec, gcc_tool, unsafe_system_paths)

The CMake arguments that select this gcc: CMAKE_C_COMPILER, CMAKE_CXX_COMPILER, CMAKE_RANLIB, CMAKE_AR, and on Windows CMAKE_ASM_NASM_COMPILER.

The paths are absolute host paths. CMake writes them into build.ninja, and later replay actions read build.ninja in other sandboxes. CMAKE_RANLIB is necessary: without it, CMake finds the ranlib of the host and writes its path. WinLibs ships nasm.exe in bin. Without the nasm argument, CMake searches the host PATH for enable_language(ASM_NASM), and a BoringSSL build can silently omit its assembly routines.

unsafe_system_paths selects the "-unsafe-paths" compilers. ar and ranlib have no wrapper, so they do not change.

Source: rules/c/gcc/index.luau:426.

default_graph_toolchain()

The gcc provider of the default version, or nil when no default is declared.

Source: rules/c/gcc/index.luau:535.

default_version

Documentation is not yet available for this implementation export.

Source: rules/c/gcc/index.luau:640.

download_url(version, plat)

The toolchain download URL for a version and platform.

Source: rules/c/gcc/index.luau:115.

gcc_toolchain(version, options)

Declare a gcc toolchain version.

version is a Bootlin version on Linux (for example "2025.08-1") and a WinLibs tag on Windows (for example "16.1.0posix-14.0.0-ucrt-r4"). A string applies to the host platform. A table such as { linux = "...", windows = "..." } gives one version for each OS.

Options: default Make this version the default. unverified Download without a lockfile entry, with a warning. lockfile Address of a lockfile to use instead of the shipped one, for example "@workspace/locks/gcc.lock". A table keyed by OS gives one address for each OS.

Returns { version, lockfile, [GEN_LOCKFILES] }. Export the value from a BUILD module to make its lockfile root selectable by imp goal gen-lockfiles.

Source: rules/c/gcc/index.luau:569.

graph_tool(version, options)

The tool handle of the managed gcc of a version.

Options: unsafe_system_paths Put "bin-unsafe-paths" on PATH in place of "bin", so that the plain names skip Bootlin's path guard.

Source: rules/c/gcc/index.luau:320.

graph_toolchain(version)

The gcc provider of a version, or of the default.

Source: rules/c/gcc/index.luau:528.

graph_toolchain_dir(exec, gcc_tool)

The absolute host directory of an installed gcc. Call it in a task body. gcc_tool is the tool of graph_toolchain(), declared as a task input.

Source: rules/c/gcc/index.luau:405.

is_gcc_toolchain(toolchain_value)

True when toolchain is a gcc provider.

Source: rules/c/gcc/index.luau:541.

reset_for_test()

Forget each declared version and the default. Tests call this, because the module declares a default when it loads.

Source: rules/c/gcc/index.luau:601.

resolve_version

Documentation is not yet available for this implementation export.

Source: rules/c/gcc/index.luau:650.

The rustflags, environment, and PATH directories that make rustc and cc-rs use this gcc. Call it in a task body. gcc_tool is the tool of graph_toolchain(), declared as a task input.

Returns { rustflags, env, path_dirs }. The paths are absolute: Cargo can start rustc in a package or build-script directory, so a sandbox-relative linker path is not stable. path_dirs has the bin directory, because cc-rs build scripts find "ar" through PATH. With kache_active, CC and CXX run the compiler through kache.

Source: rules/c/gcc/index.luau:481.

supported_platforms()

The platforms that Bootlin publishes a gcc toolchain for: Linux, with each arch of BOOTLIN_ARCH.

Source: rules/c/gcc/index.luau:128.

toolchain_record(tool, version)

The gcc provider of the shared C toolchain contract for a tool handle and a version. A test can give a fake tool handle.

Source: rules/c/gcc/index.luau:500.

windows_runtime_archives(exec, gcc_tool, version)

The absolute paths of the mingw-w64 runtime archives that a COFF linker, such as lld-link, needs. A gcc front end adds them through its default library spec. Odin's -linker:lld link on Windows fails without them, with undefined UCRT symbols and C++ symbols such as __gxx_personality_seh0, _Unwind_Resume, and operator new.

version is the WinLibs tag of the installed toolchain.

Source: rules/c/gcc/index.luau:449.

winlibs_gcc_version(version)

The plain GCC version in a WinLibs release tag, for example "16.1.0" for "16.1.0posix-14.0.0-ucrt-r4". The WinLibs archive keeps its runtime libraries under lib/gcc/x86_64-w64-mingw32/<gcc version>/.

Source: rules/c/gcc/index.luau:144.