CROSS-GCC-GENSOURCE(1)

πŸ“¦
version 249build1 Β· 4 versions
, in ubuntu resolute

CROSS-GCC-GENSOURCE(1) πŸ’…

okay bestie, welcome to the cross-gcc-dev documentation, section 1 of the manual, and honestly? this one's a banger. buckle up. πŸŽ€


✨ NAME ✨

cross-gcc-gensource β€” the little tool that generates sources to build a Debian cross toolchain. no cap, that's literally its whole job. πŸ¦‹


✨ SYNOPSIS ✨

 [TARGET_LIST=<arches to target>] [HOST_LIST=<build arches>] [SUFFIX=.1] cross-gcc-gensource <gcc-version>

 example:
 /tmp$ TARGET_LIST="armel armhf" HOST_LIST="amd64" cross-gcc-gensource 5

 .... lots of verbose output ....

 /tmp$ cd cross-gcc-packages-amd64/cross-gcc-5-armel

 /tmp/cross-gcc-packages-amd64/cross-gcc-5-armel$ ls

 debian

 /tmp/cross-gcc-packages-amd64/cross-gcc-5-armel$ dpkg-buildpackage

 .... building cross-toolchain ....

like. look at her go. ✨ the verbose output is giving main character energy and then suddenly you have a debian directory and you're off to the races. 🏁


✨ DESCRIPTION ✨

so what even is this? it's a utility that prepares a directory with debianized sources which build cross toolchain packages. 🫢

and here's the cute part: the sources this tool produces are very small. like, tiny. microscopic. because the actual code doesn't live here β€” nope:

  • the code itself comes from the gcc-version-source package πŸ“¦
  • the necessary patches and extra build stuff comes from the cross-gcc-dev package 🧰

so it's basically assembling a lil outfit out of two different closets. iconic behaviour, honestly. πŸ‘‘


✨ ARGUMENTS ✨

normal usage is, plain and simple:

 cross-gcc-gensource gcc_version

where gcc_version is the base version of the toolchain we're building. at the time of this writing we know about versions 4.9, 5, 6, 7, 8. (yes bestie, that's the whole roster, don't come at me.) πŸ“

this commandline argument is required. no arg, no vibes. πŸ’€

🌸 Specifying the target architectures 🌸

this tool generates a separate source package for each target architecture β€” and "target architecture" means the architecture being targetted by the cross-compiler being built, iykyk. 🎯

by default, these architectures are targetted:

  • arm64
  • armel
  • armhf
  • mips
  • mipsel
  • powerpc
  • ppc64el

if you want a different set of target architectures (valid, we love options), set the TARGET_LIST environment variable. for instance, to build for armel and armhf:

 TARGET_LIST="armel armhf" cross-gcc-gensource 5

slay. πŸ’–

🌈 Specifying the host architectures 🌈

similarly (love that word), this tool generates a separate source tree for each host architecture β€” that's the architecture the cross-compiler being built runs on. 🏠

by default, these architectures are targetted:

  • amd64
  • i386

if you need a different set of host architectures, set the HOST_LIST environment variable. for instance, to build just for amd64:

 HOST_LIST="amd64" cross-gcc-gensource 5

one host, zero drama. 🧚

πŸ¦‹ Specifying a version suffix πŸ¦‹

okay so picture this: you need to upload a new source package, but the version of gcc-source you built against hasn't changed. awkward!! 😭 because then you'd get binary-version clashes, and nobody wants that.

the fix? add a version suffix. an optional SUFFIX env var allows this. πŸ’…

 TARGET_LIST="armel armhf" SUFFIX=.1 cross-gcc-gensource 5

problem solved, crisis averted, ate. πŸ”₯


and that's the whole page bestie!! go forth and build cross toolchains, you absolute legend. πŸ‘‘

this lil masterpiece is from cross-gcc-dev=249build1, dated 2025-12-08, and it lives at CROSS-GCC-GENSOURCE(1). mwah πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from