On Mon, 9 Mar 2020 at 21:56, Paul Smith wrote: > The tricky bit is that although both the host and target are always > x86_64/i686 GNU/Linux systems, I need the generated compiler to run on > much older systems than the one I build it on. > > I have a sysroot I've created (downloading RPMs from older systems and > unpacking them) which is sufficient to build GCC (and binutils etc.) I > need the GCC binaries I create to be compiled using this sysroot so > that they can run on older systems.
I suggest using containers for this. Once you've got a working Dockerfile it makes life much easier in my experience. The podman and buildah utilities are great alternatives to docker itself. By building in a container using something like "FROM centos:6" you know you're using those packages, not trying to convince GCC to use a cobbled-together sysroot based on old RPMs.