Subject: Re: bug#78321: libtool fails to run ldconfig correctly on GNU/Linux

From: Ileana Dumitrescu <[email-masked]>
Date: Tue, 13 May 2025 21:20:31 +0300

On 13/05/2025 18:18, Ileana Dumitrescu wrote:
> On 13/05/2025 14:38, Bob Friesenhahn wrote:
>> Libtool works on many different operating systems, which behave in 
>> various ways. Some OSs will find a new library automatically if it is 
>> installed in the existing configured library paths.
>>
>> The library installed might not ever be intended to be used by the 
>> currently executing OS because it is part of new distribution builds.
>>
>> Sometimes libraries are installed privately, using hard-coded run- 
>> paths in the dependent binaries. This is very common when a different 
>> version of the software is to be run than the OS is designed to support.
>>
>> Expecting a libtool (merely a shell script!) maintainer to write such 
>> a document is unreasonable. It is possible that GNU has such a 
>> document specific to GNU systems.
> 
> Thank you for your explanation. I think this can be described briefly in
> notes.texi to list some of what you outlined above.
> 
>> On Tue, May 13, 2025, 4:12 AM Reuben Thomas via bug-libtool via Bug 
>> reports for the GNU libtool shared library maintenance tool <bug- 
>> [email-masked] <mailto:[email-masked]>> wrote:
>>       * explains that users may now need to run ldconfig
>>       * gives them the command to run
>>       * /says why this might not be a good idea *(this bit currently
>>         missing!)
>>         */
>>       * explains what won't work until the command is run
> 
> Since libtool is designed to be portable and with the variability for
> each system and user needs, I will not add the informational message
> to the finishing mode. However, I will add an incomplete list of
> issues to libtool's documentation.

I have attached a proposed patch for review. I made minor changes to the
explanation Bob provided, but it is largely the same.

-- 
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index aaf48f14..a948158e 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -2322,6 +2322,14 @@ func_mode_finish ()
       fi
       echo
 
+      echo "After a 'make install' for many GNU/Linux systems, 'ldconfig LIBDIR'"
+      echo "may need to be executed to help locate newly installed libraries,"
+      echo "but you should consult with a system administrator before updating"
+      echo "the shared library cache as this should be done with great care"
+      echo "and consideration. (See the 'Platform-specific configuration notes'"
+      echo "section of the documentation for more information.)"
+      echo
+
       echo "See any operating system documentation about shared libraries for"
       case $host in
 	solaris2.[6789]|solaris2.1[0-9])
diff --git a/doc/notes.texi b/doc/notes.texi
index 7b6ade8d..712f09ee 100644
--- a/doc/notes.texi
+++ b/doc/notes.texi
@@ -82,4 +82,28 @@ default. If this occurs for the dynamic library path, you may use the
 @command{autoconf} cache variables @code{lt_cv_sys_lib_search_path_spec} and
 @code{lt_cv_sys_lib_dlsearch_path_spec} respectively.
 
+@item
+For many GNU/Linux systems, the shared library cache is not updated after a
+@command{make install}. Instead, the user will need to manually execute
+@command{ldconfig 'LIBDIR'} to locate newly installed libraries. Users
+should consult a system administrator as this should be done with great
+care. Here are some considerations:
+
+@itemize
+@item
+Libtool is designed to be portable to many different operating systems, and
+these OSs behave in various ways. Some OSs will find a new library
+automatically if it is installed in the existing configured library paths.
+
+@item
+The library installed might not ever be intended to be used by the currently
+executing OS because it is part of new distribution builds.
+
+@item
+Sometimes libraries are installed privately, using hard-coded run-paths in
+their dependent binaries. This is very common when a different version of
+the software is to be run than the OS is designed to support.
+
+@end itemize
+
 @end itemize