https://bugzilla.redhat.com/show_bug.cgi?id=2215174
Jeremy Newton alexjnewt@fastmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
--- Comment #1 from Jeremy Newton alexjnewt@fastmail.com --- I have a bit of a list of concerns before I run through the review.
head-only libraries are inherently static, so you need to add the %{name}-static provides to the devel package: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header...
rpmlint will likely complain that you only put only noarch files in libdir. I'd recommend just adding -DCMAKE_INSTALL_LIBDIR=share to install the cmake into datadir. This is actually what debian does: https://salsa.debian.org/rocm-team/rocprim/-/blob/master/debian/rules#L13 As well, I touched base with the upstream developers and the intention is to install it in datadir in the long term, but there's a bug in rocm-cmake. I wonder if the devel package should be made noarch... you would need to peek into the cmake files to see if it injects any compiler flags. If it doesn't I would recommend making the devel package noarch but keeping the top level normal due to the build requirements.
These lines should be removed:
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ %exclude /usr/rocprim
And you should add "-DROCM_SYMLINK_LIBS=OFF" like I did with rocrand. This should fix the odd installation.
My gut says that you should add NOTICES.txt to the license macro too, since it contains copyright information.
I would add "BuildRequires: doxygen" so you don't forget to package the doxygen files when they fix the cmake to build it by default.
So the two optflags that hip libraries don't like are "-fstack-protector-strong" and "-fcf-protection". I tested and if you prepend "-Xarch_host " it will resolve the issue and allow enabling hardening. Note that Debian does this with fstack-protector-strong. E.g. something crude like this works:
%global optflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/' | sed 's/-Xarch_host -Xarch_host/-Xarch_host/g')
I'm thinking I should patch this logic into hipcc to save us some future headaches, as it would allow hip libraries to work without touching the optflags or disabling hardening. Any thoughts?