Mail archive
alpine-devel

Re: [alpine-devel] Porting Alpine scripts

From: Tuan M. Hoang <tmhoang_at_flatglobe.org>
Date: Sat, 23 Jul 2016 05:43:49 +0700

 ---- On Fri, 22 Jul 2016 12:45:14 +0700 Timo Teras <timo.teras_at_iki.fi> wrote ----
>
> My scripts expect that you add CBUILD there. Though it's trivial to get
> it from $(gcc -dumpmachine), I think that should be added to abuild.
> I'll probably do that soon. I think most of the environment variables
> set the cross .conf files should in fact be set in abuild already. I'll
> look in to doing that as well.
>

For some commands, running without CBUILD being set is okay, some are not. I cannot remember which is which but If I see them again, I will tell you.

> Though, we are currently looking into improving the build system a bit
> more to support cross-building better, including supporting it directly
> from abuild command line and building things automatically in chroot.
> This needs a bit of design, but is on the way.
>

That's really good to know. I would like to help in that process, or try it out and give feedback.

> abuild will deduce CARCH from CHOST. You need to add s390x support to
> abuild. See commit:
> http://git.alpinelinux.org/cgit/abuild/commit/?id=580dd46c588ef71bc852d2b9a5bb4426a2c47665
>

This one is very helpful. I had to set CARCH to some commands around for a while even though I do *guess* it should be deduced from CHOST, by reading /usr/bin/abuild.
   
> The lib64 is gcc default, and on x86_64 and aarch64 it's similar. We
> patch the lib location for these architectures, see:
> http://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-pure64.patch
>
> You probably need to add similar change for gcc/config/s390/t-linux64.
>

Looks like gold to me. Progressing on it.

> > Question 2:
> >
> > So when you started porting armv7 and aarch, which files in the
> > aports tree you had to make changes ? Theoretically I can check in
> > the git log but that would be a lot, I think :(
>
> Not too many. You probably need (aarch64 commit referred):
>
> - abuild to recognize the triplet (the commit refferred earlier)
> http://git.alpinelinux.org/cgit/abuild/commit/?id=580dd46c588ef71bc852d2b9a5bb4426a2c47665
>
> - apk-tools to use the same arch name
> http://git.alpinelinux.org/cgit/apk-tools/commit/?id=06ae5fdfdccd0c8e6d5501d93666bd915d2604d1
>
> - gcc to be configured correct for the arch
> http://git.alpinelinux.org/cgit/aports/commit/main/gcc?id=db1d2c069e66b3bf9962d76b0b48bfdcfc8d0384
> (the ada change is generic, you'll need the _arch_configure +
> gcc-pure64.patch update)
>
> And update APKBUILDs for the packages that are arch aware; for
> minimal bootstrap it includes:
>
> - linux-headers
> http://git.alpinelinux.org/cgit/aports/commit/?id=f483f49692b97950b680d987fe31f8ddb9277842
>
> - openssl
> http://git.alpinelinux.org/cgit/aports/commit/?id=896f06e3b0b07200957d0389e2156d0ee4e099cb
>
> - linux-vanilla (or the kernel you need, including creating kernel configuration)
> http://git.alpinelinux.org/cgit/aports/commit/?id=baa04a75170112f9713dd5ad72a5732f9bfaeaac
>
> Some packages might also need other kind of patching, e.g. if configure
> does not recognize the new triplet.
>

It's much easier to have some existed work to follow. I have patched some APKBUILD myself along the way (gcc, musl, apk-tools, libfetch, openssl ...) and it is kind of painful, when you are new to Alpine. I will use your work and suggestion and come back after few days.

Thank you so much, Timo.

Hoang

> Cheers,
> Timo
>
>
> ---
> Unsubscribe: alpine-devel+unsubscribe_at_lists.alpinelinux.org
> Help: alpine-devel+help_at_lists.alpinelinux.org
> ---
>
>



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Sat Jul 23 2016 - 05:43:49 UTC