libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -no_fixup_chains patch


From: Gary V. Vaughan
Subject: Re: -no_fixup_chains patch
Date: Fri, 5 Jul 2024 11:53:50 -0700

 
On Jul 5, 2024, at 8:05 AM, Ileana Dumitrescu <ileanadumitrescu95@gmail.com> wrote:

On 04/07/2024 20:55, Gary V. Vaughan wrote:
On Jul 2, 2024, at 12:01 PM, Václav Haisman <vhaisman@gmail.com> wrote:

On 28. 06. 24 0:41, Ozkan Sezer wrote:
[Sorry, I seem to have deleted the mailing list message from my inbox]
Regarding -no_fixup_chains patch i.e.
 http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=commitdiff;h=3d1baeeef90a6b9e16c545babe833f28dca155a7
Is '+=' universally supported?? Maybe change to something like the following??

Is there a reason not to use AS_VAR_APPEND? (https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Polymorphic-Variables.html)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 381d4cb..31f1be0 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1032,3 +1032,3 @@
       [ save_LDFLAGS=$LDFLAGS
-        LDFLAGS+=" -Wl,-no_fixup_chains"
+        LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
         AC_LINK_IFELSE(
@@ -1093,3 +1093,3 @@ _LT_EOF
           if test yes = "$lt_cv_support_no_fixup_chains"; then
-            _lt_dar_allow_undefined+=' $wl-no_fixup_chains'
+            _lt_dar_allow_undefined='$_lt_dar_allow_undefined
$wl-no_fixup_chains'
           fi
AS_VAR_APPEND goes through a lot of setup at Libtool build-time, and eventually ends up calling a shell function as_fn_append at runtime anyway.   Since Libtool includes funclib.sh, it would be simpler to use func_append in this case: https://github.com/gnulib-modules/bootstrap/blob/master/build-aux/funclib.sh#L532-L549 <https://github.com/gnulib-modules/bootstrap/blob/master/build-aux/funclib.sh#L532-L549>

It is simpler than AS_VAR_APPEND, and it still includes the ability
to utilize the '+=' extension, which I do prefer. I have attached a proposed patch for this implementation. Unless there is an issue with
including the functionality of funclib.sh in libtool.m4, I will apply
this patch early next week.

+            # Include functionality from bootstrap script funclib.sh
+            . $ac_aux_dir/funclib.sh

Oh!  My memory is poor… I had thought LT_INIT was already running:

 . "$abs_top_srcdir/build-aux/funclib.sh”

Or even injecting funclib.sh content directly into the generated configure script in order to ensure definitions from funclib.sh at configure time, just like testsuite.at (and bootstrap, ltmain, libtoolize at runtime).  It might make more sense to put that line somewhere in LT_INIT after abs_top_srcdir has been set so that all the functions from funclib.sh are available to simplify other configuration macros at configure time, although I worry about looking up the path to that script from other projects’ build scripts.

Anyway, I think I prefer one of the following two approaches than this most recent patch of yours:

1. Arrange for m4 (i.e. autoconf) to inject the body of funclib.sh near the top of configure so that it’s functions can be used indiscriminately from the rest of libtool.m4 and open the door to many more simplifications where we currently rely on AS_ macros;
2. Always use AS_* macros at autoconf time to pull in exactly what shell functions are used (as_fn_append etc) on demand, and leave funclib.sh for ltmain, libtoolize et. al (i.e. same as your previous AS_VAR_APPEND patch).

Sorry for adding confusion to this thread!

Cheers,
Gary


reply via email to

[Prev in Thread] Current Thread [Next in Thread]