git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: FR: Provide Out-Of-Tree Building; Provide Cross-Compile Parameters

From
NRNathan Royce <nroycea+kernel@gmail.com>
Date
Jul 8, 2024, 18:32 UTC
Message-ID
<CALaQ_hr2Hzri6y4KwYOPmGzfvM8EjJpddvLL7CQ=d3H4QLCzJw@mail.gmail.com>
In-Reply-To
<CAPig+cSB0d7aAwMpToLCa+6Be5JFqLAr+0pvBXQxg_=DEk7p2A@mail.gmail.com>

Well goodness me, seems I spoke too soon. I found the that zlib was required (looking for "zlib.h"), so I built that first and that too wasn't all that cross-compile friendly. I saw "CHOST" is used, and was surprised that it didn't seem to need anything to link against from the target sysroot, so that turned out better than I thought it would.

I then used `configure` prefixed with the`CFLAGS="--sysroot=<pathToSysroot>"`, along with `HOST_CPU=<tuple>` for `make`, and it worked out fine. Before moving it to my device, I just nspawned/chrooted into it and `git --help` worked. So looks good and easy steps. Of course, it'll depend on whether or not a git function using zlib also passes (hoping zlib actually built fine without needing any outside linkage).

I'd still suggest and prefer that git (and zlib) follows what others have settled on doing to be cross-compile-friendly.

On Mon, Jul 8, 2024 at 11:52 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 11 quoted lines
>
> 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/
Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 8 in “FR: Provide Out-Of-Tree Building; Provide Cross-Compile Parameters”
  1. Nathan RoyceJul 8, 2024
  2. Eric SunshineJul 8, 2024
  3. Nathan RoyceJul 8, 2024
  4. Eric SunshineJul 8, 2024
  5. Junio C HamanoJul 8, 2024
  6. Đoàn Trần Công DanhJul 10, 2024
  7. Nathan RoyceJul 10, 2024
  8. Junio C HamanoJul 10, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.