From patchwork Fri Feb 20 22:05:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 442141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 288C6140119 for ; Sat, 21 Feb 2015 09:05:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D45EE922EE; Fri, 20 Feb 2015 22:05:34 +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 MEFDoAD37od1; Fri, 20 Feb 2015 22:05:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id CB4EE927C2; Fri, 20 Feb 2015 22:05:33 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7DC551C2276 for ; Fri, 20 Feb 2015 22:05:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7896D927C2 for ; Fri, 20 Feb 2015 22:05:32 +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 xHKu8KBiWDtI for ; Fri, 20 Feb 2015 22:05:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 904ED922EE for ; Fri, 20 Feb 2015 22:05:31 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id b13so15630208wgh.0 for ; Fri, 20 Feb 2015 14:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=SRaWy4vEueG5K8VbbD/BE8KiPocbUZ8ympbxaYAWnSk=; b=wtYVVobIZhiSNle1QXHJ1EYGp4lvQWCPTosKWaWUjqBeynx1edleolj5fCxXG7O9Sr O1TJ7bFZWwL4AeHmv8aGcO0Fg0Rh8hrNBFIII9b6N3aF9em/fN4BajcMiBI032Ct2meM feTA89bJrXI3uyhPxHSNMHm31l/E8l69QOfEHF3BOfswdq+lzVTLepdaMQYxaFPDCA53 QGL1V4eAcp4ls6NWSKd2rjIds6tj3kkuDuoDEl63glEvn5j28XCToWxMUxA038vro4ra 3inZx3CURdS7DYIyf4G3VLmkB1a1VlO8Et2avkcfI2eES6oF937Lu5zmV/MCBwvDADil hhHw== X-Received: by 10.194.82.136 with SMTP id i8mr21881380wjy.99.1424469930011; Fri, 20 Feb 2015 14:05:30 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by mx.google.com with ESMTPSA id v5sm4196592wiw.24.2015.02.20.14.05.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Feb 2015 14:05:28 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 20 Feb 2015 23:05:22 +0100 Message-Id: <1424469922-6306-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH] toolchain: fix installing gconv libs with multi-arch toolchain 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" For a multi-arch toolchain, gconv modules are in a sub-directory named after the machine gcc targets. This is the case, for example, for the Linaro ARM 2014.09 toolchain, wihch has the gconv modules in (relative to the sysroot): /usr/lib/arm-linux-gnueabihf/gconv while the Sourcery CodeBench ARM 2014.05 (non-multi-arch) has them in: /usr/lib/gconv So, to catter for both cases, search both paths. We want to favour the machine-specific gconv modules over potentially existign "genereic" ones, so we first search that (if it exists) and fallback to looking in the generic location. Signed-off-by: "Yann E. MORIN" --- toolchain/toolchain.mk | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/toolchain/toolchain.mk b/toolchain/toolchain.mk index 3f9900b..f43b8f9 100644 --- a/toolchain/toolchain.mk +++ b/toolchain/toolchain.mk @@ -18,11 +18,20 @@ ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y) GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST)) define COPY_GCONV_LIBS $(Q)if [ -z "$(GCONV_LIBS)" ]; then \ - $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/gconv-modules \ - $(TARGET_DIR)/usr/lib/gconv/gconv-modules; \ - $(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/gconv/*.so \ - $(TARGET_DIR)/usr/lib/gconv \ - || exit 1; \ + found_gconv=no; \ + machine=$$($(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -dumpmachine); \ + for d in $${machine} ''; do \ + [ -d "$(STAGING_DIR)/usr/lib/$${d}/gconv" ] || continue; \ + $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/$${d}/gconv/gconv-modules \ + $(TARGET_DIR)/usr/lib/gconv/gconv-modules && \ + $(INSTALL) -m 0644 $(STAGING_DIR)/usr/lib/$${d}/gconv/*.so \ + $(TARGET_DIR)/usr/lib/gconv \ + || exit 1; \ + [ -z "$${d}" ] || ln -sf . $(TARGET_DIR)/usr/lib/$${d}; \ + found_gconv=yes; \ + done; \ + [ "$${found_gconv}" = "yes" ] \ + || { printf "Unable to find gconv modules\n" >&2; exit 1; } \ else \ for l in $(GCONV_LIBS); do \ $(INSTALL) -m 0644 -D $(STAGING_DIR)/usr/lib/gconv/$${l}.so \