From: Christian Storm <[email protected]>

On first build, libtool produces a proper statically linked
bg_setenv tool which by argv[0] decides whether to printenv
or setenv.

On subsequent builds, e.g., while incrementally developing,
libtool *dynamically* links bg_setenv against libebgenv and
applies "magic" [1,2] to compensate for library paths.
This breaks the bg_setenv argv[0] logic.

So, state explicitly that bg_setenv is to be linked statically.

[1] 
https://www.gnu.org/software/libtool/manual/html_node/Linking-executables.html#Linking-executables
[2] https://autotools.io/libtool/wrappers.html

Signed-off-by: Christian Storm <[email protected]>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 3545ae2..2a5f8f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -107,7 +107,7 @@ bg_setenv_SOURCES = \
        tools/bg_setenv.c
 
 bg_setenv_CFLAGS = \
-       $(AM_CFLAGS)
+       $(AM_CFLAGS) -static
 
 bg_setenv_LDADD = \
        -lebgenv \
-- 
2.33.1

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20211102132254.14710-1-christian.storm%40siemens.com.

Reply via email to