From patchwork Sun Oct 23 20:48:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 685612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t2BRC2Bs0z9t35 for ; Mon, 24 Oct 2016 07:51:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Q2hJIFnN; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C4BBD90DF1; Sun, 23 Oct 2016 20:51:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QWKJB78kwAZc; Sun, 23 Oct 2016 20:51:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2646891454; Sun, 23 Oct 2016 20:49:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 94D151CF6DC for ; Sun, 23 Oct 2016 20:49:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 907452A233 for ; Sun, 23 Oct 2016 20:49:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1RhZg5DyMeg3 for ; Sun, 23 Oct 2016 20:49:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by silver.osuosl.org (Postfix) with ESMTPS id BFF091FCB5 for ; Sun, 23 Oct 2016 20:49:05 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id d199so7013205wmd.1 for ; Sun, 23 Oct 2016 13:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pNmmt7VxsbiVtPrrwPI7pe7AmYnHstKzbngdUlitJnw=; b=Q2hJIFnNrux/kK7wseIGYG2vxW2SAwxbEHvITv1oD+H6yYDLW7rizb04wKhfiQ2emn RZxAwt7FawbIKpfBmPxSArobWMBiPyuVU49zaJUxlyS0GkLt6DuTatsyQGpj6/I6ryeh 5bkiCE+y7zg8+7aQ0eCzevsPuVaVCUIGoYK6Azc5XJ6N0b8zuxi457SL7JcYJ6LJUlSM I1l0gx2GxSA0HYEMncAo1sY8l4B/Bzaa8I9gp0aklwrjZ9O4VKsLBrqgzMsXLUrROdWU xlp5cVrNanz7Ay7/lIU2fBBsSp2tgwsn6inJlLIi0Kv+YH4ynn+DgqEU3gPVaNHq+l5M XNeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pNmmt7VxsbiVtPrrwPI7pe7AmYnHstKzbngdUlitJnw=; b=MaJWjbZR/HOGOIUGCmSX1/I9XR83uL4Fp4GYDjTIM3MdI2jiHlz95RvX3lfZBI8n+5 6Kd4OalMfbM2NhhB6ibeI9FFlGSq/Kt9xpkrslK00x0SHguWm8qXFsqWVrB3B4ywIS2/ W6q5l65gytwlUR9vzUdpEcoTVJxdk6WR1F+1fXpCidSL604Rh8pVa3brj/pX9mVINXAo +B05vM7GoLNxROxou/g5XdQu58l+ub4wJY8Tq8ssQJU4cb6UfCS2vRVfNtPELYgu+5lT 0m6rQtD0hfQ1oJetv2puahQBrkDTOHr/OFaQ1G98x2uBYHSEohT8Bp4g61+nFWF7Vr86 gs1Q== X-Gm-Message-State: AA6/9RnAXt2udI9xgUTvz9s3rSYm47RFB0lGMRqZST7eZiRp7VW/fsM62DbWkUcPWDB5GQ== X-Received: by 10.28.165.78 with SMTP id o75mr18403871wme.59.1477255744268; Sun, 23 Oct 2016 13:49:04 -0700 (PDT) Received: from atlas.localdomain.localdomain (gam75-1-81-57-22-125.fbx.proxad.net. [81.57.22.125]) by smtp.gmail.com with ESMTPSA id f17sm10987182wmf.10.2016.10.23.13.49.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Oct 2016 13:49:03 -0700 (PDT) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 23 Oct 2016 22:48:28 +0200 Message-Id: <1477255711-28603-28-git-send-email-romain.naour@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477255711-28603-1-git-send-email-romain.naour@gmail.com> References: <1477255711-28603-1-git-send-email-romain.naour@gmail.com> Cc: Romain Naour Subject: [Buildroot] [PATCH 27/30] toolchain/toolchain-external: move musl specific logic into a separate file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Use pkg-toolchain-external-musl.mk for the definition of various variables: Set MUSL_ARCH to create a symbolic link to libc.so and add a dependency to musl-compat-headers package Signed-off-by: Romain Naour --- .../pkg-toolchain-external-musl.mk | 34 ++++++++++++++++++++++ toolchain/toolchain-external/toolchain-external.mk | 31 -------------------- 2 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 toolchain/toolchain-external/pkg-toolchain-external-musl.mk diff --git a/toolchain/toolchain-external/pkg-toolchain-external-musl.mk b/toolchain/toolchain-external/pkg-toolchain-external-musl.mk new file mode 100644 index 0000000..dbe07a0 --- /dev/null +++ b/toolchain/toolchain-external/pkg-toolchain-external-musl.mk @@ -0,0 +1,34 @@ +# +# This file contains various utility functions used by the external +# toolchain based on musl. +# + +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. +# So, add the musl-compat-headers package that will install those files, +# into the staging directory: +# sys/queue.h: header from NetBSD +# sys/cdefs.h: minimalist header bundled in Buildroot +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers +endif + +# With the musl C library, the libc.so library directly plays the role +# of the dynamic library loader. We just need to create a symbolic +# link to libc.so with the appropriate name. +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y) +ifeq ($(BR2_i386),y) +MUSL_ARCH = i386 +else ifeq ($(BR2_ARM_EABIHF),y) +MUSL_ARCH = armhf +else ifeq ($(BR2_mipsel):$(BR2_SOFT_FLOAT),y:y) +MUSL_ARCH = mipsel-sf +else ifeq ($(BR2_sh),y) +MUSL_ARCH = sh +else +MUSL_ARCH = $(ARCH) +endif +define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK + ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1 +endef +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_MUSL_LD_LINK +endif diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index cb63dd2..8aeb610 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -146,16 +146,6 @@ TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += \ -DBR_CROSS_PATH_REL='"$(TOOLCHAIN_EXTERNAL_BIN:$(HOST_DIR)/%=%)"' endif - -# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. -# So, add the musl-compat-headers package that will install those files, -# into the staging directory: -# sys/queue.h: header from NetBSD -# sys/cdefs.h: minimalist header bundled in Buildroot -ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) -TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers -endif - # The Codescape toolchain uses a sysroot layout that places them # side-by-side instead of nested like multilibs. A symlink is needed # much like for the nested sysroots which are handled in @@ -400,27 +390,6 @@ define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_toolchain_ssp,$(TOOLCHAIN_EXTERNAL_CC)) endef -# With the musl C library, the libc.so library directly plays the role -# of the dynamic library loader. We just need to create a symbolic -# link to libc.so with the appropriate name. -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y) -ifeq ($(BR2_i386),y) -MUSL_ARCH = i386 -else ifeq ($(BR2_ARM_EABIHF),y) -MUSL_ARCH = armhf -else ifeq ($(BR2_mipsel):$(BR2_SOFT_FLOAT),y:y) -MUSL_ARCH = mipsel-sf -else ifeq ($(BR2_sh),y) -MUSL_ARCH = sh -else -MUSL_ARCH = $(ARCH) -endif -define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK - ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1 -endef -TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_MUSL_LD_LINK -endif - # Special installation target used on the Blackfin architecture when # FDPIC is not the primary binary format being used, but the user has # nonetheless requested the installation of the FDPIC libraries to the