Bug 2052520

Summary: bout++ bout-config has in appropriate link flags
Product: [Fedora] Fedora Reporter: Zbigniew JÄ™drzejewski-Szmek <zbyszek>
Component: bout++Assignee: david08741
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: david08741
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 22:04:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2045230    
Bug Blocks:    

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.