mainGNU Libtool - Support: sr #111161, aix-soname behavior inconsistent

 
 

sr #111161: aix-soname behavior inconsistent

Submitter:  None
Submitted:  Tue 10 Dec 2024 12:14:16 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  AIX
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 18 Jan 2025 02:01:22 PM UTC, comment #2: 

I have merged the proposed patch into the development branch [1]. I will close this issue when it is merged to master. Any feedback on this patch would be nice.

[1]https://git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=34de5bf8bc311a98f473f6f8ca91301fbf131193

Ileana Dumitrescu <ildumi>
Group administrator
Tue 10 Dec 2024 04:31:24 PM UTC, comment #1: 

Thank you for your bug submission.

Without immediate access to AIX, I reproduced this issue by removing the host constraint for the macro in ltoptions.m4, by editing a test file to use LT_INIT([aix-soname=svr4]), and by cleaning the testsuite's cache.

While this may be an incorrect assumption, autoconf is probably reordering configure. It would be best to have the default set for variable 'enable_shared' before processing _LT_WITH_AIX_SONAME, but I am not sure how best to implement that. The macro _LT_WITH_AIX_SONAME does not have a dependency on any other macros being defined or called before processing, but this does not seem like a good solution.

As a temporary "fix", I have attached a patch that will warn the user if enable_shared has not been set. This patch also adds AC_MSG_CHECKING for "which variant of shared library versioning to provide" to inform the user, even if the default is set. LT_INIT with 'aix-soname=svr4' should work as expected if 'shared' is supplied before it, like LT_INIT([shared aix-soname=svr4]).

(file #56689)

Ileana Dumitrescu <ildumi>
Group administrator
Tue 10 Dec 2024 12:14:16 AM UTC, original submission:  

On AIX, the results of using --with-aix-soname=svr4 and LT_INIT([aix-soname=svr4]) should be the same, but they are not.  One project where this is evident is OpenAFS.  If the --with-aix-soname=svr4 argument is used with ./configure, the resultant build is correct, whereas if the svr4 option is set as the default when generating the configure script by calling LT_INIT with the aix-soname=svr4 argument, the resultant libtool configuration does not build the static/shared libraries correctly.

Not being very familiar with the libtool codebase, I posted this to the mailing list, and Nick Bolwer was kind enough to do some investigation.  His analysis is below:

> In particular, I noticed that if you add libtool to a project by
> calling LT_INIT, and then run ./configure with the
> --with-aix-soname=svr4, the .la files that get produced with the
> library_names='whatever.so.3 whatever.so', but if you call
> LT_INIT([aix-soname=svr4]) and then don't specify --with-aix-soname to
> ./configure, the .la files have library_names='whatever.a whatever.a"
>
> It seems to me that --with-aix-soname=svr4 and
> LT_INIT([aix-soname=svr4]) should be identical, correct?  Is this a
> libtool bug, or is this a bug in the particular project leveraging
> libtool?  (OpenAFS, in this case).


Yes this looks like a libtool bug to me.

I notice that when aix-soname=svr4 is NOT passed to LT_INIT, if you look
in the generated configure script, you can find the following code in
the following order

  ### FIRST PART
  if test "${enable_shared+set} = set; then
  [...]
  else
    enable_shared=yes
  fi

  [...]

  ### SECOND PART
  case $host,$enable_shared in
  power*-*-aix[5-9]*,yes)
  *)
  esac
 
And in this case, when you run configure --with-aix-soname=svr4, you can
see the output line:

  checking which variant of shared library versioning to provide... svr4

But when I use LT_INIT([aix-soname=svr4]), for some reason the order of
these two parts in the configure script are reversed.  As a result, the
default value of enable_shared is not set before it is used, and the
output about shared library versioning is conspicuously missing.  This
probably causes the other strange behaviour as some variables are not
being set properly.

If you explicitly run ./configure --enable-shared it goes back to normal
(with svr4 versioning as expected), as this has the effect of setting
enable_shared=yes early.


Hopefully that provides enough information to track down the issue.  Please let me know if I can provide additional details.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ildumi (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-12-10 ildumi Attached File- Added aix-soname-behaviour-inconsistent.diff, #56689

    Back to the top

    Powered by Savane 3.14-04e1.
    Corresponding source code