public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@kernel.org>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 09/10] build: enable gc/dead code removal
Date: Tue, 16 Jan 2024 13:52:03 +0000	[thread overview]
Message-ID: <20240116-autofoo-v1-9-626f6b54bd06@gmail.com> (raw)
In-Reply-To: <20240116-autofoo-v1-0-626f6b54bd06@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

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


  parent reply	other threads:[~2024-01-16 13:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 13:51 [PATCH BlueZ 00/10] Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service Emil Velikov via B4 Relay
2024-01-16 13:51 ` [PATCH BlueZ 01/10] build: remove unused AM_CONDITIONAL Emil Velikov via B4 Relay
2024-01-16 15:41   ` Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service bluez.test.bot
2024-01-16 13:51 ` [PATCH BlueZ 02/10] build: tweak PKG_CHECK_MODULES calls Emil Velikov via B4 Relay
2024-01-16 13:51 ` [PATCH BlueZ 03/10] build: require libudev 196, circa 2012 Emil Velikov via B4 Relay
2024-01-16 13:51 ` [PATCH BlueZ 04/10] build: remove dummy {conf,state}{dir,_DATA} Emil Velikov via B4 Relay
2024-01-16 18:40   ` Luiz Augusto von Dentz
2024-01-17  8:39     ` Emil Velikov
2024-01-18 16:12       ` Emil Velikov
2024-01-18 17:05         ` Luiz Augusto von Dentz
2024-01-19 11:09           ` Emil Velikov
2024-01-19 15:09             ` Luiz Augusto von Dentz
2024-01-16 13:51 ` [PATCH BlueZ 05/10] build: remove unused variable builtin_nodist Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 06/10] build: remove .service files from DEPENDENCIES lists Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 07/10] build: remove explicit DEPENDENCIES handling Emil Velikov via B4 Relay
2024-01-16 13:52 ` [PATCH BlueZ 08/10] build: manage .service.in files via configure.ac Emil Velikov via B4 Relay
2024-01-16 13:52 ` Emil Velikov via B4 Relay [this message]
2024-01-16 13:52 ` [PATCH BlueZ 10/10] build: install dbus-org.bluez.obex.service symlink Emil Velikov via B4 Relay
2024-01-16 19:02 ` [PATCH BlueZ 00/10] Autotools papercuts, linker GC, symlink dbus-org.bluez.obex.service patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116-autofoo-v1-9-626f6b54bd06@gmail.com \
    --to=devnull+emil.l.velikov.gmail.com@kernel.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox