From patchwork Thu Sep 20 03:52:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 147083 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1473264ljw; Wed, 19 Sep 2018 20:53:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTJI1uxv6dUM4yKoS69gZ0XTWlcIYl6g84nvmHvXc0kUjHtlsm6UgjfazWNN7JiaqLl8An X-Received: by 2002:a63:8241:: with SMTP id w62-v6mr33238890pgd.230.1537415582685; Wed, 19 Sep 2018 20:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537415582; cv=none; d=google.com; s=arc-20160816; b=aWKROSYLADrprBDiUphF94iyAjvz0U56kPGZ8GDGbDe07Bf8X0Mcl7KZh0U36onXAV IdPdHlZdXsfHKCEkQYe9Aw0imO3tm168HwIWSLznbx5y+YWUTv9iytBKLZwPR4vpA4BO Jr5gbw0nK1rbLFaKXoIdWo7W66t/7UkC8Mr4lxDgGDh2xMd7jmm/9/mXJOPDjoVvqWic 3p3QQ7b88hN9y3Zl+whVHI/W8sWTuNUjL690JL6DJ1rTI+HpNLy8Y91u3YzaKTV1J7YK pQbRBJlAYLqRtab0JqDAZ0X1P+TQN2QoyHotKRgqSpoOXLX4hZbOUBt6o96/bXu2DfiT fYGg== 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=/rQzZe1XC/T2AsyO5aSdwLqiwzcc3AkySl3o+70BnMI=; b=N7IrCnuTblU1L95PEMcOVFwwoQXyS8MxAiG6zKHXbdyBmmnoPyIS1bM2qWGX7PLS0u fUcJxep5om+xcM1dtAEtjO0JeUbmN0MRfF4CZHIM1aMvN4vwXAbukPSKcG2LKq/k5f+y edkJYwHIVOUGWI8CxTTJxD4/pyCmxi6sKmOYIcdJ69uUBrqArPNO7tb4rsFNkVe8EJCD b6P3MpZA01eowVCAKDRYdbc7JnxjjBZ5cO35AtQtEs9hXglJ/uVUNPmYtDnIM/hpg7Bj su5UkCs4rgdb0Gkx68jEP5BAhhNOAZVXeBXw6NXcDcTCIEsYbDkvOBqO80oK9TkevTOL W63w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=inu3VRc5; 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 i128-v6si24063911pfg.93.2018.09.19.20.53.01; Wed, 19 Sep 2018 20:53:02 -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=inu3VRc5; 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 7FED779837; Thu, 20 Sep 2018 03:52:55 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mail.openembedded.org (Postfix) with ESMTP id 11E9860800 for ; Thu, 20 Sep 2018 03:52:53 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id l63-v6so3739411pga.7 for ; Wed, 19 Sep 2018 20:52:55 -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=SX+erauX2QpARFBv0JaBuWO0/AtYTq+8oI7Da2gX74Q=; b=inu3VRc5GF7ysM6yfNivewRdq4FEo7PVLRmwd4HWkpUsXhVPPrpVElR/+t2g+chgTn 0VAwklbpO9/fuLTw6rIpjw9DFPIekrqsWSo4I8CXDi/dJlviLIQgzVTv3B51DomJeNtP LG5Dfdw29MauffGmEOG84lXQ59KXE/yr7H9zX8xprNFHjgxsw4RO6y0U6mo03wznc2LG LaKXZ4c+7WgPzxdBn/QB18ZxGTIUCQDDyn0J9uOQ/joXlCFCv5njA32g7WUcObSX23vT 3NhjmhXGoIYDA+E9OD+s5TusTTckz7Ec4EfD0e0csj+qUaQ4mqyjHmqIJZSt2o1VLeG6 lTuQ== 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=SX+erauX2QpARFBv0JaBuWO0/AtYTq+8oI7Da2gX74Q=; b=BHnrC/DhyNLHixp5yTR0P+EX0jcCDKHjYfXDh/cFVqdsJZHIzwBi28RcqqZwyoygEs 5UOa6HPUEIkRHdfi8QTRoNFe9zO/gu7B32sYch+MJfX2M/83QCLe5BxLKqie4XaUset7 ZtmD2uVGT3rJN+c+8gAD5vd2F3h8vPFIz5nqjii1WIZm2f4LkykCmNJTFytJ6R/GYXQs 7jdUCLjHGuOCezM/5HcLv4vEQXsGKMn3oDnJ62UoaxVa4cHCsWbtgzsfa7gAo+TfLd2a by2D7er6nqtyULGhx/QLjobF2pcpAJMUPtmTXeeF9OGZB12yLVg8Kmdni4sLnvVNcFhH d57A== X-Gm-Message-State: APzg51DEs0CJn4cBBA2ntLYz+mFrDzr1ihNkUgYpKEZ9iTRcWRzQzktt n9lvF7Px1fWHCOvPdhYTQChNCl4T2k8= X-Received: by 2002:a62:6781:: with SMTP id t1-v6mr39045928pfj.200.1537415574316; Wed, 19 Sep 2018 20:52:54 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::b1b1]) by smtp.gmail.com with ESMTPSA id a20-v6sm52640309pfc.14.2018.09.19.20.52.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 20:52:53 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 19 Sep 2018 20:52:41 -0700 Message-Id: <20180920035242.983-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [OE-core] [PATCH 1/2] linuxloader.bbclass: Refactor to have seprate functions for musl/glibc loader 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 this makes it possible to use this for musl where we are trying to create a glibc compat package Add missing aarch64 loader definition for glibc function Signed-off-by: Khem Raj --- meta/classes/linuxloader.bbclass | 85 ++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 36 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/linuxloader.bbclass b/meta/classes/linuxloader.bbclass index e1364a4e55..b4c413494a 100644 --- a/meta/classes/linuxloader.bbclass +++ b/meta/classes/linuxloader.bbclass @@ -1,48 +1,61 @@ -def get_linuxloader(d): +def get_musl_loader(d): + import re + dynamic_loader = None + + targetarch = d.getVar("TARGET_ARCH") + if targetarch.startswith("microblaze"): + dynamic_loader = "${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1" + elif targetarch.startswith("mips"): + dynamic_loader = "${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1" + elif targetarch == "powerpc": + dynamic_loader = "${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1" + elif targetarch == "powerpc64": + dynamic_loader = "${base_libdir}/ld-musl-powerpc64.so.1" + elif targetarch == "x86_64": + dynamic_loader = "${base_libdir}/ld-musl-x86_64.so.1" + elif re.search("i.86", targetarch): + dynamic_loader = "${base_libdir}/ld-musl-i386.so.1" + elif targetarch.startswith("arm"): + dynamic_loader = "${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1" + elif targetarch.startswith("aarch64"): + dynamic_loader = "${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1" + return dynamic_loader + +def get_glibc_loader(d): import re + dynamic_loader = None targetarch = d.getVar("TARGET_ARCH") + if targetarch in ["powerpc", "microblaze"]: + dynamic_loader = "${base_libdir}/ld.so.1" + elif targetarch in ["mipsisa32r6el", "mipsisa32r6", "mipsisa64r6el", "mipsisa64r6"]: + dynamic_loader = "${base_libdir}/ld-linux-mipsn8.so.1" + elif targetarch.startswith("mips"): + dynamic_loader = "${base_libdir}/ld.so.1" + elif targetarch == "powerpc64": + dynamic_loader = "${base_libdir}/ld64.so.1" + elif targetarch == "x86_64": + dynamic_loader = "${base_libdir}/ld-linux-x86-64.so.2" + elif re.search("i.86", targetarch): + dynamic_loader = "${base_libdir}/ld-linux.so.2" + elif targetarch == "arm": + dynamic_loader = "${base_libdir}/ld-linux.so.3" + elif targetarch.startswith("aarch64"): + dynamic_loader = "${base_libdir}/ld-linux-aarch64${ARMPKGSFX_ENDIAN_64}.so.1" + return dynamic_loader + +def get_linuxloader(d): overrides = d.getVar("OVERRIDES").split(":") - # No loader for baremetal if "libc-baremetal" in overrides: return None - dynamic_loader = None if "libc-musl" in overrides: - if targetarch.startswith("microblaze"): - dynamic_loader = "${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1" - elif targetarch.startswith("mips"): - dynamic_loader = "${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1" - elif targetarch == "powerpc": - dynamic_loader = "${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1" - elif targetarch == "powerpc64": - dynamic_loader = "${base_libdir}/ld-musl-powerpc64.so.1" - elif targetarch == "x86_64": - dynamic_loader = "${base_libdir}/ld-musl-x86_64.so.1" - elif re.search("i.86", targetarch): - dynamic_loader = "${base_libdir}/ld-musl-i386.so.1" - elif targetarch.startswith("arm"): - dynamic_loader = "${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1" - elif targetarch.startswith("aarch64"): - dynamic_loader = "${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1" + dynamic_loader = get_musl_loader(d) else: - # glibc - if targetarch in ["powerpc", "microblaze"]: - dynamic_loader = "${base_libdir}/ld.so.1" - elif targetarch in ["mipsisa32r6el", "mipsisa32r6", "mipsisa64r6el", "mipsisa64r6"]: - dynamic_loader = "${base_libdir}/ld-linux-mipsn8.so.1" - elif targetarch.startswith("mips"): - dynamic_loader = "${base_libdir}/ld.so.1" - elif targetarch == "powerpc64": - dynamic_loader = "${base_libdir}/ld64.so.1" - elif targetarch == "x86_64": - dynamic_loader = "${base_libdir}/ld-linux-x86-64.so.2" - elif re.search("i.86", targetarch): - dynamic_loader = "${base_libdir}/ld-linux.so.2" - elif targetarch == "arm": - dynamic_loader = "${base_libdir}/ld-linux.so.3" - + dynamic_loader = get_glibc_loader(d) return dynamic_loader -get_linuxloader[vardepvalue] = "${@get_linuxloader(d)}" +get_linuxloader[vardepvalue] = "${@get_linuxloader(d)}" +get_musl_loader[vardepvalue] = "${@get_musl_loader(d)}" +get_glibc_loader[vardepvalue] = "${@get_glibc_loader(d)}"