From patchwork Thu Sep 13 04:12:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 146591 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp136986ljw; Wed, 12 Sep 2018 21:12:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxTPtju+lBEDSYZn7U94KzekA037UfD20Qs96IcwlUP1xs5onKlATPfjgVtolYd6W5wP+9 X-Received: by 2002:a65:5144:: with SMTP id g4-v6mr5110104pgq.21.1536811943680; Wed, 12 Sep 2018 21:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536811943; cv=none; d=google.com; s=arc-20160816; b=YISKM3RLry4O9XFvYefaV5VD3GHq4i6+9+qFPmmVy/JeKFCGfOBKqj30ugOPHBOybz 2hNXS1a6VEOLogPAlcwuQkXXO6hUypgpPMeJAhHBntSlELpTzh8OFvOvPTIvHp9a3aWi xxJgxBB0WkKP+XXw6cy53nM6lgmLZWvwfMLLA2R5te4WpBSPuUWhBVfUI+5Q6dOlllWM KXddiXgmMehrxGzrwEEKKtrf5Mm9D+pVeUj3s8Xc4HyLDjdlu2B3zkWs9xyiNuuUrtbe xCIkNR4RZKLEGRNOynE9rZcNQAJExNZa2abNEc88HhtoH/TQviucgUPytE+GEmSKgc4t EwPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=O8rHm87moW8EpMQrVFvxdJ7kP5hz8mZDTrBCNMa/oXw=; b=qjUw1WIPVm8itI+VVIZNpY465ShqcCI5dtxpc2x1l66/lKPPIba8rlDh5QgEorRACy HDXTg6aQsKFFGYoR2nPGNIlbxq4UdIlESKmOruEXkjpUpUgDYVA3WPumnOrCeuNp82Hh +MC/YPj7CECSkwAgj/Uo7mqbwEKIqiU3VFRwDbmNTmBYiqw1omVvGr8U4lX65liwL5LB zkU59+EO1AaJF4SG67EvVwqS6wyXovkKP3alGxTPAuBIodw1FjD75P/8hwbo6CCYQBi+ ZaHiHZXrUcfHI2LNOlyfJdyxMCTD6kLu8i8Ya6Gn+QK9Ff1kYCXrAGGIy1YHu3kz0bKM H5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D4Pw4V7z; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id i90-v6si2887130pli.274.2018.09.12.21.12.23; Wed, 12 Sep 2018 21:12:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D4Pw4V7z; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 119D3792FE; Thu, 13 Sep 2018 04:12:20 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by mail.openembedded.org (Postfix) with ESMTP id C454879261 for ; Thu, 13 Sep 2018 04:12:18 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id f6-v6so2003292plo.1 for ; Wed, 12 Sep 2018 21:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K0SKnv9wAZmxxsKaLWRmTFJ7J4Q0/nYk4VqIJZefWAE=; b=D4Pw4V7z9sj4Xnb1RvP4iun6Yy4mbSS0WHE84v0CJpksogkWeJfhu8dSzM6SL/YLTq fMaRbqfQURhBrouasguJ9GRPVaaX/Rv/EOJdEF0v3KLUT/iGgelnWj7IrXie1lsUthii oBQ9IW/JqTwyWvoHXDp7APxDP07EvacsZKc06IM7MVt52qLUKpnPl8t1O8ZkkP53EPCZ jbRkj8jP5ZntGkrMnVREe1kuyYDiV6LpQ2cqirlACNN03RDkQieOPTjvUiVcQq6wn5qC YDjloGkRZ3KSvUOvIOmFwk+9xnv2LVp3aJiuwVquLY5HMWo3543UpNryIOuoNATDcw1a cMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K0SKnv9wAZmxxsKaLWRmTFJ7J4Q0/nYk4VqIJZefWAE=; b=CZxH9bLXDQdHc8DVz/f8wSubiPNvdDWPnvp8jkXE71LOCr+cUsVmdK76PUuivFF2nQ rVHmLXI06MHiKPennd08ssMBkF15Sbv/5O2gBF2EtFTxoLP2L5Z40stobMDYaazpUIlS 7rz5ObSKu9MdaIlwmSruMltO7tUM6nG57pznQJgJ5IZOFdBz+ERAG0+VO0729zgGW1bX VOnZ2mQxgT6XQWrYIRfHIZ0eMvwKLGPCl9QUH1+Mey35Vvn3LEvtlkL6RjZUo0rEcw9Z ZWy8FE01jdvLkbyr/K+IY8ZKz/JcWiB4XntvzOzuGfeGKMVxBQqd/GnpHwFeGQa8tFNs 0qqg== X-Gm-Message-State: APzg51A7ICrB9Q9me/V4FFDMb3W19mUb0sBsmyyw8/H+9pwL1JwWv19Z nue0AxDqY4P6RH+7RcblisikNQX5 X-Received: by 2002:a17:902:a507:: with SMTP id s7-v6mr5168516plq.303.1536811939172; Wed, 12 Sep 2018 21:12:19 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::2887]) by smtp.gmail.com with ESMTPSA id 143-v6sm3742067pfy.156.2018.09.12.21.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 21:12:18 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 12 Sep 2018 21:12:09 -0700 Message-Id: <20180913041209.33108-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [OE-core] [PATCH] insane: Recognise BPF as a valid EM_MACHINE type X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org BPF Linux ELF objects are generated with kernel-selftests with >= 4.18 kernel and when clang is enabled which packages BPF objects into packages, therefore recongnise this as a valid ELF target Add a selftest for BPF Do not flag BPF objects in target, since they pretty much will be ok for most of kernels architectures we care do support BPF Signed-off-by: Khem Raj --- meta/classes/insane.bbclass | 6 ++++-- meta/lib/oe/qa.py | 3 ++- meta/lib/oeqa/selftest/cases/oelib/elf.py | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) -- 2.19.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 8c360c83e7..4644221bc6 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -301,8 +301,10 @@ def package_qa_check_arch(path,name,d, elf, messages): # Check the architecture and endiannes of the binary is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ - (target_os == "linux-gnux32" or target_os == "linux-muslx32" or target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE'))) - if not ((machine == elf.machine()) or is_32): + (target_os == "linux-gnux32" or target_os == "linux-muslx32" or \ + target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE'))) + is_bpf = (oe.qa.elf_machine_to_string(elf.machine()) == "BPF") + if not ((machine == elf.machine()) or is_32 or is_bpf): package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \ (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d))) elif not ((bits == elf.abiSize()) or is_32): diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index 3231e60cea..59c72ce580 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -158,7 +158,8 @@ def elf_machine_to_string(machine): 0x2A: "SuperH", 0x32: "IA-64", 0x3E: "x86-64", - 0xB7: "AArch64" + 0xB7: "AArch64", + 0xF7: "BPF" }[machine] except: return "Unknown (%s)" % repr(machine) diff --git a/meta/lib/oeqa/selftest/cases/oelib/elf.py b/meta/lib/oeqa/selftest/cases/oelib/elf.py index 74ee6a11cc..15c03f4609 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/elf.py +++ b/meta/lib/oeqa/selftest/cases/oelib/elf.py @@ -15,6 +15,7 @@ class TestElf(TestCase): self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64") self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64") self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64") + self.assertEqual(oe.qa.elf_machine_to_string(0xF7), "BPF") self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)") self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")