All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/uboot-tools: fix static build with musl
@ 2021-09-14 21:15 Fabrice Fontaine
  2021-09-22 21:23 ` Arnout Vandecappelle
  2021-10-05 13:33 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2021-09-14 21:15 UTC (permalink / raw)
  To: buildroot; +Cc: Matt Weber, Fabrice Fontaine

Static build with musl fails since bump to version 2020.04 in commit
fe97212976ea0b2a80fe1e076ad17d6f648cd1de because LDFLAGS, which contains
-static, is not passed resulting in the following build failure:

/tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/../../../../arm-buildroot-linux-musleabihf/bin/ld: /tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_ldiv0':
/tmp/instance-1/output-1/build/host-gcc-final-10.3.0/build/arm-buildroot-linux-musleabihf/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499: undefined reference to `raise'
collect2: error: ld returned 1 exit status

Fixes:
 - http://autobuild.buildroot.org/results/d71aba27ff0c7711f2cb67261183506f25217a5f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch

diff --git a/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch b/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch
new file mode 100644
index 0000000000..502458e219
--- /dev/null
+++ b/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch
@@ -0,0 +1,34 @@
+From 3b89170333ef0fdfffee14751ce3e1d66d7dfa00 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 14 Sep 2021 19:08:02 +0200
+Subject: [PATCH] tools/Makefile: fix {C,LD}FLAGS with CROSS_BUILD_TOOLS
+
+When CROSS_BUILD_TOOLS is set, set KBUILD_HOST{CF,LD}FLAGS to
+{C,LD}FLAGS otherwise CC will be used with HOST{C,LD}FLAGS which seems
+wrong.
+
+It should be noted that, for an unknown reason, overriding
+HOST{C,LD}FLAGS don't work.
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ tools/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/Makefile b/tools/Makefile
+index 4a86321f64..98bb92990d 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -316,7 +316,8 @@ subdir- += env
+ 
+ ifneq ($(CROSS_BUILD_TOOLS),)
+ override HOSTCC = $(CC)
+-override HOSTCFLAGS = $(CFLAGS)
++override KBUILD_HOSTCFLAGS = $(CFLAGS)
++override KBUILD_HOSTLDFLAGS = $(LDFLAGS)
+ 
+ quiet_cmd_crosstools_strip = STRIP   $^
+       cmd_crosstools_strip = $(STRIP) $^; touch $@
+-- 
+2.33.0
+
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@lists.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/uboot-tools: fix static build with musl
  2021-09-14 21:15 [Buildroot] [PATCH 1/1] package/uboot-tools: fix static build with musl Fabrice Fontaine
@ 2021-09-22 21:23 ` Arnout Vandecappelle
  2021-10-05 13:33 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2021-09-22 21:23 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot; +Cc: Matt Weber



On 14/09/2021 23:15, Fabrice Fontaine wrote:
> Static build with musl fails since bump to version 2020.04 in commit
> fe97212976ea0b2a80fe1e076ad17d6f648cd1de because LDFLAGS, which contains
> -static, is not passed resulting in the following build failure:
> 
> /tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/../../../../arm-buildroot-linux-musleabihf/bin/ld: /tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_ldiv0':
> /tmp/instance-1/output-1/build/host-gcc-final-10.3.0/build/arm-buildroot-linux-musleabihf/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499: undefined reference to `raise'
> collect2: error: ld returned 1 exit status
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/d71aba27ff0c7711f2cb67261183506f25217a5f
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

  Applied to master, thanks.

  What's the upstream status of the patch?

  Regards,
  Arnout

> ---
>   ...ix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch | 34 +++++++++++++++++++
>   1 file changed, 34 insertions(+)
>   create mode 100644 package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch
> 
> diff --git a/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch b/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch
> new file mode 100644
> index 0000000000..502458e219
> --- /dev/null
> +++ b/package/uboot-tools/0003-tools-Makefile-fix-C-LD-FLAGS-with-CROSS_BUILD_TOOLS.patch
> @@ -0,0 +1,34 @@
> +From 3b89170333ef0fdfffee14751ce3e1d66d7dfa00 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Tue, 14 Sep 2021 19:08:02 +0200
> +Subject: [PATCH] tools/Makefile: fix {C,LD}FLAGS with CROSS_BUILD_TOOLS
> +
> +When CROSS_BUILD_TOOLS is set, set KBUILD_HOST{CF,LD}FLAGS to
> +{C,LD}FLAGS otherwise CC will be used with HOST{C,LD}FLAGS which seems
> +wrong.
> +
> +It should be noted that, for an unknown reason, overriding
> +HOST{C,LD}FLAGS don't work.
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + tools/Makefile | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +diff --git a/tools/Makefile b/tools/Makefile
> +index 4a86321f64..98bb92990d 100644
> +--- a/tools/Makefile
> ++++ b/tools/Makefile
> +@@ -316,7 +316,8 @@ subdir- += env
> +
> + ifneq ($(CROSS_BUILD_TOOLS),)
> + override HOSTCC = $(CC)
> +-override HOSTCFLAGS = $(CFLAGS)
> ++override KBUILD_HOSTCFLAGS = $(CFLAGS)
> ++override KBUILD_HOSTLDFLAGS = $(LDFLAGS)
> +
> + quiet_cmd_crosstools_strip = STRIP   $^
> +       cmd_crosstools_strip = $(STRIP) $^; touch $@
> +--
> +2.33.0
> +
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/uboot-tools: fix static build with musl
  2021-09-14 21:15 [Buildroot] [PATCH 1/1] package/uboot-tools: fix static build with musl Fabrice Fontaine
  2021-09-22 21:23 ` Arnout Vandecappelle
@ 2021-10-05 13:33 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-10-05 13:33 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Matt Weber, buildroot

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

 > Static build with musl fails since bump to version 2020.04 in commit
 > fe97212976ea0b2a80fe1e076ad17d6f648cd1de because LDFLAGS, which contains
 > -static, is not passed resulting in the following build failure:

 > /tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/../../../../arm-buildroot-linux-musleabihf/bin/ld:
 > /tmp/instance-1/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/libgcc.a(_dvmd_lnx.o):
 > in function `__aeabi_ldiv0':
 > /tmp/instance-1/output-1/build/host-gcc-final-10.3.0/build/arm-buildroot-linux-musleabihf/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499:
 > undefined reference to `raise'
 > collect2: error: ld returned 1 exit status

 > Fixes:
 >  - http://autobuild.buildroot.org/results/d71aba27ff0c7711f2cb67261183506f25217a5f

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2021.02.x, 2021.05.x and 2021.08.x, thanks.

Don't forget to submit the patch upstream.

-- 
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:[~2021-10-05 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 21:15 [Buildroot] [PATCH 1/1] package/uboot-tools: fix static build with musl Fabrice Fontaine
2021-09-22 21:23 ` Arnout Vandecappelle
2021-10-05 13:33 ` 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.