Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp456708rdb; Tue, 16 Jan 2024 05:52:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoS6Ox1d9ZlEoUIdPeokijFnaNfOQBWJHVok33ZZgDz6qQlbe1Fp53TgezqK+MiL0wY5MA X-Received: by 2002:a17:90a:bb83:b0:28e:5879:7ea5 with SMTP id v3-20020a17090abb8300b0028e58797ea5mr1483053pjr.71.1705413165882; Tue, 16 Jan 2024 05:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705413165; cv=none; d=google.com; s=arc-20160816; b=F+0a4getCFdms9dFwL3C+IZaX2JAH2T1fKLMzTOQbksgliS4tzySMPGF89S2yJNJz9 J0Fg9XSirh07Wyt8KOwHsFG8BrZggT1y/pRijEV4obDQpwBxWIWsYHYhvnFhKtPI/xjr KqyJ+aJP9csnhapD5OHkNUKbGxANs/AHk8uKzdx07VCuLmV2YQfbSsLujEAwgcvRMztz 8VjsOZqjh5ny7dU77TobGsSfN7/pOFoeIJN+BVoKvIZuAOUfRy9238ovgtQ8+ltD4Ql2 ceBCbjk2HkhMgd/VglECd5PPerRQ6V05CNLoTQTKfv3RBtJ1GNYLcH7IUBRZQkLomwmK yjug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=SB8Nv6TjXlzov5rdM760En+1TYrMKbc1HLuZicmkl34=; fh=wm3knQjNzlzhSYO3l6/R1dJNTO7aXLaAzT309a/t7Bw=; b=akaasif7pWFHJhijZ1R+98mrMXUW8ARHOv6ZYuuuoagzVedOWDuQ2usD/PXbKjySTC lACBwN0Lu7wguMCnlA93qdn8PQlE8aaisW+kJxUGx3f647j4IVXFcQ9Zw94rqJI5a8WW HTTCDpzZmoESohWaOr/ThGzHbqM2/RdTblvjplHk2kazDmrlRP6xkv4eVGvXdkt9VW2y t8gK4mt5+dxGaVtCg+Bc6wGEw5ZBDpyfiagLaw8PCnj/KSsVIxePcjq4xBE6jdeJDSYk et06+GlGY8ZsT2+wDGYhTYnqSjQdNiSzdsQigy4F6Gi4aP3u64+bQdF1LTo9PzmbyGA+ Mykg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=katrSkco; spf=pass (google.com: domain of linux-bluetooth+bounces-1094-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1094-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id pf16-20020a17090b1d9000b0028d13644574si11716229pjb.165.2024.01.16.05.52.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 05:52:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1094-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=katrSkco; spf=pass (google.com: domain of linux-bluetooth+bounces-1094-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1094-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8B2ED285DC5 for ; Tue, 16 Jan 2024 13:52:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 451EE1BF59; Tue, 16 Jan 2024 13:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="katrSkco" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 407B61BF23 for ; Tue, 16 Jan 2024 13:51:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id CC043C4166C; Tue, 16 Jan 2024 13:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705413118; bh=LY6HxNa1Rb7kL6kWsoMm88OVVfL0zYKMiI+DT18wXSc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=katrSkcoNG8CGfQKRT44TKIUfkOAFQCGTGExOjcZL/HDwceICFA7Ftj88a9juTUZh pbTSd/XF2RwRcraxJFs8A8jitjomn1Wa+WSrT7ym4OZLYerdMztx9YcPlNDde7ak+Z nTsLlsHnDund4Oreme17yL1MBqgofgfF/xmfMytxMQF8YbaYwG6hi/c+l0qASjZTrE UWDXsI8hA8tCK5K7IfUJjjunVuCWzyT4aJFP9jgMWzv8ERHuYUsrOqpR5otEAZvT0O pVNsul2143Jjq4Nmg+GuMFAO1F2u94M1ldNKb4Qqz87Y4ctExBjtPFQDCgdv4DihBb qlWuX5GdkI2kw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9FB8C4707C; Tue, 16 Jan 2024 13:51:58 +0000 (UTC) From: Emil Velikov via B4 Relay Date: Tue, 16 Jan 2024 13:52:03 +0000 Subject: [PATCH BlueZ 09/10] build: enable gc/dead code removal Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240116-autofoo-v1-9-626f6b54bd06@gmail.com> References: <20240116-autofoo-v1-0-626f6b54bd06@gmail.com> In-Reply-To: <20240116-autofoo-v1-0-626f6b54bd06@gmail.com> To: linux-bluetooth@vger.kernel.org Cc: Emil Velikov X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705413116; l=776; i=emil.l.velikov@gmail.com; s=20230301; h=from:subject:message-id; bh=tXVcdUfXETqQpcM+wIkv5sahEbGpnPS14+ukiFkfzcc=; b=YJpXGBb1WaXwi5eDQsIi0UBhNBBbCzabSiP2A+Ct6xRvyDikxhZReDeIqGsTqS3CZMg822lFX hzIFEZpe69ZBwYlIena8ier+Ae0HsGw5DkNWFGE3L+rUCBKisSKUy+G X-Developer-Key: i=emil.l.velikov@gmail.com; a=ed25519; pk=qeUTVTNyI3rcR2CfNNWsloTihgzmtbZo98GdxwZKCkY= X-Endpoint-Received: by B4 Relay for emil.l.velikov@gmail.com/20230301 with auth_id=35 X-Original-From: Emil Velikov Reply-To: From: Emil Velikov Currently, there's plenty of unused code in most binaries. Enable -fdata/function-sections, which allows the linker garbage collection to do its job. On a maintainer build, this reduces the (unstriped) binaries from 117 to 114MiB. --- acinclude.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index c5d6de7b3..4b73a5bfc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -134,6 +134,8 @@ AC_DEFUN([MISC_FLAGS], [ misc_cflags="$misc_cflags --coverage" misc_ldflags="$misc_ldflags --coverage" fi + misc_cflags="$misc_cflags -ffunction-sections -fdata-sections" + misc_ldflags="$misc_ldflags -Wl,--gc-sections" AC_SUBST([MISC_CFLAGS], $misc_cflags) AC_SUBST([MISC_LDFLAGS], $misc_ldflags) ]) -- 2.43.0