From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6572049490740510720 X-Received: by 2002:a19:750d:: with SMTP id y13-v6mr497855lfe.34.1530174513373; Thu, 28 Jun 2018 01:28:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:90cd:: with SMTP id o13-v6ls926882ljg.12.gmail; Thu, 28 Jun 2018 01:28:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLMicLBVUpzf/95sLpuIaHAdhPLvtEWoMaIWMr8u/FvohCLthk06B5qPa6AX8C26rgLO+f5 X-Received: by 2002:a2e:3209:: with SMTP id y9-v6mr498842ljy.33.1530174512728; Thu, 28 Jun 2018 01:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530174512; cv=none; d=google.com; s=arc-20160816; b=djzm2HMhMGTT4JtCwnS3pDmqeVMHmG7q2UGIx4oIlVNU7Ks5mbHlZ8aLI8BQLxZIXJ GD8ioLo1Ia5DCkiRbGQURrhh6XQzm32Mf3SZSWCMHM0bA6456KWlSYxoPdTtYi7sDru9 MrCXNQOHe4pWMH2IxPUPk+BfiURRFHFHFotzXZrFhYMCAW/M9rs9Y52cfAfYQQcZNi4r 22/TcH50iGHVqKN0iopzya0edDU/ahCZCpAe0qhMtlk+IkkYKDrDaOUYSbkJO7vvwXg7 Mn4rUq7STDzCYTjX2jITJEgZHosBDV/lBXwkOkPg0tXSc2pOMj198i0nRySR2nULNwcy FoLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=JZNnP3a8W0oPxfebqLiCWePL6+cll2E7WFtf3tHi5as=; b=icZlSVtm2MW4LJlfQ17JqOfPeyPuZmcsTNu0R4zfV/VGbOFVT831UuVbqznovJ7Eco xO6JkYYUq4D4r4RI3LuVJ/bZPZu7T4Nmi6082MQO1MH5X4pivF9SD/F3Whh59Jcm3755 u0htylVDR6FG1Wm7AYNCbYsYDr6m6snjVaT9x0Uwatm3oEGKlcGkH5IO66mYfbyXM/L3 Igd1vqMKsPpxJvWzMyHD+CWpa55AI4CzUnPgcPjKQ6Bv5Duz+SA10XFmXOS0Ozu8yQQh 5J4+VF0Ib6xLgcnUtfhnlvhuHyxXnRashRRfp1eXRf06vfAaaCTD+ltlRARrNfehEI/I +G4g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id k22-v6si237827ljg.0.2018.06.28.01.28.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 01:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from azat.i.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w5S8SEq6024070 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT); Thu, 28 Jun 2018 10:28:23 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH v2 00/12] Cross-compilation Date: Thu, 28 Jun 2018 10:27:58 +0200 Message-Id: <20180628082810.3571-1-asmirnov@ilbers.de> X-Mailer: git-send-email 2.11.0 X-TUID: I/dA6dfwj5WD Hi all, [NOTE] Cover letter is too long, so I don't expect that you read it all. So I'd like to start with this message to avoid possible question. :-) This series has intersection with SDK one, so it should be rebased after SDK is applied to next. Thanks! [/NOTE] here is the second version of cross-compilation support. This version adds support for cross-compiling stretch-armhf target. What's new here: - Build dependencies are resolved automatically, so isar-image-base could be built using cross-compilation only (libhello, example-hello, example-raw) - Linux kernel could be also cross-compiled now for arm Test scenarios: 1. Build isar-image-base: - Set variable in local.conf ISAR_CROSS_COMPILE to "1" - Edit recipes: libhello and example-hello and replace "inherit dpkg" by "inherit dpkg-cross" - Build using "bitbake multiconfig:qemuarm-stretch:isar-image-base" - With cross-compilation the image is generated twice faster 2. Build arm kernel: - Set variable in local.conf ISAR_CROSS_COMPILE to "1" - There is no default arm config, so I derived the one from linux-cip tree: "zx_config" and add it to recipe - Build it "bitbake multiconfig:qemuarm-stretch:linux-cip" - Aftewards I have the following packages: * linux-image-4.4.112-cip18_4.4.112-cip18-1_armhf.deb * linux-image-4.4.112-cip18-dbg_4.4.112-cip18-1_armhf.deb * linux-headers-4.4.112-cip18_4.4.112-cip18-1_armhf.deb - The compilation tooks me about 2-3 minutes. Much faster than in QEMU Issue: 1. No support for jessie. The main issue here, that jessie doesn't have armhf compiler in default apt. Official wiki asks you to use embian apt to get it 2. mk-build-deps has two params: --host-arch, --cross-arch. But they seem to work incorrectly. If set both of them in deps list I got unexisting packages. Now I use --host-arch only and it works good. I want to check this in buster and then probably ask Debian community reagrding this 3. i386 architecture for now is not considered as a target for cross compilation 4. Currently libhello and example-hello applications have hardcoded native compilation (inherit dpkg). This should be reworked to depend on ISAR_CROSS_COMPILE variable Huh, no more ideas, let's start with this. Alex Alexander Smirnov (12): isar-bootstrap: Add routine to determine host arch isar-bootstrap: Move common part to include isar-bootstrap: Add host architecture support isar-bootstrap-helper: Add parameter to set arch buildchroot-cross: Initial implementation classes/dpkg*: Relocate dependency from buildchroot classes/dpkg*: Drop hardcoded buildchroot blobs build.sh: Add target parameter classes/dpkg-cross: Initial implementation dpkg: Resolve dep from buildchroot linux: Add cross-compilation support local.conf: Add cross-compilation option meta-isar/conf/local.conf.sample | 5 + meta/classes/dpkg-base.bbclass | 33 ++- meta/classes/dpkg-cross.bbclass | 12 + meta/classes/dpkg-raw.bbclass | 2 +- meta/classes/dpkg.bbclass | 4 +- meta/classes/image.bbclass | 2 +- meta/classes/isar-bootstrap-helper.bbclass | 19 +- meta/conf/isar-bitbake.conf | 1 + .../isar-bootstrap/isar-bootstrap-host.bb | 44 ++++ .../isar-bootstrap/isar-bootstrap-target.bb | 44 ++++ meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 259 --------------------- .../recipes-core/isar-bootstrap/isar-bootstrap.inc | 223 ++++++++++++++++++ .../buildchroot/buildchroot-cross.bb | 57 +++++ meta/recipes-devtools/buildchroot/buildchroot.bb | 2 +- meta/recipes-devtools/buildchroot/files/build.sh | 17 +- meta/recipes-kernel/linux/files/build-kernel.sh | 16 ++ meta/recipes-kernel/linux/linux-custom.inc | 6 +- 17 files changed, 468 insertions(+), 278 deletions(-) create mode 100644 meta/classes/dpkg-cross.bbclass create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb delete mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap.bb create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-cross.bb -- 2.1.4