opensmtpd-6.4.0_p1_missing_object_file_smtpctl.patch (1366B)
1 From 70995e4e0a96799a8610fd67b0c874f3f2d9621c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= <leo@gaspard.io>
3 Date: Sat, 27 Oct 2018 11:53:28 +0900
4 Subject: [PATCH] Add missing object file for smtpctl
5
6 With this change and addition of `CFLAGS=-ffunction-sections` and
7 `LDFLAGS=-Wl,--gc-sections`, it now builds.
8
9 `purge_config` is defined in `config.c` but used in `parse.y`, making
10 `config.c` mandatory. But `config.c` requires lots of functions from
11 other files in other unrelated functions, meaning that these unrelated
12 (and unused in `smtpctl`) functions need to be garbage-collected.
13
14 This is a workaround, a better way would likely be to refactor
15 `purge_config` and `config_default` out of `config.c`, but I don't want
16 to push for a change that would separate the portable version and the
17 OpenBSD version too much.
18 ---
19 mk/smtpctl/Makefile.am | 1 +
20 1 file changed, 1 insertion(+)
21
22 diff --git a/mk/smtpctl/Makefile.am b/mk/smtpctl/Makefile.am
23 index 5af0b713..55795920 100644
24 --- a/mk/smtpctl/Makefile.am
25 +++ b/mk/smtpctl/Makefile.am
26 @@ -4,6 +4,7 @@ sbin_PROGRAMS= smtpctl
27
28 smtpctl_SOURCES= $(smtpd_srcdir)/enqueue.c
29 smtpctl_SOURCES+= $(smtpd_srcdir)/parser.c
30 +smtpctl_SOURCES+= $(smtpd_srcdir)/config.c
31 smtpctl_SOURCES+= $(smtpd_srcdir)/log.c
32 smtpctl_SOURCES+= $(smtpd_srcdir)/envelope.c
33 smtpctl_SOURCES+= $(smtpd_srcdir)/queue_backend.c