All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build
@ 2024-07-25 17:37 Martin Wetterwald
  2024-07-26  7:19 ` Thomas Petazzoni via buildroot
  2024-08-31 21:48 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Wetterwald @ 2024-07-25 17:37 UTC (permalink / raw)
  To: buildroot; +Cc: Vadim Kochan, Martin Wetterwald

When using BR2_STATIC_LIBS=y, tinysshd's build was successful, but the
binary didn't work on the final target: this is because a dynamically
linked ELF was produced, on a target having no dynamic loader at all.

Using $(TARGET_CONFIGURE_OPTS) propagates all the options and not only
"CC", resulting in a correct static binary able to run on the target.

Without the patch:

> tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
> dynamically linked, interpreter /lib/ld-musl-armhf.so.1, stripped

With the patch:

> tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
> statically linked, stripped

Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>
---
 package/tinyssh/tinyssh.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/tinyssh/tinyssh.mk b/package/tinyssh/tinyssh.mk
index 80b6ccb850..e92ac628f2 100644
--- a/package/tinyssh/tinyssh.mk
+++ b/package/tinyssh/tinyssh.mk
@@ -10,7 +10,7 @@ TINYSSH_LICENSE = CC0-1.0
 TINYSSH_LICENSE_FILES = LICENCE
 
 define TINYSSH_BUILD_CMDS
-	$(TARGET_MAKE_ENV) CC="$(TARGET_CC)" $(MAKE) -C $(@D) cross-compile
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) cross-compile
 endef
 
 define TINYSSH_INSTALL_TARGET_CMDS
-- 
2.45.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build
  2024-07-25 17:37 [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build Martin Wetterwald
@ 2024-07-26  7:19 ` Thomas Petazzoni via buildroot
  2024-08-31 21:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-26  7:19 UTC (permalink / raw)
  To: Martin Wetterwald; +Cc: Vadim Kochan, buildroot

Hello Martin,

On Thu, 25 Jul 2024 19:37:09 +0200
Martin Wetterwald <martin@wetterwald.eu> wrote:

> When using BR2_STATIC_LIBS=y, tinysshd's build was successful, but the
> binary didn't work on the final target: this is because a dynamically
> linked ELF was produced, on a target having no dynamic loader at all.
> 
> Using $(TARGET_CONFIGURE_OPTS) propagates all the options and not only
> "CC", resulting in a correct static binary able to run on the target.
> 
> Without the patch:
> 
> > tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
> > dynamically linked, interpreter /lib/ld-musl-armhf.so.1, stripped  
> 
> With the patch:
> 
> > tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
> > statically linked, stripped  
> 
> Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>
> ---
>  package/tinyssh/tinyssh.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for your contribution, I've applied your patch, after fixing
some small details:

- package/tinyssh instead of package/tinysshd as the commit prefix.
  Indeed, the package name is tinyssh, not tinyssd

- remove the capital letter in "Fix", as we try to have consistency
  between our commit titles, and the vast majority of them don't
  capitalize the first word

- add a "Fixes:" tag that points to which commit is being fixed by your
  change, so that we know if your fix needs to be backported to our LTS
  branch or not

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build
  2024-07-25 17:37 [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build Martin Wetterwald
  2024-07-26  7:19 ` Thomas Petazzoni via buildroot
@ 2024-08-31 21:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-08-31 21:48 UTC (permalink / raw)
  To: Martin Wetterwald; +Cc: Vadim Kochan, buildroot

>>>>> "Martin" == Martin Wetterwald <martin@wetterwald.eu> writes:

 > When using BR2_STATIC_LIBS=y, tinysshd's build was successful, but the
 > binary didn't work on the final target: this is because a dynamically
 > linked ELF was produced, on a target having no dynamic loader at all.

 > Using $(TARGET_CONFIGURE_OPTS) propagates all the options and not only
 > "CC", resulting in a correct static binary able to run on the target.

 > Without the patch:

 >> tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
 >> dynamically linked, interpreter /lib/ld-musl-armhf.so.1, stripped

 > With the patch:

 >> tinysshd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
 >> statically linked, stripped

 > Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>

Committed to 2024.02.x and 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-31 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 17:37 [Buildroot] [PATCH 1/1] package/tinysshd: Fix static-only build Martin Wetterwald
2024-07-26  7:19 ` Thomas Petazzoni via buildroot
2024-08-31 21:48 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.