From patchwork Sun Apr 18 18:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Mazovetskiy X-Patchwork-Id: 1467650 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fZDh6WXx; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FNdwH2Kpqz9vG3 for ; Mon, 19 Apr 2021 04:37:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4881D400F7; Sun, 18 Apr 2021 18:37:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aPdEZeXPd2VY; Sun, 18 Apr 2021 18:37:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 9D345400EF; Sun, 18 Apr 2021 18:37:14 +0000 (UTC) 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 0F3391BF5DF for ; Sun, 18 Apr 2021 18:37:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F283D606BD for ; Sun, 18 Apr 2021 18:37:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 6Kfis_d7aJIc for ; Sun, 18 Apr 2021 18:37:09 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0699C60676 for ; Sun, 18 Apr 2021 18:37:08 +0000 (UTC) Received: by mail-ej1-x632.google.com with SMTP id n2so49480477ejy.7 for ; Sun, 18 Apr 2021 11:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jmAqzw/GzlVVW8743+lMjnt5WXrS8nyoqN4DS609hsA=; b=fZDh6WXxf7HAjxx3UoVzTzaDxL2ItNBRMkfebwX29KHXH2OuCIkdM0RbDnjWtQWndR KXTxzhCSjdEVOujuT/QBEZRYhA2gx8Gvty9IXsjZ84l6GznAhcQBTPC411ejWqdC8/AA c1tYnXCITR4jjKo1JMuf9L3lZC00PjY36ndFu89YKVqIrgpoFFqMDMo31PGCxaziSmKS dU9hQfFG8KPHi2Cr4xrWL4P64H1rsg1UDXsjjEYuSkDB0HsHB/r1CueaZDj+3HTBm34k Dqbska8ZbMU1ESjYn9IlT/EPQfXPfYJhFPwPhIR+z80RbZ+/90ZXeniQby+HKvbD+6H1 3dJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jmAqzw/GzlVVW8743+lMjnt5WXrS8nyoqN4DS609hsA=; b=MSMY851qO0eZfBz4WUqVdIA1+8ASt97bj16Uw/iHDFSgsH+ZX03Kb04UJ/7fIIR1KZ 2btD95MG7U2fnOUDQrUMe2aCWwzJ6I3o73WWHIilFMWzbGWxEmh1n0Pcw0hvDtwrVKeQ itWDxkaYcS10IWBREHBTBkWW8E/E6/JEfbrXpg+zgRKhA6EJ9jTUCMjEDZ4TkfH0p9d9 WWZW5VKtp4R5xbKBGzhKDzH8WKRetpCwvcgAIC3FSrugudLdCzi8bxeQzPUPg4LzckH+ /B5K3EqMJd9dFUOGmSV0NZzcRIppa5hQREy9bashikCwnP+8Mo0geTMheGUZXcPuoPZ/ ntZw== X-Gm-Message-State: AOAM532ZKcCB4/GFAPaZgvyMItOzIxRB5iIJlJjZSYqo1DJHY+ASr7Ub AF7t0EUewzyWIq5SqrGk/vLAkUG78+N6pw== X-Google-Smtp-Source: ABdhPJzgNJwEouMFsVU0SgxXRW5Jo+OoDWjc+VVqR7FtWILjqJjKbxMJHjTO4r+yiMOplZUUFY4ZkQ== X-Received: by 2002:a17:906:c30d:: with SMTP id s13mr18746630ejz.68.1618771026965; Sun, 18 Apr 2021 11:37:06 -0700 (PDT) Received: from localhost (cpc76906-dals22-2-0-cust400.20-2.cable.virginm.net. [81.106.81.145]) by smtp.gmail.com with ESMTPSA id k14sm3870570edr.75.2021.04.18.11.37.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Apr 2021 11:37:06 -0700 (PDT) From: Gleb Mazovetskiy To: buildroot@buildroot.org Date: Sun, 18 Apr 2021 19:36:58 +0100 Message-Id: <20210418183658.1675843-1-glex.spb@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/valgrind: Add a setting for LTO build X-BeenThere: buildroot@busybox.net 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: , Cc: Gleb Mazovetskiy Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Valgrind LTO build takes over an hour on my Ryzen 3950x. This is not always worth it for the ~10% size reduction and a small performance improvement it offers (see https://www.valgrind.org/docs/manual/dist.news.html) Adds a new `BR2_VALGRIND_ENABLE_LTO` setting to control LTO enablement for Valgrind separately from the global BR2_GCC_ENABLE_LTO setting. Signed-off-by: Gleb Mazovetskiy --- package/valgrind/Config.in | 10 ++++++++++ package/valgrind/valgrind.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package/valgrind/Config.in b/package/valgrind/Config.in index 56e4af21fa..eff54e7949 100644 --- a/package/valgrind/Config.in +++ b/package/valgrind/Config.in @@ -84,4 +84,14 @@ config BR2_PACKAGE_VALGRIND_NULGRIND help This option allows to install the Nulgrind tool +if BR2_GCC_ENABLE_LTO + +config BR2_VALGRIND_ENABLE_LTO + bool "Build Valgrind with link-time optimization" + help + This produces a faster / smaller valgrind (up to 10%) at the cost + of massively increased build time (can be over an hour). + +endif + endif diff --git a/package/valgrind/valgrind.mk b/package/valgrind/valgrind.mk index b87e1e518f..07fb1f7d42 100644 --- a/package/valgrind/valgrind.mk +++ b/package/valgrind/valgrind.mk @@ -50,7 +50,7 @@ VALGRIND_CONF_OPTS += \ --host=$(patsubst arm-%,armv7-%,$(GNU_TARGET_NAME)) endif -ifeq ($(BR2_GCC_ENABLE_LTO),y) +ifeq ($(BR2_VALGRIND_ENABLE_LTO),y) VALGRIND_CONF_OPTS += --enable-lto else VALGRIND_CONF_OPTS += --disable-lto