X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by lists.alpinelinux.org (Postfix) with ESMTP id D11585C4192 for ; Fri, 22 Jul 2016 05:45:20 +0000 (GMT) Received: by mail-lf0-f65.google.com with SMTP id l69so6833194lfg.1 for ; Thu, 21 Jul 2016 22:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nNt1xd5VROw9tjSbNNqD/RUrcCape8kaDhFipbyB6M4=; b=IVKCdncBCKa99e3fvu40f1fpAI/ZSjOqoZISnwsgX0baonG4cvlRE0YrRigq5qtedA sWF+4vpIIUq3c3EpkJGR42fTCxNV1zAQTHsihWhqdY2Na/1qCVMSWcsnuF6qr51zLoWP TtPvfWBhBDeCodbKFemjpseGcQgT10wSB9BQZe4+qDK8vmyS9njUEXdMqs7lv8CgzPJg zJ9FFcRyL8dxOmyQ+eMsXIWKoA8k/4n1dvRRoy4H/qZQ5vLBwsZYLHJVUyxsQn9vS7XK I0KSTzn3BPzj0A1LhXDwYLWBPZ9a8UYUPFX6vCCmOeB4z5K2aYodMrqZJbyaotP6Ncy4 aANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nNt1xd5VROw9tjSbNNqD/RUrcCape8kaDhFipbyB6M4=; b=MR6p+ObyFFR5HCma11eGd5TO41qFtryDsaDRKn5BGVVjX+OPtqMyP9laJcVtJJmiZ2 R+jZqarg+vXMETVqCpuV5LoW49lKNDLmYr/eedATagsQlzeLsNRG6nMbkzFCFKUnnB7+ aEKUQ+Zb9Nu/qJ+LPrQTLxOPHeKxVBE4hxLSepFq0mcPd4uhGKimcKgf+SjBcjRWRtjs bHdZDAawCgEFAJZMptmeyuwGamY7OaHw0nBmrSoClcBmGEgEPK94R5rweiThPA0R0tPZ cK02zalAI8BUTptNx4w484x+E5YOVxNW42+hOF26G4YtKxC9e+xfGyS5jfbt5GX90jbp vtJA== X-Gm-Message-State: AEkoouu9bcZScMvEW4HS92s0H5+BXURlH6QKFx0jhaQpAAQEmLLu45qDRw2tnJKKL6tDVA== X-Received: by 10.25.15.98 with SMTP id e95mr1567463lfi.55.1469166319688; Thu, 21 Jul 2016 22:45:19 -0700 (PDT) Received: from vostro.util.wtbts.net ([2001:1bc8:101:f402:e66f:13ff:fef3:8cd0]) by smtp.gmail.com with ESMTPSA id k15sm2529116lfb.25.2016.07.21.22.45.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jul 2016 22:45:19 -0700 (PDT) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Fri, 22 Jul 2016 08:45:14 +0300 From: Timo Teras To: "Tuan M. Hoang" Cc: "alpine-devel" Subject: Re: [alpine-devel] Porting Alpine scripts Message-ID: <20160722084514.7c01123f@vostro.util.wtbts.net> In-Reply-To: <1560fbd5a78.dbf5aa7b48820.4632348656468847927@flatglobe.org> References: <155a8e57d76.f37920c130996.6728092923369604578@flatglobe.org> <20160703225319.0ce46f62@vostro> <155b28d7dfa.ca28fe6d67425.5841089419777612642@flatglobe.org> <20160705172656.788ec089@vostro.util.wtbts.net> <20160706172836.74bab5d1@vostro> <155e6497a8e.11ad265cf269464.7355344611305011615@flatglobe.org> <155f440c618.129c9f0aa5155.5728200182511575692@flatglobe.org> <20160718084038.23773fca@vostro.util.wtbts.net> <1560fbd5a78.dbf5aa7b48820.4632348656468847927@flatglobe.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.28; x86_64-alpine-linux-musl) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 22 Jul 2016 06:14:42 +0700 "Tuan M. Hoang" wrote: > ---- On Mon, 18 Jul 2016 12:40:38 +0700 Timo Teras > 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= 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. 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. 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. > 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. 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 > 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 > @@ -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() { > @@ -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() { > @@ -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 ? 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. > 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. Cheers, Timo --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---