Re: FR: Provide Out-Of-Tree Building; Provide Cross-Compile Parameters
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 8, 2024, 16:52 UTC
- Message-ID
- <CAPig+cSB0d7aAwMpToLCa+6Be5JFqLAr+0pvBXQxg_=DEk7p2A@mail.gmail.com>
- In-Reply-To
- <CALaQ_hoDqD6CXEDy0YT8no3SaoJSqV6toMtyRHdJr6h3RZUiLA@mail.gmail.com>
On Mon, Jul 8, 2024 at 12:38 PM Nathan Royce <nroycea+kernel@gmail.com> wrote:
Show 15 quoted lines
> For projects I built, up to the git project (think LFS steps
> (altered)), they've all provided OOT builds so the source directory
> remains pristine (albeit those that needed autoconf to be run for
> `configure` generation).
>
> They've also all provided `--{build,host,target,with-sysroot}=`
> parameters for ease of cross-compiling.
>
> Looking at what the git project offers, and I'm not seeing either features.
>
> Looking at the Makefile, I see mention of `HOST_CPU` which looks
> pertinent, but being able to point to the path of the target root for
> files to link is important and I'm not noticing anything for that.
>
> Grepping through Documentation for `HOST_CPU` comes up with nothing.Indeed, HOST_CPU was chosen intentionally for compatibility with `autotools` in the event that support for cross-compilation was ever added[*].
A few years ago, I had started adding cross-compilation support to the project but never finished the task. I'm pretty sure I still have the patches sitting around somewhere. I'll look for them, but I'm not sure how much they will help. Aside from the obvious patch adding `config.guess` and `config.sub`, I recall creating a patch to fool `autoconf` into not demanding that the project also carry the bunch of other scripts/tools `autoconf` normally wants (since we don't use those tools in our build process).
[*] https://lore.kernel.org/git/20171209094310.GA60808@flurp.local/