All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2,1/1] package/noip: fix static build
@ 2022-06-09 21:25 Fabrice Fontaine
  2022-06-13 20:23 ` Arnout Vandecappelle
  2022-06-19 13:46 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-06-09 21:25 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Pass TARGET_LDFLAGS (which will contain -static) through LIBS (as
LDFLAGS is not supported) to fix the following static build failure
(e.g. with musl):

/home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/../../../../microblazeel-buildroot-linux-musl/bin/ld: /home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/libgcc.a(unwind-dw2.o): in function `__gthread_once':
/home/autobuild/autobuild/instance-15/output-1/build/host-gcc-final-10.3.0/build/microblazeel-buildroot-linux-musl/libgcc/gthr-default.h:700: undefined reference to `pthread_once'

While at it, alsp pass TARGET_{C,CPP}FLAGS through LIBS as suggested by Thomas
Petazzoni

Fixes:
 - http://autobuild.buildroot.org/results/5ea9b1b976aecc401e0aff21eef3e31c8ed17181

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Thomas Petazzoni):
 - Pass TARGET_{C,CPP}FLAGS through LIBS

 package/noip/noip.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/noip/noip.mk b/package/noip/noip.mk
index b7fcc84e2f..1bf4524a51 100644
--- a/package/noip/noip.mk
+++ b/package/noip/noip.mk
@@ -10,10 +10,13 @@ NOIP_SOURCE = noip-duc-linux.tar.gz
 NOIP_LICENSE = GPL-2.0+
 NOIP_LICENSE_FILES = COPYING
 
+# Pass TARGET_{C,CPP,LD}FLAGS through LIBS as noip doesn't rely on implicit
+# make rules
 define NOIP_BUILD_CMDS
 	$(SED) "/^#define CONFIG_FILENAME/ s/PREFIX//" $(@D)/noip2.c
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" \
-		CFLAGS="$(TARGET_CFLAGS)" PREFIX=/usr CONFDIR=/etc
+		LIBS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \
+		PREFIX=/usr CONFDIR=/etc
 endef
 
 define NOIP_INSTALL_TARGET_CMDS
-- 
2.35.1

_______________________________________________
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 v2,1/1] package/noip: fix static build
  2022-06-09 21:25 [Buildroot] [PATCH v2,1/1] package/noip: fix static build Fabrice Fontaine
@ 2022-06-13 20:23 ` Arnout Vandecappelle
  2022-06-19 13:46 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-06-13 20:23 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot



On 09/06/2022 23:25, Fabrice Fontaine wrote:
> Pass TARGET_LDFLAGS (which will contain -static) through LIBS (as
> LDFLAGS is not supported) to fix the following static build failure
> (e.g. with musl):
> 
> /home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/../../../../microblazeel-buildroot-linux-musl/bin/ld: /home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/libgcc.a(unwind-dw2.o): in function `__gthread_once':
> /home/autobuild/autobuild/instance-15/output-1/build/host-gcc-final-10.3.0/build/microblazeel-buildroot-linux-musl/libgcc/gthr-default.h:700: undefined reference to `pthread_once'
> 
> While at it, alsp pass TARGET_{C,CPP}FLAGS through LIBS as suggested by Thomas
> Petazzoni
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/5ea9b1b976aecc401e0aff21eef3e31c8ed17181
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2 (after review of Thomas Petazzoni):
>   - Pass TARGET_{C,CPP}FLAGS through LIBS
> 
>   package/noip/noip.mk | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/package/noip/noip.mk b/package/noip/noip.mk
> index b7fcc84e2f..1bf4524a51 100644
> --- a/package/noip/noip.mk
> +++ b/package/noip/noip.mk
> @@ -10,10 +10,13 @@ NOIP_SOURCE = noip-duc-linux.tar.gz
>   NOIP_LICENSE = GPL-2.0+
>   NOIP_LICENSE_FILES = COPYING
>   
> +# Pass TARGET_{C,CPP,LD}FLAGS through LIBS as noip doesn't rely on implicit
> +# make rules
>   define NOIP_BUILD_CMDS
>   	$(SED) "/^#define CONFIG_FILENAME/ s/PREFIX//" $(@D)/noip2.c
>   	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" \
> -		CFLAGS="$(TARGET_CFLAGS)" PREFIX=/usr CONFDIR=/etc
> +		LIBS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \

  TARGET_CFLAGS already includes TARGET_CPPFLAGS, so I removed the latter.


  Applied to master, thanks.

  Regards,
  Arnout

> +		PREFIX=/usr CONFDIR=/etc
>   endef
>   
>   define NOIP_INSTALL_TARGET_CMDS
_______________________________________________
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 v2,1/1] package/noip: fix static build
  2022-06-09 21:25 [Buildroot] [PATCH v2,1/1] package/noip: fix static build Fabrice Fontaine
  2022-06-13 20:23 ` Arnout Vandecappelle
@ 2022-06-19 13:46 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-06-19 13:46 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Pass TARGET_LDFLAGS (which will contain -static) through LIBS (as
 > LDFLAGS is not supported) to fix the following static build failure
 > (e.g. with musl):

 > /home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/../../../../microblazeel-buildroot-linux-musl/bin/ld:
 > /home/autobuild/autobuild/instance-15/output-1/host/lib/gcc/microblazeel-buildroot-linux-musl/10.3.0/libgcc.a(unwind-dw2.o):
 > in function `__gthread_once':
 > /home/autobuild/autobuild/instance-15/output-1/build/host-gcc-final-10.3.0/build/microblazeel-buildroot-linux-musl/libgcc/gthr-default.h:700:
 > undefined reference to `pthread_once'

 > While at it, alsp pass TARGET_{C,CPP}FLAGS through LIBS as suggested by Thomas
 > Petazzoni

 > Fixes:
 >  - http://autobuild.buildroot.org/results/5ea9b1b976aecc401e0aff21eef3e31c8ed17181

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 > Changes v1 -> v2 (after review of Thomas Petazzoni):
 >  - Pass TARGET_{C,CPP}FLAGS through LIBS

Committed to 2022.05.x and 2022.02.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:[~2022-06-19 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 21:25 [Buildroot] [PATCH v2,1/1] package/noip: fix static build Fabrice Fontaine
2022-06-13 20:23 ` Arnout Vandecappelle
2022-06-19 13:46 ` 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.