[ET Trac] #1334: CCTK_CHECK_HEADER_LIB_FUNC adds library multiple times to $LIBS
Roland Haas
trac-noreply at einsteintoolkit.org
Thu Jun 1 10:25:32 CDT 2023
#1334: CCTK_CHECK_HEADER_LIB_FUNC adds library multiple times to $LIBS
Reporter: Frank Löffler
Status: new
Milestone:
Version: development version
Type: bug
Priority: minor
Component: Cactus
Comment (by Roland Haas):
As @{557058:cf051f66-042f-4a92-a2c7-f2be5a7912de} mentions, adding a library multiple times is harmless. Sometimes, for static linking, it is even required if there are two libraries that require functions from each other.
Eg. `libA` contains `funcA1` and `funcA2`. `funcA1` calls `funcB1` in `libB` which itself calls `funcA2` in `libA`. The way to link these correctly for static linking is `-lA -lB -lA` that is one has to repeat one \(or the other\) of the libraries since the linker acts on the library list only once and does so sequentially and will only include objects from a library that if it _already_ knows that the object is required when it processes the library file.
This may not be an issue for `CCTK_CHECK_HEADER_LIB_FUNC` if it only ever uses a single library, but would be an issue if it ever added two libraries since `-lA -lB -lA -lB` is not the same as `-lA -lB`.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/1334/cctk_check_header_lib_func-adds-library
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20230601/7bcad293/attachment-0001.htm>
More information about the Trac
mailing list