X-Original-To: alpine-devel@lists.alpinelinux.org Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) by lists.alpinelinux.org (Postfix) with ESMTP id 7C31F5C41C8 for ; Sat, 16 Jul 2016 15:09:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1468681733; s=default; d=flatglobe.org; i=tmhoang@flatglobe.org; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; l=2835; bh=AnKltKL9ub5yXf7PRh0q7P193wlFt5WTPM4N0X4iWkM=; b=NSG70HmpP9GmINz6WGmO+Gr02z9fAOjfpqaDMimN7WyZZ8XgNCH9KPhW8Ic+65LW L1yOkfWnT3ZsA2IR3sI+rqo/63o1QmnQZ76MJma+nN48d31O5vTGltlRfEWEiOOQOzW Noylqoi3exmwb+dCdL20cUHPLZdZZS2kfd6iz5jI= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1468681733714426.78178341133685; Sat, 16 Jul 2016 08:08:53 -0700 (PDT) Date: Sat, 16 Jul 2016 22:08:53 +0700 From: "Tuan M. Hoang" To: "Tuan M. Hoang" Cc: "Timo Teras" , "alpine-devel" Message-ID: <155f440c618.129c9f0aa5155.5728200182511575692@flatglobe.org> In-Reply-To: <155e6497a8e.11ad265cf269464.7355344611305011615@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> Subject: Re: [alpine-devel] Porting Alpine scripts 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="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-ZohoMail: Z_274237917 SPT_1 Z_274237916 SPT_1 SLF_D X-Zoho-Virus-Status: 2 Hi, I have successfully built armv7 cross-toolchain using createcross-toolchain.sh. About crossbuild-alpine-bootstrap.sh, I have 2 questions: 1. At cross-building busybox (in the for loop), there was an error of missing linux/kd.h header, even though /usr/include/linux/kd.h is present in my Alpine build machine. So I have to install the newly cross-built linux-headers package from previous loop, like this: diff --git a/crossbuild-alpine-bootstrap.sh b/crossbuild-alpine-bootstrap.sh --- a/crossbuild-alpine-bootstrap.sh +++ b/crossbuild-alpine-bootstrap.sh @@ -1,6 +1,6 @@ #!/bin/sh -TARGET_ARCH=aarch64 +export TARGET_ARCH=armv7 export ABUILD_CREATECROSS_CONF=$PWD/abuild-createcross-$TARGET_ARCH.conf export ABUILD_CONF=$PWD/abuild-crossbuild-$TARGET_ARCH.conf @@ -47,6 +47,10 @@ for PKG in linux-headers musl libc-dev \ cd $APORTS/main/$PKG BOOTSTRAP=bootimage abuild -r || exit 1 + if [ "$PKG" = "linux-headers" ]; then + ${SUDO_APK} -u --root "$CBUILDROOT" --repository "$REPODEST_TARGET/main" --arch "$TARGET_ARCH" add linux-headers | exit 1 + fi + if [ "$PKG" = "libc-dev" ]; then # install libc-dev, as implicit but mandatory dependency ${SUDO_APK} -u --root "$CBUILDROOT" add libc-dev || exit 1 How about your procedures? 2. At cross-building binutils step, I have the error : ./a.out: cannot execute binary file: Exec format error I checked the configure log (http://pastebin.com/t9QS9DZZ) and it looks like the build, host, target machines are all 'armv7-alpine-linux-muslgnueabihf', which is incorrect I guess. I think the build machine should be 'x86_64-alpine-linux-musl' because we are using a cross-compiler running on x86_64 targeting armv7. So from its point of view, the build machine is x86_64, it builds program to run on host machine (armv7), and I am not really sure what to pass as target machine, maybe armv7 too. If I try to pass to binutils configure script with '--build=x86_64-alpine-linux-musl --host=armv7-alpine-linux-muslgnueabihf --target=armv7-alpine-linux-muslgnueabihf ' then it configure and build just fine. Doing the same strategy with make, it failed. What do you think ? 3. I am curious about CBUILD variable. Where is it defined? Can't find in your script nor (any) APKBUILD nor APKBUILD reference documentation/webpage. In cross-building binutils case, it is set to 'armv7-alpine-linux-muslgnueabihf', same as CHOST. By the way, your work is beautiful. Thank you. ---- On Thu, 14 Jul 2016 05:03:43 +0700 Tuan M. Hoang wrote ---- > > Would you mind sharing your building log ? I just need to make sure my steps are correct. > Thank you. > > --- > Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org > Help: alpine-devel+help@lists.alpinelinux.org > --- > > --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---