Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/xz: fix musl static build
@ 2024-07-23 21:50 Fabrice Fontaine
  2024-07-24 16:33 ` Thomas Petazzoni via buildroot
  2024-08-02 18:08 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2024-07-23 21:50 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

For an unknown reason, runnning autoreconf is needed to avoid the
following static build failure on musl which is raised because LDFLAGS
(which contains -static) is not passed:

/home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/../../../../armeb-buildroot-linux-musleabi/bin/ld: /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_idiv0':
/home/autobuild/autobuild/instance-16/output-1/build/host-gcc-final-13.3.0/build/armeb-buildroot-linux-musleabi/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499:(.text+0x8): undefined reference to `raise'

This build failure is raised by autobuilders since bump to version 5.6.2
in commit d1d77eb274761d1f2d24ee4b55a374e917c67a8e but it can also be
reproduced on version 5.4.7 (but not on 5.4.6). There is probably an
issue with these two official autotools tarballs which have been
released the same day (on May 29 2024).

Fixes: 40240ac30afc4c6af765794f38e6815162ca61fa
 - http://autobuild.buildroot.org/results/344813b202644a23c166920aa7e861ebf408536b

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/xz/xz.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/xz/xz.mk b/package/xz/xz.mk
index 8dfd76f8b9..9fb93ff4d6 100644
--- a/package/xz/xz.mk
+++ b/package/xz/xz.mk
@@ -12,6 +12,8 @@ XZ_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
 XZ_LICENSE = Public Domain, BSD-0-Clause, GPL-2.0+, GPL-3.0+, LGPL-2.1+
 XZ_LICENSE_FILES = COPYING COPYING.0BSD COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1
 XZ_CPE_ID_VENDOR = tukaani
+# autoreconf needed to fix a musl static build failure
+XZ_AUTORECONF = YES
 
 # The package is a dependency to ccache so ccache cannot be a dependency
 HOST_XZ_ADD_CCACHE_DEPENDENCY = NO
-- 
2.43.0

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

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

* Re: [Buildroot] [PATCH 1/1] package/xz: fix musl static build
  2024-07-23 21:50 [Buildroot] [PATCH 1/1] package/xz: fix musl static build Fabrice Fontaine
@ 2024-07-24 16:33 ` Thomas Petazzoni via buildroot
  2024-07-24 18:02   ` Fabrice Fontaine
  2024-08-02 18:08 ` Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-24 16:33 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Tue, 23 Jul 2024 23:50:41 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> For an unknown reason, runnning autoreconf is needed to avoid the
> following static build failure on musl which is raised because LDFLAGS
> (which contains -static) is not passed:
> 
> /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/../../../../armeb-buildroot-linux-musleabi/bin/ld: /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_idiv0':
> /home/autobuild/autobuild/instance-16/output-1/build/host-gcc-final-13.3.0/build/armeb-buildroot-linux-musleabi/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499:(.text+0x8): undefined reference to `raise'
> 
> This build failure is raised by autobuilders since bump to version 5.6.2
> in commit d1d77eb274761d1f2d24ee4b55a374e917c67a8e but it can also be
> reproduced on version 5.4.7 (but not on 5.4.6). There is probably an
> issue with these two official autotools tarballs which have been
> released the same day (on May 29 2024).
> 
> Fixes: 40240ac30afc4c6af765794f38e6815162ca61fa
>  - http://autobuild.buildroot.org/results/344813b202644a23c166920aa7e861ebf408536b
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/xz/xz.mk | 2 ++
>  1 file changed, 2 insertions(+)

Thanks for the investigation. However, I'd like to have a little bit
better understanding than "unknown reason". Could you compare the
build/link command lines used by xz without/with the AUTORECONF = YES,
to see what's different?

What puzzles me is that the build failures are related to libgcc.a
missing some symbols. So do we have a xz issue here, or do we have an
actual host-gcc-final issue that somehow gets worked-around by doing
XZ_AUTORECONF = YES ? That is what worries me about merging this fix
without a slightly better understanding of what's going on.

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] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/xz: fix musl static build
  2024-07-24 16:33 ` Thomas Petazzoni via buildroot
@ 2024-07-24 18:02   ` Fabrice Fontaine
  0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2024-07-24 18:02 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Le mer. 24 juil. 2024 à 18:33, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a écrit :
>
> On Tue, 23 Jul 2024 23:50:41 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > For an unknown reason, runnning autoreconf is needed to avoid the
> > following static build failure on musl which is raised because LDFLAGS
> > (which contains -static) is not passed:
> >
> > /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/../../../../armeb-buildroot-linux-musleabi/bin/ld: /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_idiv0':
> > /home/autobuild/autobuild/instance-16/output-1/build/host-gcc-final-13.3.0/build/armeb-buildroot-linux-musleabi/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499:(.text+0x8): undefined reference to `raise'
> >
> > This build failure is raised by autobuilders since bump to version 5.6.2
> > in commit d1d77eb274761d1f2d24ee4b55a374e917c67a8e but it can also be
> > reproduced on version 5.4.7 (but not on 5.4.6). There is probably an
> > issue with these two official autotools tarballs which have been
> > released the same day (on May 29 2024).
> >
> > Fixes: 40240ac30afc4c6af765794f38e6815162ca61fa
> >  - http://autobuild.buildroot.org/results/344813b202644a23c166920aa7e861ebf408536b
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> >  package/xz/xz.mk | 2 ++
> >  1 file changed, 2 insertions(+)
>
> Thanks for the investigation. However, I'd like to have a little bit
> better understanding than "unknown reason". Could you compare the
> build/link command lines used by xz without/with the AUTORECONF = YES,
> to see what's different?

Without autoreconf:

libtool: link: /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-musleabi-gcc
-fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self
-Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3
-Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow
-Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time
-Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
-Wmissing-declarations -Wredundant-decls -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g2 -o xzdec
xzdec-xzdec.o xzdec-tuklib_progname.o xzdec-tuklib_exit.o
../../src/liblzma/.libs/liblzma.a -lpthread -pthread

With autoreconf:

libtool: link: /home/fabrice/buildroot/output/host/bin/armeb-buildroot-linux-musleabi-gcc
-fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self
-Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3
-Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow
-Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time
-Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
-Wmissing-declarations -Wredundant-decls -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g2 -static -static
-o xzdec xzdec-xzdec.o xzdec-tuklib_progname.o xzdec-tuklib_exit.o
../../src/liblzma/.libs/liblzma.a -lpthread -pthread

So as you can see, the only difference is the addition of -static -static.

>
> What puzzles me is that the build failures are related to libgcc.a
> missing some symbols. So do we have a xz issue here, or do we have an
> actual host-gcc-final issue that somehow gets worked-around by doing
> XZ_AUTORECONF = YES ? That is what worries me about merging this fix
> without a slightly better understanding of what's going on.

The "undefined reference to raise" is the usual error when -static is
not passed when building statically with musl.
You even opened a ticket on musl mailing list back in 2018:
https://inbox.vuxu.org/musl/20180509112932.1a3176b0@windsurf.home/T/

>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Best Regards,

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

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

* Re: [Buildroot] [PATCH 1/1] package/xz: fix musl static build
  2024-07-23 21:50 [Buildroot] [PATCH 1/1] package/xz: fix musl static build Fabrice Fontaine
  2024-07-24 16:33 ` Thomas Petazzoni via buildroot
@ 2024-08-02 18:08 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 18:08 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Tue, 23 Jul 2024 23:50:41 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> For an unknown reason, runnning autoreconf is needed to avoid the
> following static build failure on musl which is raised because LDFLAGS
> (which contains -static) is not passed:
> 
> /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/../../../../armeb-buildroot-linux-musleabi/bin/ld: /home/autobuild/autobuild/instance-16/output-1/host/lib/gcc/armeb-buildroot-linux-musleabi/13.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_idiv0':
> /home/autobuild/autobuild/instance-16/output-1/build/host-gcc-final-13.3.0/build/armeb-buildroot-linux-musleabi/libgcc/../../../libgcc/config/arm/lib1funcs.S:1499:(.text+0x8): undefined reference to `raise'
> 
> This build failure is raised by autobuilders since bump to version 5.6.2
> in commit d1d77eb274761d1f2d24ee4b55a374e917c67a8e but it can also be
> reproduced on version 5.4.7 (but not on 5.4.6). There is probably an
> issue with these two official autotools tarballs which have been
> released the same day (on May 29 2024).
> 
> Fixes: 40240ac30afc4c6af765794f38e6815162ca61fa
>  - http://autobuild.buildroot.org/results/344813b202644a23c166920aa7e861ebf408536b
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/xz/xz.mk | 2 ++
>  1 file changed, 2 insertions(+)

Applied to master, 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] 4+ messages in thread

end of thread, other threads:[~2024-08-02 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23 21:50 [Buildroot] [PATCH 1/1] package/xz: fix musl static build Fabrice Fontaine
2024-07-24 16:33 ` Thomas Petazzoni via buildroot
2024-07-24 18:02   ` Fabrice Fontaine
2024-08-02 18:08 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox