[Buildroot] [PATCH 1/1] package/fstrcmp: fix musl static build

Arnout Vandecappelle arnout at mind.be
Fri Sep 3 18:52:58 UTC 2021



On 02/09/2021 18:20, Fabrice Fontaine wrote:
> Fix the following musl static build failure raised because host libtool
> is not patched to manage "-static" as "-all-static". So instead of using
> host libtool, patch configure.ac to add a call to LT_INIT which will

 Wouldn't it make more sense to just apply our buildroot-libtool-v2.4.4.patch to
host-libtool?

 Regards,
 Arnout

> result in lt-main.sh being copied (and so libtool patch being applied):
> 
> /home/buildroot/autobuild/instance-2/output-1/host/bin/libtool --mode=link --tag=CC /home/buildroot/autobuild/instance-2/output-1/host/bin/arm-buildroot-linux-musleabihf-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -static -Wall -Wextra -Wshadow -o bin/test_user \
> 	test_user/main.lo lib/libfstrcmp.la -static
> chmod a+rx bin/test_prelude
> libtool: link: /home/buildroot/autobuild/instance-2/output-1/host/bin/arm-buildroot-linux-musleabihf-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -Wall -Wextra -Wshadow -o bin/test_user test_user/main.o  lib/.libs/libfstrcmp.a
> libtool: link: /home/buildroot/autobuild/instance-2/output-1/host/bin/arm-buildroot-linux-musleabihf-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -Wall -Wextra -Wshadow -o bin/fstrcmp fstrcmp/main.o  lib/.libs/libfstrcmp.a
> /home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/../../../../arm-buildroot-linux-musleabihf/bin/ld: /home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-musleabihf/10.3.0/libgcc.a(_dvmd_lnx.o): in function `__aeabi_ldiv0':
> /home/buildroot/autobuild/instance-2/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'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/ffbee12f13e3d6c180d8891a428c6c490163083d
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> ---
>  package/fstrcmp/0002-add-LT_INIT.patch | 28 ++++++++++++++++++++++++++
>  package/fstrcmp/fstrcmp.mk             |  4 ++--
>  2 files changed, 30 insertions(+), 2 deletions(-)
>  create mode 100644 package/fstrcmp/0002-add-LT_INIT.patch
> 
> diff --git a/package/fstrcmp/0002-add-LT_INIT.patch b/package/fstrcmp/0002-add-LT_INIT.patch
> new file mode 100644
> index 0000000000..cc55ae48c9
> --- /dev/null
> +++ b/package/fstrcmp/0002-add-LT_INIT.patch
> @@ -0,0 +1,28 @@
> +add LT_INIT
> +
> +Add LT_INIT so lt-main.sh will be copied and patched to fix musl static build
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> +
> +diff -Nura fstrcmp-0.7.D001.orig/configure.ac fstrcmp-0.7.D001/configure.ac
> +--- fstrcmp-0.7.D001.orig/configure.ac	2021-09-02 15:20:38.033208084 +0200
> ++++ fstrcmp-0.7.D001/configure.ac	2021-09-02 15:37:08.625837688 +0200
> +@@ -53,6 +53,7 @@
> + dnl! AC_ADD_CFLAGS(-Werror)
> + dnl! AC_ADD_CFLAGS([-Wl,--as-needed])
> + 
> ++LT_INIT
> + AC_CHECK_PROGS(LIBTOOL, libtool)
> + 
> + if test -z "$LIBTOOL"
> +diff -Nura fstrcmp-0.7.D001.orig/Makefile.in fstrcmp-0.7.D001/Makefile.in
> +--- fstrcmp-0.7.D001.orig/Makefile.in	2021-09-02 15:20:38.033208084 +0200
> ++++ fstrcmp-0.7.D001/Makefile.in	2021-09-02 15:38:38.622832929 +0200
> +@@ -34,6 +34,7 @@
> + #
> + # directory containing the source
> + #
> ++top_builddir = @srcdir@
> + srcdir = @srcdir@
> + VPATH = @srcdir@
> + 
> diff --git a/package/fstrcmp/fstrcmp.mk b/package/fstrcmp/fstrcmp.mk
> index 9c42159afb..9b6419ae3f 100644
> --- a/package/fstrcmp/fstrcmp.mk
> +++ b/package/fstrcmp/fstrcmp.mk
> @@ -10,8 +10,8 @@ FSTRCMP_SITE = https://sourceforge.net/projects/fstrcmp/files/fstrcmp/$(FSTRCMP_
>  FSTRCMP_LICENSE = GPL-3.0+
>  FSTRCMP_LICENSE_FILES = LICENSE
>  FSTRCMP_INSTALL_STAGING = YES
> -FSTRCMP_DEPENDENCIES = host-libtool
> -FSTRCMP_CONF_ENV = LIBTOOL="$(HOST_DIR)/bin/libtool"
> +# We're patching configure.ac
> +FSTRCMP_AUTORECONF = YES
>  
>  FSTRCMP_MAKE_OPTS = all-bin libdir/pkgconfig/fstrcmp.pc
>  
> 


More information about the buildroot mailing list