[PATCH] Makefile: Fix static tool build on incremental builds, again

6 views
Skip to first unread message

Christian Storm

unread,
Nov 2, 2021, 5:09:40 PM11/2/21
to efibootg...@googlegroups.com, Christian Storm
From: Christian Storm <christi...@siemens.com>

Quoting [1]:
"We recommend that you avoid using -l options in LDADD or
prog_LDADD when referring to libraries built by your package.
Instead, write the file name of the library explicitly as in the
above cpio example. Use -l only to list third-party libraries. If
you follow this rule, the default value of prog_DEPENDENCIES will
list all your local libraries and omit the other ones."

Hence, remove bg_setenv_DEPENDENCIES and explicitly specify
libebgenv.a in bg_setenv_LDADD.

[1] https://www.gnu.org/software/automake/manual/html_node/Linking.html#Linking

Signed-off-by: Christian Storm <christi...@siemens.com>
---

This solves the incremental build issue on Nix as per Michael's
repro steps. There's no breakage on AARCH64 and x86/64 with
in-tree as well as off-tree builds. So, the hope is that the last
patch adding -static to bg_setenv_CFLAGS plus this one is it.
Please test :)

Makefile.am | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2a5f8f8..73af2f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -110,12 +110,9 @@ bg_setenv_CFLAGS = \
$(AM_CFLAGS) -static

bg_setenv_LDADD = \
- -lebgenv \
+ $(top_builddir)/libebgenv.a \
-lz

-bg_setenv_DEPENDENCIES = \
- libebgenv.a
-
install-exec-hook:
$(AM_V_at)$(LN_S) -f bg_setenv$(EXEEXT) \
$(DESTDIR)$(bindir)/bg_printenv$(EXEEXT)
--
2.33.1

Michael Adler

unread,
Nov 3, 2021, 2:55:24 AM11/3/21
to Christian Storm, efibootg...@googlegroups.com
> This solves the incremental build issue on Nix as per Michael's repro steps.

Confirmed, works on my machine as well. Thanks!

--
Michael Adler

Siemens AG
T RDA IOT SES-DE
Otto-Hahn-Ring 6
81739 München, Deutschland

Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann Snabe; Vorstand: Roland Busch, Vorsitzender; Klaus Helmrich, Cedrik Neike, Matthias Rebellius, Ralf P. Thomas, Judith Wiese; Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin-Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322

Christian Storm

unread,
Nov 17, 2021, 3:55:53 AM11/17/21
to efibootg...@googlegroups.com
> > This solves the incremental build issue on Nix as per Michael's repro steps.
>
> Confirmed, works on my machine as well. Thanks!

Bump. Anything to discuss or improve here?


Kind regards,
Christian

--
Dr. Christian Storm
Siemens AG, Technology, T RDA IOT SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany

Jan Kiszka

unread,
Nov 18, 2021, 2:49:48 AM11/18/21
to Christian Storm, efibootg...@googlegroups.com
Thanks, applied.

Jan

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
Reply all
Reply to author
Forward
0 new messages