Bug 2052520 - bout++ bout-config has in appropriate link flags
Summary: bout++ bout-config has in appropriate link flags
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: bout++
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: david08741
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2045230
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-09 13:43 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2023-05-03 22:04 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-05-03 22:04:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2022-02-09 13:43:53 UTC
Description of problem:
/usr/lib64/openmpi/bin/bout-config --libs prints:
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/BOUT++-v4.4.0/.package_note-bout++-4.4.0-6.fc36.x86_64.ld -lm -L/usr/lib64/openmpi/lib -lbout++ -lm -lfftw3 -L/usr/lib64 -lnetcdf_c++4 -lnetcdf -L/usr/lib64 -lhdf5_hl -lhdf5 -lhdf5_hl -lsz -lz -ldl -lm -L/usr/lib64/openmpi/lib -lpetsc -lhdf5 -lsundials_ida -lsundials_nvecparallel -lsundials_cvode -lsundials_nvecparallel -lsundials_arkode -lsundials_nvecparallel -L/usr/lib64/openmpi/lib -lpvode -lpvpre


"-L/usr/lib64/openmpi/lib -lpvode -lpvpre -lbout++" is OK (I think. Are all three libraries needed?)

But the rest should not be exported in --libs. Link flags like -z,relro and --as-needed are part of the distro policy, and should either be added again (when doing distro builds) or part of the user link config. -spec=* is only appropriate for distro builds.  -Wl,-dT,/builddir/build/BUILD/BOUT++-v4.4.0/.package_note-bout++-4.4.0-6.fc36.x86_64.ld only works in the build environment where the linker script was available. And all the rest is libraries that libpvode/libbout++/libpvpre link to and this will be handled by the dynamic linker, no need to relink them to programs using libbout++.

I would try to fix this myself, but I can't get the package to build, see #2045230.

Version-Release number of selected component (if applicable):
bout++-openmpi-4.4.0-6.fc36.x86_64
bout++-mpich-4.4.0-6.fc36.x86_64

Comment 1 david08741 2022-02-28 21:31:14 UTC
`-L` should not be needed.
I think all three are needed - this is fixed in the development version, where only -lbout++ is needed.

If you have time to fix this a PR / push would be appreciated.

Thanks for reporting :-)

Comment 2 Ben Cotton 2022-08-09 13:12:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.


Note You need to log in before you can comment on or make changes to this bug.