From patchwork Mon Jul 3 21:58:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 783661 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 3x1gxW6SDlz9s82 for ; Tue, 4 Jul 2017 07:58:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ApPHNDkw"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5352786D2E; Mon, 3 Jul 2017 21:58:19 +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 P1e_jHA6tZzp; Mon, 3 Jul 2017 21:58:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 32409866A1; Mon, 3 Jul 2017 21:58:17 +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 3501B1C20A3 for ; Mon, 3 Jul 2017 21:58:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2D83F24792 for ; Mon, 3 Jul 2017 21:58:13 +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 e+Gxv3uz4c4j for ; Mon, 3 Jul 2017 21:58:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by silver.osuosl.org (Postfix) with ESMTPS id C12322308F for ; Mon, 3 Jul 2017 21:58:11 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id p204so22922090wmg.1 for ; Mon, 03 Jul 2017 14:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=2/xZdLgpJJc7HwsOr0fGkzwaZ8MVoCnKbLE05q/isX0=; b=ApPHNDkw94Pu+KFe7Yb9Lb/Z5iS0w6DG6J/ZJRxUg5f7BS8R0AwtLP+nu4TJzhWUfX m07n7x0XvRDkZ6OHR3Aj3jqx7jtIdouWlrpXNE4X1XwPiXQopaaJM9YJl0PyDp91Aqe1 QEPkvM0QVSgVSFId6EOs9vP+JrWrTpIQVnZgiqZNdDqSukPnuOJuWO9URnTCGjMci+BW jqynCFEuQ2eOtSPvjSo+cCvMNPZH8s29IrVWb3LPRxv9eN1GIDdvpnWIfF7SFtqJHLgV GZVfbt1ZBZ3mw+Uxu9vQbYC4HVsFvW0K5/1JEbt9GqxXiOws5/BmDUoJZrJIIWqJwBJI anbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=2/xZdLgpJJc7HwsOr0fGkzwaZ8MVoCnKbLE05q/isX0=; b=EX8l7rJ++KxSu2eufP9e5yu/cuB7NYzFvtkmFY1T3HdgePdbNzMM4L1qcQ1aznOyib t1rFxXJNffLVjWdSKd2nqzsWIl9HMtu9Tf8rz35ji2rKNktLfexKCVhY14mfgnTeINFg WrC2WmCz/Q9LP6lBmb6DujkkWt15LTYtMHkxvxukOOfJkk1ZCqabJ22FlEKSKLYlzsCH ++BpRDML5xLPCGlxcrcnqkyRBg2ZfnAc1PNClWzzU2N51wRmF8uWNOvTJGDT3CK6FV9m BlpNtcUlAp2oxLcoEpNAcNrWIzeFW/gNXdiEDE4P31VwK/4rhVKdaohTWoUZ2MO3ONyA qW4w== X-Gm-Message-State: AKS2vOywttfy0spUMQvF9HH9mKn/f6prB2Pc/k+xZyjFGynfJaBPJNnl 6B9w6dgsgn212GkvzDY= X-Received: by 10.28.18.145 with SMTP id 139mr25069458wms.2.1499119089718; Mon, 03 Jul 2017 14:58:09 -0700 (PDT) Received: from dell.be.48ers.dk (ARennes-651-1-1-150.w86-215.abo.wanadoo.fr. [86.215.144.150]) by smtp.gmail.com with ESMTPSA id f14sm5603825wmd.9.2017.07.03.14.58.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 14:58:08 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.88) (envelope-from ) id 1dS9M7-0001dF-EN; Mon, 03 Jul 2017 23:58:07 +0200 From: Peter Korsgaard To: buildroot@buildroot.org, wg@grandegger.com Date: Mon, 3 Jul 2017 23:58:02 +0200 Message-Id: <20170703215803.6233-1-peter@korsgaard.com> X-Mailer: git-send-email 2.11.0 Subject: [Buildroot] [PATCH 1/2] gcc: gcc-final: install libsanitizer if available 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" Gcc builds libsanitizer (lib{a,l,t,u}san) for -fsanitize={address,thread,leak,undefined} if the needed dependencies are available: - Glibc - C++ support - A supported architecture (see libsanitizer/configure.tgt) So install these into target + staging if available to support -fsanitize. Notice that this grows the target fs with close to 2MB on architectures where all variants are supported. From a x86-64 build: ls -lahS target/lib/lib?san.so.?.0.0 -rwxr-xr-x 1 peko peko 950K Jul 3 23:51 target/lib/libasan.so.3.0.0 -rwxr-xr-x 1 peko peko 719K Jul 3 23:51 target/lib/libtsan.so.0.0.0 -rwxr-xr-x 1 peko peko 229K Jul 3 23:51 target/lib/liblsan.so.0.0.0 Signed-off-by: Peter Korsgaard --- package/gcc/gcc-final/gcc-final.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index e8d2e18fe5..b9ea628ae9 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -147,6 +147,15 @@ endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBATOMIC +define HOST_GCC_FINAL_INSTALL_LIBSANITIZER + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/lib?san* \ + $(STAGING_DIR)/lib/ + -cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/lib?san* \ + $(TARGET_DIR)/lib/ +endef + +HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBSANITIZER + # Handle the installation of libraries in /usr/lib HOST_GCC_FINAL_USR_LIBS =