From patchwork Mon Dec 12 15:37:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Hunleth X-Patchwork-Id: 1715066 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NW5PF336kz23pD for ; Tue, 13 Dec 2022 02:38:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 34294401D3; Mon, 12 Dec 2022 15:38:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 34294401D3 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ps3wXf_bVR9S; Mon, 12 Dec 2022 15:38:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0C384404ED; Mon, 12 Dec 2022 15:38:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0C384404ED X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id E44BD1BF2B4 for ; Mon, 12 Dec 2022 15:38:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3BBF960D94 for ; Mon, 12 Dec 2022 15:38:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3BBF960D94 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 49qe5FhgTE9x for ; Mon, 12 Dec 2022 15:37:59 +0000 (UTC) X-Greylist: delayed 00:05:07 by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F163A60D5B Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) by smtp3.osuosl.org (Postfix) with ESMTPS id F163A60D5B for ; Mon, 12 Dec 2022 15:37:58 +0000 (UTC) Date: Mon, 12 Dec 2022 15:37:46 +0000 To: buildroot@buildroot.org Message-ID: <20221212153705.1807269-1-fhunleth@troodon-software.com> Feedback-ID: 38965776:user:proton MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troodon-software.com; s=protonmail3; t=1670859471; x=1671118671; bh=l062rbeK0Lu/zWnX92D4x08qlk2qSSluKCP9vRWaqog=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=RwaUs+yBPWOfSFuhMQjxXXhutxshJBXWPRtskosreTGJL9ART1J+tqqOccK5AkBQm B8dnF+IXjroWvuptEHHSJjLHgI+ervMiOLqJWNnpcyJTPZAy6TIYkVgP+BcWKyZn1B WoxTEbAMlTF0QOUk8QvF7idScrDn4I4LzVM6H4pUZ+MbNft1MjAyboxO51RcAmR05D ABMCGwJO7MazxLsSDlWvL/A0nN8CSpXqvaWctdzYrIOC5xZynfpbf2VQAMyZH6O1Ej gtR0jLmlXyG7oZqd7f5FfYPz5iTwvNder4qBjQX+ilTwpDrK34Yi2xbtTHar2IJl9q Qv/1crpYZV4JQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=troodon-software.com header.i=@troodon-software.com header.a=rsa-sha256 header.s=protonmail3 header.b=RwaUs+yB Subject: [Buildroot] [PATCH 1/1] toolchain-external: refine support library search to lib directory X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Frank Hunleth via buildroot From: Frank Hunleth Reply-To: Frank Hunleth Cc: Thomas Petazzoni , Romain Naour , Giulio Benetti , Thomas De Schampheleire Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" This fixes an issue where gcc support libraries like libstdc++.so and libatomic.so were not copied to the target for a Crosstool-NG RISC-V glibc toolchain. The Crosstool-NG's toolchain's sysroot looks like this (trimmed): sysroot ├── lib │   ├── ld-linux-riscv64-lp64d.so.1 │   ├── libatomic.a │   ├── libatomic.so -> libatomic.so.1.2.0 │   ├── libatomic.so.1 -> libatomic.so.1.2.0 │   ├── libatomic.so.1.2.0 │   ├── libgcc_s.so │   ├── libgcc_s.so.1 │   ├── libstdc++.a │   ├── libstdc++.so -> libstdc++.so.6.0.29 │   ├── libstdc++.so.6 -> libstdc++.so.6.0.29 │   ├── libstdc++.so.6.0.29 │   └── libsupc++.a ├── lib64 │   └── lp64d │   ├── libanl.so.1 │   ├── libc.so.6 │   ├── libdl.so.2 │   ├── libm.so.6 │   ├── libnsl.so.1 │   ├── libpthread.so.0 │   ├── libresolv.so.2 │   ├── librt.so.1 │   ├── libthread_db.so.1 │   └── libutil.so.1 Without this patch, only the files in `lib64/lp64d` are copied to the target since this is the $ARCH_LIB_DIR. $SUPPORT_LIB_DIR is empty since libstdc++.a is in the sysroot. It's just not under $ARCH_LIB_DIR. Based on the comments, it looks like $SUPPORT_LIB_DIR was intended for the case when the support libraries were somewhere completely outside of the sysroot. Anywhere outside of $ARCH_LIB_DIR would seem to have the same effect of being missed by the copy, though. See the following link for the RISC-V Crosstool-NG configuration: https://github.com/crosstool-ng/crosstool-ng/blob/7f80447c5f66f588e57eb3da087b27eb2b0c8eec/samples/riscv64-unknown-linux-gnu/crosstool.config Signed-off-by: Frank Hunleth --- toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.34.1 diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 299b6008aa..4070cfdc1f 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -435,7 +435,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ SUPPORT_LIB_DIR="" ; \ - if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \ + if test `find $${ARCH_LIB_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \ LIBSTDCPP_A_LOCATION=$$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \ if [ -e "$${LIBSTDCPP_A_LOCATION}" ]; then \ SUPPORT_LIB_DIR=`readlink -f $${LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \