Gcc

Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.

GCC_TOOL

const GCC_TOOL

Undocumented.

gccArtifactName()

gccArtifactName(version, plat)

Return the Bootlin toolchain name for a version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

gccDownloadUrl()

gccDownloadUrl(version, plat)

Return the Bootlin toolchain download URL for a version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

gccSupportedPlatforms()

gccSupportedPlatforms()

Return the platforms Bootlin publishes a prebuilt gcc toolchain for. Bootlin only ships Linux; the arch set comes from the module's BOOTLIN_ARCH map.

Returns: Array<{ os: string, arch: string }>

gccCacheKey()

gccCacheKey(version, plat)

Return the named-cache key for a gcc toolchain version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

GccToolchain (implementation class)

class GccToolchain

Implementation class. BUILD files should use gccToolchain().

Undocumented.

gccToolchain()

gccToolchain(version, opts = {})

Declare a gcc toolchain version and optionally set it as the default. matching lockfile entry (warns instead of failing).

ParameterTypeDescription
versionstringBootlin toolchain release version, e.g. "2025.08-1".
[opts]object
[opts.default=false]boolean
[opts.unverified=false]booleanAllow downloading without a

Returns: object Target handle for this gcc toolchain.

installGccToolchain()

installGccToolchain(version, source)

Install a local gcc toolchain directory into the named cache.

ParameterTypeDescription
versionstring
sourcestringPath to the toolchain root.

Returns: string|null Local path to the cached toolchain root.

acquireGccToolchain

const acquireGccToolchain

Acquire a gcc toolchain, downloading and caching it if not already installed in the named cache.

ParameterTypeDescription
versionstring

Returns: Promise<string> Local path to the toolchain root.

resolveGccToolchainVersion()

resolveGccToolchainVersion(version)

Resolve an explicit or default gcc toolchain version.

ParameterTypeDescription
[version]string

Returns: string|null

defaultGccToolchainVersion()

defaultGccToolchainVersion()

Return the currently configured default gcc toolchain version.

Returns: string|null

defaultGccToolchain()

defaultGccToolchain()

Return the currently configured default gcc toolchain target handle.

Returns: object|null

RustGccLinkDriver

class RustGccLinkDriver

Adapter exposing a gcc toolchain as Rust/rustc's C link driver — the program rustc shells out to as its linker driver. Reuses the same "clang"-named wrapper script Odin uses for the same reason (see gccTool() docs above). Registered as the "rust-link-driver" product for the "gcc-toolchain" kind so rustLinkerTools() (rules/rust/index.js) can resolve it dynamically via productFor(handle, RUST_LINK_DRIVER) — this module never imports anything Rust-specific.