All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/pkg-autotools.mk: further refine libtool 2.6 patching
@ 2026-10-11  7:46 Thomas Petazzoni via buildroot
  2026-10-23  7:38 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-11  7:46 UTC (permalink / raw)
  To: Buildroot List; +Cc: Thomas Petazzoni

5dbba2616f287cf6d333a0849ef870b0ce49f24f ("package/pkg-autotools.mk:
also handle libtool 2.6.x") added some patching logic for libtool
2.6.x, in order to fix a build issue in cryptsetup, which uses libtool
2.6.2.

However, the change in this commit applied the newly added libtool
patch to all 2.6.x libtool versions.. which broke libmodbus that uses
libtool 2.6.0, and unfortunately the ltmain.sh in libtool 2.6.0 and
2.6.2 is sufficiently different that the same patch doesn't apply to
both.

So we:

1. Rename buildroot-libtool-v2.6.patch to buildroot-libtool-v2.6.2.patch

2. Introduce a buildroot-libtool-v2.6.0.patch

3. Update the logic in pkg-autotools.mk to apply
   buildroot-libtool-v2.6.0.patch to libtool 2.6.0 and 2.6.1, and
   buildroot-libtool-v2.6.2.patch to libtool 2.6.2 and later. Note that
   we didn't test with libtool 2.6.1 as we didn't identify a package
   using this libtool version: we for now assume that it will be like
   2.6.0, and will fix later if needed.

Fixes: https://autobuild.buildroot.net/results/3faf9e6889cbe33019141450a95023c730a6d03c/
Fixes: 5dbba2616f287cf6d333a0849ef870b0ce49f24f ("package/pkg-autotools.mk: also handle libtool 2.6.x")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 .checkpackageignore                           |  3 +-
 package/pkg-autotools.mk                      |  6 +++-
 ...6.patch => buildroot-libtool-v2.6.0.patch} | 28 +++++++++----------
 ...6.patch => buildroot-libtool-v2.6.2.patch} |  0
 4 files changed, 21 insertions(+), 16 deletions(-)
 copy support/libtool/{buildroot-libtool-v2.6.patch => buildroot-libtool-v2.6.0.patch} (86%)
 rename support/libtool/{buildroot-libtool-v2.6.patch => buildroot-libtool-v2.6.2.patch} (100%)

diff --git a/.checkpackageignore b/.checkpackageignore
index 83c1e0c66a..7ad121d393 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -981,7 +981,8 @@ support/libtool/buildroot-libtool-v1.5.patch lib_patch.ApplyOrder lib_patch.Sob
 support/libtool/buildroot-libtool-v2.2.patch lib_patch.ApplyOrder lib_patch.Sob lib_patch.Upstream
 support/libtool/buildroot-libtool-v2.4.4.patch lib_patch.ApplyOrder lib_patch.Upstream
 support/libtool/buildroot-libtool-v2.4.patch lib_patch.ApplyOrder lib_patch.Sob lib_patch.Upstream
-support/libtool/buildroot-libtool-v2.6.patch lib_patch.ApplyOrder lib_patch.Upstream
+support/libtool/buildroot-libtool-v2.6.0.patch lib_patch.ApplyOrder lib_patch.Upstream
+support/libtool/buildroot-libtool-v2.6.2.patch lib_patch.ApplyOrder lib_patch.Upstream
 support/misc/relocate-sdk.sh Shellcheck
 support/scripts/apply-patches.sh Shellcheck
 support/scripts/check-bin-arch Shellcheck
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index da33909881..bb65d639df 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -77,7 +77,11 @@ define LIBTOOL_PATCH_HOOK
 		elif test $${ltmain_version} = "2.5"; then\
 			patch -i support/libtool/buildroot-libtool-v2.4.4.patch $${i}; \
 		elif test $${ltmain_version} = "2.6"; then\
-			patch -i support/libtool/buildroot-libtool-v2.6.patch $${i}; \
+			if test $${ltmain_patchlevel:-0} -ge 2; then\
+				patch -i support/libtool/buildroot-libtool-v2.6.2.patch $${i}; \
+			else \
+				patch -i support/libtool/buildroot-libtool-v2.6.0.patch $${i}; \
+			fi \
 		fi \
 	done
 endef
diff --git a/support/libtool/buildroot-libtool-v2.6.patch b/support/libtool/buildroot-libtool-v2.6.0.patch
similarity index 86%
copy from support/libtool/buildroot-libtool-v2.6.patch
copy to support/libtool/buildroot-libtool-v2.6.0.patch
index b3968b1289..ece3134ce9 100644
--- a/support/libtool/buildroot-libtool-v2.6.patch
+++ b/support/libtool/buildroot-libtool-v2.6.0.patch
@@ -1,11 +1,11 @@
 Libtool fixes for cross-compilation, many past contributors/authors.
-Update based on libtool-2.6.2.
+Update based on libtool-2.6.0.
 
-Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 
---- a/ltmain.sh
-+++ b/ltmain.sh
-@@ -3008,9 +3008,8 @@
+--- a/ltmain.sh	2026-10-11 09:19:50.195676649 +0200
++++ b/ltmain.sh	2026-10-11 09:20:44.054085154 +0200
+@@ -3015,9 +3015,8 @@
  	# was found and let the user know that the "--tag" command
  	# line option must be used.
  	if test -z "$tagname"; then
@@ -17,7 +17,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  #	else
  #	  func_verbose "using $tagname tagged configuration"
  	fi
-@@ -4746,8 +4745,12 @@
+@@ -4753,8 +4752,12 @@
  	  # At present, this check doesn't affect windows .dll's that
  	  # are installed into $libdir/../bin (currently, that works fine)
  	  # but it's something to keep an eye on.
@@ -32,9 +32,9 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  
  	  if test -n "$inst_prefix_dir"; then
  	    # Stick the inst_prefix_dir data into the link command.
-@@ -7063,7 +7066,8 @@
+@@ -7062,7 +7065,8 @@
  	;;
-       -all-static | -static | -static-libtool-libs | --static | -Bstatic)
+       -all-static | -static | -static-libtool-libs)
  	case $arg in
 -	-all-static)
 +	# Make -static behave like -all-static -GZ
@@ -42,7 +42,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  	    func_warning "complete static linking is impossible in this configuration"
  	  fi
-@@ -7072,12 +7076,6 @@
+@@ -7071,12 +7075,6 @@
  	  fi
  	  prefer_static_libs=yes
  	  ;;
@@ -52,10 +52,10 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
 -	  fi
 -	  prefer_static_libs=built
 -	  ;;
- 	-static-libtool-libs | --static | -Bstatic)
+ 	-static-libtool-libs)
  	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  	    dlopen_self=$dlopen_self_static
-@@ -7393,7 +7391,8 @@
+@@ -7382,7 +7380,8 @@
        prevarg=$arg
  
        case $arg in
@@ -65,7 +65,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  	if test -n "$link_static_flag"; then
  	  # See comment for -static flag below, for more details.
  	  func_append compile_command " $link_static_flag"
-@@ -7695,7 +7694,7 @@
+@@ -7684,7 +7683,7 @@
  	continue
  	;;
  
@@ -74,7 +74,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  	# The effects of -static are defined in a previous loop.
  	# We used to do the same as -all-static on platforms that
  	# didn't have a PIC flag, but the assumption that the effects
-@@ -8755,7 +8754,7 @@
+@@ -8718,7 +8717,7 @@
  	  *)
  	    if test no = "$installed"; then
  	      func_append notinst_deplibs " $lib"
@@ -83,7 +83,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  	    fi
  	    ;;
  	  esac
-@@ -11296,6 +11295,10 @@
+@@ -11247,6 +11246,10 @@
  	    # Replace all uninstalled libtool libraries with the installed ones
  	    newdependency_libs=
  	    for deplib in $dependency_libs; do
diff --git a/support/libtool/buildroot-libtool-v2.6.patch b/support/libtool/buildroot-libtool-v2.6.2.patch
similarity index 100%
rename from support/libtool/buildroot-libtool-v2.6.patch
rename to support/libtool/buildroot-libtool-v2.6.2.patch
-- 
2.55.0

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

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

* Re: [Buildroot] [PATCH] package/pkg-autotools.mk: further refine libtool 2.6 patching
  2026-10-11  7:46 [Buildroot] [PATCH] package/pkg-autotools.mk: further refine libtool 2.6 patching Thomas Petazzoni via buildroot
@ 2026-10-23  7:38 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-23  7:38 UTC (permalink / raw)
  To: Buildroot List

On Sun, Oct 11, 2026 at 09:46:58AM +0200, Thomas Petazzoni via buildroot wrote:
> 5dbba2616f287cf6d333a0849ef870b0ce49f24f ("package/pkg-autotools.mk:
> also handle libtool 2.6.x") added some patching logic for libtool
> 2.6.x, in order to fix a build issue in cryptsetup, which uses libtool
> 2.6.2.
> 
> However, the change in this commit applied the newly added libtool
> patch to all 2.6.x libtool versions.. which broke libmodbus that uses
> libtool 2.6.0, and unfortunately the ltmain.sh in libtool 2.6.0 and
> 2.6.2 is sufficiently different that the same patch doesn't apply to
> both.
> 
> So we:
> 
> 1. Rename buildroot-libtool-v2.6.patch to buildroot-libtool-v2.6.2.patch
> 
> 2. Introduce a buildroot-libtool-v2.6.0.patch
> 
> 3. Update the logic in pkg-autotools.mk to apply
>    buildroot-libtool-v2.6.0.patch to libtool 2.6.0 and 2.6.1, and
>    buildroot-libtool-v2.6.2.patch to libtool 2.6.2 and later. Note that
>    we didn't test with libtool 2.6.1 as we didn't identify a package
>    using this libtool version: we for now assume that it will be like
>    2.6.0, and will fix later if needed.
> 
> Fixes: https://autobuild.buildroot.net/results/3faf9e6889cbe33019141450a95023c730a6d03c/
> Fixes: 5dbba2616f287cf6d333a0849ef870b0ce49f24f ("package/pkg-autotools.mk: also handle libtool 2.6.x")
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

I took the freedom of applying my own patch, because just yesterday we
had 23 build failures of libmodbus because of this, and I believe the
patch was quite obvious.

Best regards,

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

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

end of thread, other threads:[~2026-10-23  7:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-11  7:46 [Buildroot] [PATCH] package/pkg-autotools.mk: further refine libtool 2.6 patching Thomas Petazzoni via buildroot
2026-10-23  7:38 ` Thomas Petazzoni via buildroot

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.