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 77F065C41C9 for ; Tue, 26 Jul 2016 16:47:00 +0000 (GMT) Received: by mail-lf0-f67.google.com with SMTP id l69so696646lfg.1 for ; Tue, 26 Jul 2016 09:47:00 -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=JAdUrTuCjKF8ft6+A0M7Tnfti+e6UWz7niALa26MmlM=; b=B+mg8dBMiUyMAsHXyXQxTy6KADNKFz1118jPPbdVl+3NcVtUMW8nEro4QBxrInGb/M YMhmCoM1o1mTn2OiYSNw1eXav88AF8TQ683bsqCC1lE+IHhnahuR2fndqRzCkTOhJt0E dWsQFBLA0MvfW52lu2W0MEbVnzA8uaYZGu/PqILOKyRDDItTKq2uKxvPsya6X/zuK1vD SAx5MKbG+pucBt0c5veNRcaTozvO4o2m8BmY8as27caY87KzJLW4VgN+oXGwyA1ByEKc dzQJiEYSmmfGrJDZgvLAPUF13oM87vKx1up/dltCh891fgAmgffMM9aHrQn1Ikf/2She kkuA== 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=JAdUrTuCjKF8ft6+A0M7Tnfti+e6UWz7niALa26MmlM=; b=RPbroJ+T5YTGN1p1cyAj45e59Ao9J11uydgUjTiwEUJUjeUyutESfj81kgYuiY5uQb Fwds8S2gZoNNL0RDxKJF6IqXx2WOcCZwJr9CnMjaEnbIfnUM1BeFMj1YBqZRNfvezYLD NJzpuwje9KwyZwyF4ZCJL6ORbAxKHq0qhYcN8kGOKfESn5mQizI6EHlL87Bj31UhHBsK Jqe4jjpZs0omf3W1r2TeA5VDvZCPCcl8Y0sCWmi10AaZ//FfD/g0v5JrjidPhfMhQZxv r+GzWWoPxcOcmhMZPwOKMZC85KO5m/PIhkpHuxDDP9hbV3L3RqOXFakQ2dy91sOL+bcA Y7Wg== X-Gm-Message-State: AEkoouuazMkcKsgolbPdJ1grR88ANwHT5SN91vnjXFaBc7MOcDxp/nveOehR8Q6JigB38Q== X-Received: by 10.25.38.207 with SMTP id m198mr10174000lfm.201.1469551619355; Tue, 26 Jul 2016 09:46:59 -0700 (PDT) Received: from vostro ([83.145.235.201]) by smtp.gmail.com with ESMTPSA id 67sm269644ljj.8.2016.07.26.09.46.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jul 2016 09:46:58 -0700 (PDT) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Tue, 26 Jul 2016 19:46:54 +0300 From: Timo Teras To: "Tuan M. Hoang" Cc: "alpine-devel" Subject: Re: [alpine-devel] Porting Alpine scripts Message-ID: <20160726194654.69b12731@vostro> In-Reply-To: <156260c81a5.f458ee7355285.6767768145040849925@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> <20160723092945.0680e7fd@vostro> <1562340dbde.12a594a5120275.3795912911296475631@flatglobe.org> <156260c81a5.f458ee7355285.6767768145040849925@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 I'm working on fixing the abuild to be cross-build aware, and bundling the bootstrap script as part of aports.git. I expect to publish all of this work later today or tomorrow. The abuild specific parts are pushed out to: http://git.alpinelinux.org/cgit/abuild/log/?h=cross-build On Tue, 26 Jul 2016 14:12:49 +0700 "Tuan M. Hoang" wrote: > (updated, please ignore previous email) > > > ---- On Sat, 23 Jul 2016 13:29:44 +0700 Timo Teras > > wrote ---- > > 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. > > Target triplet : s390x-alpine-linux-musl > CARCH : s390x (but for linux-headers, it is s390) Thanks. Added this to the cross-build branch of abuild. > 1) Fortunately, I have successfully run crossbuild script targeting > s390x with following : > > a) After running creat-cross script, my sysroot's lib directory looks > like this: > > edge2:~/s390x/$ ls -al sysroot-s390x-alpine-linux-musl/lib > total 12 > drwxr-sr-x 3 root edge 4096 Jul 26 12:54 . > drwxr-sr-x 8 edge edge 4096 Jul 26 12:54 .. > drwxr-sr-x 3 root edge 4096 Jul 26 12:54 apk > lrwxrwxrwx 1 root root 25 Jul 26 12:54 > ld-musl-s390x.so.1 -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 > root root 18 Jul 26 12:54 libc.musl-s390x.so.1 -> > ld-musl-s390x.so.1 lrwxrwxrwx 1 root root 25 Jul 26 > 12:54 libc.so.6 -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root > root 25 Jul 26 12:54 libcrypt.so.1 > -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root root > 25 Jul 26 12:54 libm.so.6 -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx > 1 root root 25 Jul 26 12:54 libpthread.so.0 > -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root root > 25 Jul 26 12:54 librt.so.1 -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx > 1 root root 25 Jul 26 12:54 libutil.so.1 > -> /lib/libc.musl-s390x.so.1 > > Both ld-musl-s390x.so.1 and /lib/libc.musl-s390x.so.1 do not exist, > so all of above are broken links. Then I have to do some thing like > this: > > edge2:~/s390x$ abuild-apk > --root /home/edge/s390x/sysroot-s390x-alpine-linux-musl > add /home/edge/s390x/packages-s390x-alpine-linux-musl/main/s390x/musl-1.1.15-r0.apk > (1/1) Replacing musl (1.1.15-r0 -> 1.1.15-r0) OK: 23 MiB in 6 packages > > And then new layout looks like: > > edge2:~/s390x/sysroot-s390x-alpine-linux-musl/lib$ ls -al > total 3892 > drwxr-sr-x 3 root edge 4096 Jul 26 13:42 . > drwxr-sr-x 8 edge edge 4096 Jul 26 12:54 .. > drwxr-sr-x 3 root edge 4096 Jul 26 12:54 apk > -rwxr-xr-x 1 root root 3972272 Jul 26 13:17 > ld-musl-s390x.so.1 lrwxrwxrwx 1 root root 18 Jul 26 > 13:42 libc.musl-s390x.so.1 -> ld-musl-s390x.so.1 lrwxrwxrwx 1 > root root 25 Jul 26 12:54 libc.so.6 > -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root root > 25 Jul 26 12:54 libcrypt.so.1 -> /lib/libc.musl-s390x.so.1 > lrwxrwxrwx 1 root root 25 Jul 26 12:54 libm.so.6 > -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root root > 25 Jul 26 12:54 libpthread.so.0 -> /lib/libc.musl-s390x.so.1 > lrwxrwxrwx 1 root root 25 Jul 26 12:54 librt.so.1 > -> /lib/libc.musl-s390x.so.1 lrwxrwxrwx 1 root root > 25 Jul 26 12:54 libutil.so.1 -> /lib/libc.musl-s390x.so.1 > > If I don't do so, later crossbuild process will fail. Please check > https://github.com/tmh1999/alpine-bootstrap-s390x for my latest > scripts/config. Thanks, I believe this should be fixed in the new bootstrap.sh. You seem to have some patches there. Would you like to send them as git formatted commits, so you get your name as author of the commit? > b) Then I run crossbuild script, and I need remove paxmark lines in > gcc's APKBUILD as it returns an unknown error (while creat-cross > script runs just fine). AFAIK, it is about security concerns, not > system's functionality, so for now I guess it is okay. Your kernel is probably built without XATTR support. paxmark requires XATTR enabled kernel. > 2) After 1b) is good, I try either to (*) install newly cross-built > packages into the sysroot-s390x-alpine-linux-musl/ in the build > machine or (**) install Alpine in a chroot in the target device using > packages from packages-s390x-alpine-linux-musl/main/s390x/ , they > both generate following error: http://pastebin.com/WDJyCaxT. Any > chance this thing comes from removing paxmark in 1b) and create-cross > build error in 1a) ? I try to pass --verbose to apk-build but cannot > see any change. How did you manage to bootstrap on the real target > device? Add --no-scripts so it won't try to execute foreign binaries. Though, if you want to build a boot image from that, additional fixups are likely needed. I hope to rewamp the boot image creation scripts (alpine-iso.git) as set of scripts bundled in aports.git/scripts after cross build fixes. > > > > 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... > > Hum.. That looks quite complicated. Will definitely come back to this > afterwards. The abuild changes are complicated. The new bootstrap.sh is clean and simplified. You'll love it :) /Timo --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---