X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by lists.alpinelinux.org (Postfix) with ESMTP id 0E8305C41D2 for ; Sat, 23 Jul 2016 06:29:51 +0000 (GMT) Received: by mail-lf0-f67.google.com with SMTP id l69so8530393lfg.1 for ; Fri, 22 Jul 2016 23:29:51 -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=MmUq8ZRR+u8c8DUgxI9bxW+9b3HIlRqIxpr5w3Y7MJw=; b=HPRzc3wEnUo7oXcSBwlKHQegfoAPoU969T+6c6PmaO+szQFX+qWaDdHpU7h4I/in9L wLe1UfjwLz7VzXH63Kh8n8qPblLsOcwxZ1Xm9NBqsnoPtg0ihi6f0C/h/47LKAvm5zIb BjHD/deLOEjC/s+HSXfEBUV9CG4fZzsnAXS3InzS95Ub5ndKJQD0DYSDrH3P2EUKqM8s uusfbK5DYhnwJeJxY8Zzyny7kPB5yMzPRQgSucG768cR3oTyR9ioRu30RfQE5/pFh9dH qmFQpdW/GfrTG6RcaY6d339tk1NvazDXEuXnrGDPrpBS0wRHdnvUHbvymeRlP3rwo/Nz GuyA== 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=MmUq8ZRR+u8c8DUgxI9bxW+9b3HIlRqIxpr5w3Y7MJw=; b=MqI9eIZckxRSidxuZsFeLwD59PsWScEDFU3kZa3qx+vqM4pY6cIdv+7kNdmk76Hz5v 331jJI375rHpXqaFTQoo78ANS+EG3R3zXwh3ZJQ58rYOCqjlAKnEFOt++9ZQANPpwkD2 xKeRnCv8zGPZrVUnxRT9uRfVzEWxifFmj8BhNz5GC62ytBNhcyFMwbIPq/Vqm7IOoH5M 2kPQMn2ica4xslUwurq2WCu+ZrRQV+LtHSaPSm6/lKIrBRTNRfGFhXworKHzsoWk9seQ JVbGhHirmmHRElogP9i58ZpBrfRBgBw8pwUAGM88GiCWk6FvLTzL3p7RPaO/RML85+4F w7fw== X-Gm-Message-State: AEkoouvYB7qfOcGS6oXkR3LnrwymnFGivaIZh3k/nLSAFBzLGyUKYE1RSgqZb3fLckQ4hQ== X-Received: by 10.25.28.16 with SMTP id c16mr4037213lfc.79.1469255390727; Fri, 22 Jul 2016 23:29:50 -0700 (PDT) Received: from vostro ([83.145.235.201]) by smtp.gmail.com with ESMTPSA id h203sm789942lfh.46.2016.07.22.23.29.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jul 2016 23:29:50 -0700 (PDT) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Sat, 23 Jul 2016 09:29:44 +0300 From: Timo Teras To: "Tuan M. Hoang" Cc: "alpine-devel" Subject: Re: [alpine-devel] Porting Alpine scripts Message-ID: <20160723092945.0680e7fd@vostro> In-Reply-To: <15614c77014.1200f0e697958.371787825394349914@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> <20160722084514.7c01123f@vostro.util.wtbts.net> <15614c77014.1200f0e697958.371787825394349914@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 Sat, 23 Jul 2016 05:43:49 +0700 "Tuan M. Hoang" wrote: > ---- On Fri, 22 Jul 2016 12:45:14 +0700 Timo Teras > 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. I just pushed few commits to abuild, that set CBUILD by default properly. It also fixes dependency installation for host/target to not run scripts, that would become error later on the build process too. Please try latest abuild git version if it helps. > > 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. I actually want first fix cross building to be supported properly. So just doing "CHOST=aarch64 abuild -r" would to cross-compile aarch64 version of package on any build system. I have first patch ready for this that makes all the cross-compile script config entries built-in to abuild. The second patch is make abuild properly aware of subpkg's arch. This is tricky since when make cross toolchain we are generating packages for the host and the target. But I got this almost done. The above two will greatly simplify the bootstrap scripts, which I'll probably dump to aports along with instructions. We've been getting lot of questions for bootstrapping recently... > > 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. Could you share what target triplet you are using? And what CARCH? I'll be happy to push these to abuild early, even if everything is not working. > > 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. Understand. Porting things to new systems is usually not easy. It's often done by few people only and the documentation is scarce. This thread has been useful also for us to understand what questions come across. I'll probably collect things from here and dump them to the readme along with the enhanced bootstrap scripts. Thanks, Timo --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---