Mail archive
alpine-devel

Re: [alpine-devel] Porting Alpine scripts

From: Tuan M. Hoang <tmhoang_at_flatglobe.org>
Date: Fri, 22 Jul 2016 06:14:42 +0700

 ---- On Mon, 18 Jul 2016 12:40:38 +0700 Timo Teras <timo.teras_at_iki.fi> wrote ----

> Usually it is configured in /etc/abuild.conf, and that's what my
> scripts expect. E.g. my abuild-crossbuild-armv7.conf has:
> # inherit CBUILD, and other basic defines
> source /etc/abuild.conf
>
> It expects CBUILD=<system triplet> to be in /etc/abuild.conf.
>
> This is also used by abuild to deduce if cross building or not, and
> probably caused the problem #1 too.
>

Problem 1 : (to keeptrack easier)
This is the content of my /etc/abuild.conf : http://pastebin.com/Pq6vYpvD
So strange that there is no trace of CBUILD variable, even CARCH, CTARGET_ARCH. I keep getting CARCH=unknown error. Then I made some modification as in : https://github.com/tmh1999/alpine-bootstrap-s390x/commit/2aadde7982a9ba679bd01734705321d9dde76d97

AFAIK, CARCH is the build machine architecture (x86_64) and you get it by running $ abuild -A. But in my modification, it is armv7.

> We managed to bootstrap aarch64 recently. We have it running on qemu
> and on real hw too. I believe when it comes up, it could be used for
> aarch64 and possibly armv7 builds.

Sounds great !


Question 1 :
Until now, I also have successfully built a cross-compiler targeting s390x architecture, with above modification to the script and few more modification in aports/main/gcc/APKBUILD and aports/main/musl/APKBUILD files ( I use the experimental s390x port of musl ). I know this is not your problem but I would like to ask you since you are more experienced in this problem than me :)

This is the modification I made to aports/main/gcc/APKBUILD file :

--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
_at_@ -392,7 +427,9 @@ libatomic() {
         mkdir -p "$subpkgdir"/usr/lib
         mv "$pkgdir"/usr/lib/libatomic.so.* "$subpkgdir"/usr/lib/ || \
                 cp -a "$pkgdir"/usr/$CTARGET/lib/libatomic.so.* "$subpkgdir"/usr/lib/ || \
+ cp -a "$pkgdir"/usr/$CTARGET/lib64/libatomic.so.* "$subpkgdir"/usr/lib/ || \
                 return 1
 }
 
 libcxx() {
_at_@ -403,7 +440,9 @@ libcxx() {
         mkdir -p "$subpkgdir"/usr/lib
         mv "$pkgdir"/usr/lib/libstdc++.so.* "$subpkgdir"/usr/lib/ || \
                 cp -a "$pkgdir"/usr/$CTARGET/lib/libstdc++.so.* "$subpkgdir"/usr/lib/ || \
+ cp -a "$pkgdir"/usr/$CTARGET/lib64/libstdc++.so.* "$subpkgdir"/usr/lib/ || \
                 return 1
 }
 
 gpp() {
_at_@ -452,7 +491,9 @@ libgcc() {
         mkdir -p "$subpkgdir"/usr/lib
         mv "$pkgdir"/usr/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/ || \
                 cp -a "$pkgdir"/usr/$CTARGET/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/ || \
+ cp -a "$pkgdir"/usr/$CTARGET/lib64/libgcc_s.so.* "$subpkgdir"/usr/lib/ || \
                 return 1
 }

From what I understand, when we --disable-multilib when configuring gcc, lib/ and lib64/ wouldn't be existed at the same time. But in my case they are all there and the *.so files are in lib64/ directory. This workaround helps the creatcross-toolchain.sh but when running crossbuild-toolchain.sh I faced a lot of failures from this lib/, lib64/ thing and the 'unknown' described above. What do you think ?


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 :(

Thank you.



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Jul 22 2016 - 06:14:42 GMT