Hi Christian,

On 18/02/2025 10:49, Christian Feld wrote:
Dear libtoolers,

the macro _LT_SYS_HIDDEN_LIBDEPS sets the _LT_TAGDECLs

   predep_objects,
   postdep_objects,
   predeps (always empty),
   postdeps,
   compiler_lib_search_dirs, and
   compiler_lib_search_path.

_LT_SYS_HIDDEN_LIBDEPS is expanded for CXX and FC only.
It uses $output_verbose_link_cmd to determine the values of the above variables. output_verbose_link_cmd is set in _LT_LANG_CXX_CONFIG and _LT_DARWIN_LINKER_FEATURES only. Thus, if there is no CXX and we are not on DARWIN, output_verbose_link_cmd in not set and for FC the above variables are not set.

Is this coupling between FC and CXX and FC and DARWIN intended?

What is the purpose of these variables? I'm sure there is a purpose, as _LT_LANG_CXX_CONFIG takes quite some effort to set output_verbose_link_cmd, 13 times in total. But why extract libs and path from the verbose linker output of the CXX compiler, if we use the same compiler for linking later on (at least this is what I experience on Linux)?

There are a few instances where some compilers are passing libraries or
object files by default that are unnecessary or cause failures depending
on the operating system. Here is one example:

  # Commands to make compiler produce verbose output that lists
  # what "hidden" libraries, object files and flags are used when
  # linking a shared library.
  #
  # There doesn't appear to be a way to prevent this compiler from
  # explicitly linking system object files so we need to strip them
  # from the output so that they don't get included in the library
  # dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'

What is different for C, F77, GCJ, and GO that we don't need to evaluate the verbose linker output there? Do we need the variables for FC?

BTW, _LT_SYS_HIDDEN_LIBDEPS contains code for F77, GCJ, and GO that is never used as _LT_SYS_HIDDEN_LIBDEPS is not expanded for these tags.

There are known issues with CXX compilers, and from looking through the
git history, I think the test code for other tags was added in
preparation for other compiler issues. I do not see a reason for FC
compilers to need _LT_SYS_HIDDEN_LIBDEPS, so it can probably be
removed... If there it is not causing failures, I would prefer to keep
it to prevent causing failures for an issue I do not see currently.

--
Ileana Dumitrescu

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

Attachment: OpenPGP_0x6570EA01146F7354.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to