From e82efa8603a375d5b136f363318230a735254754 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 12 Aug 2019 22:19:19 +0200 Subject: Trim unused shared library linkages from the session helper The org.freedesktop.Flatpak user D-Bus service isn't just used by flatpak(1) or applications running as Flatpaks. It's also used by toolbox(1) for similar reasons: * To keep various configuration files inside the container synchronized with the host * To let the container request certain commands to be run on the host The org.freedesktop.Flatpak D-Bus service itself doesn't need much in the way of dependencies, but inherits a lot of unused shared library linkages through the libflatpak-common.la convenience library. Removing these unused shared libraries reduces the footprint of toolbox(1) for those who care about such things. eg., Fedora CoreOS. This commit brings down the number of shared libraries to 19 from 62. Closes: #3052 Approved by: alexlarsson --- session-helper/Makefile.am.inc | 4 ++-- session-helper/flatpak-session-helper.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'session-helper') diff --git a/session-helper/Makefile.am.inc b/session-helper/Makefile.am.inc index 7ea49bf0..f56c94b1 100644 --- a/session-helper/Makefile.am.inc +++ b/session-helper/Makefile.am.inc @@ -12,5 +12,5 @@ flatpak_session_helper_SOURCES = \ session-helper/flatpak-session-helper.c \ $(NULL) -flatpak_session_helper_LDADD = $(AM_LDADD) $(BASE_LIBS) libflatpak-common.la -flatpak_session_helper_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(SOUP_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) $(JSON_CFLAGS) -DFLATPAK_COMPILATION +flatpak_session_helper_LDADD = $(AM_LDADD) $(BASE_LIBS) libflatpak-common-base.la libglnx.la +flatpak_session_helper_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) -DFLATPAK_COMPILATION diff --git a/session-helper/flatpak-session-helper.c b/session-helper/flatpak-session-helper.c index 0fbac666..26e83fc6 100644 --- a/session-helper/flatpak-session-helper.c +++ b/session-helper/flatpak-session-helper.c @@ -1,5 +1,5 @@ /* - * Copyright © 2014 Red Hat, Inc + * Copyright © 2014-2019 Red Hat, Inc * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include #include @@ -28,7 +29,7 @@ #include #include #include "flatpak-dbus-generated.h" -#include "flatpak-utils-private.h" +#include "flatpak-utils-base-private.h" typedef enum { FLATPAK_HOST_COMMAND_FLAGS_CLEAR_ENV = 1 << 0, -- cgit v1.2.1