From patchwork Sun Jun 18 20:11:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 777503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wrQHt5k1Xz9s3w for ; Mon, 19 Jun 2017 06:12:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 644DA8363A; Sun, 18 Jun 2017 20:12:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RZLVG7YTde-b; Sun, 18 Jun 2017 20:12:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7B34E836F7; Sun, 18 Jun 2017 20:12:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0ED801BFE2E for ; Sun, 18 Jun 2017 20:12:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 09E1083634 for ; Sun, 18 Jun 2017 20:12:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dHG3EJyt9Qny for ; Sun, 18 Jun 2017 20:12:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by fraxinus.osuosl.org (Postfix) with ESMTP id DA479836F7 for ; Sun, 18 Jun 2017 20:12:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id A137921DE1; Sun, 18 Jun 2017 22:12:03 +0200 (CEST) Received: from localhost (LFbn-1-6691-76.w90-120.abo.wanadoo.fr [90.120.129.76]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7A55621DC8; Sun, 18 Jun 2017 22:12:03 +0200 (CEST) From: Thomas Petazzoni To: Buildroot List Date: Sun, 18 Jun 2017 22:11:57 +0200 Message-Id: <20170618201157.1930-1-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.9.4 Cc: Florent Jacquet , Thomas Petazzoni Subject: [Buildroot] [PATCH] toolchain-external: adjust logic for musl dynamic linker symlink 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" This commit changes the strategy to know what symlink should be created for the musl dynamic linker. For now, we have in Buildroot the logic to decide what the symlink name should be. However, despite numerous fixes, there are still some cases that are missing, such as mips64el-n32, where the symlink is ld-musl-mipsn32el.so.1. So, instead of trying to make Buildroot aware of all the possible names, simply get it from the external toolchain. Signed-off-by: Thomas Petazzoni --- toolchain/toolchain-external/pkg-toolchain-external.mk | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 856be65..83bfc13 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -477,21 +477,10 @@ endef # 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_mips):$(BR2_SOFT_FLOAT),y:y) -MUSL_ARCH = mips-sf -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 + SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + LD_MUSL_SYMLINK="`basename $${SYSROOT_DIR}/lib/ld-musl*.so*`" ; \ + ln -sf libc.so $(TARGET_DIR)/lib/$${LD_MUSL_SYMLINK} endef endif