[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Enabling hardening flags for HIP libraries



The eventual result of hardening=xxx is additional CXXFLAGS/CPPFLAGS/LDFLAGS.
You may lookup dpkg-buildflags(1) man page for details.

I did not manage to recall an elegant way to dump these flags, but you may
copy the actual compiler flags from the man page and manually add them
to {CXX,CPP,LD} flags as a temporary workaround.

Maybe someone else has a better idea.

On Fri, 2023-03-03 at 20:45 -0700, Cordell Bloor wrote:
> Hello,
> The various AMD ROCm libraries containing GPU code are all currently being built using the option:
> export DEB_BUILD_MAINT_OPTIONS = hardening=-all
> This is because many of the various hardening flags (e.g., -fstack-protector-strong) are not supported in device code.
> However, I recently discovered that you can somewhat address this problem by using -Xarch_host to pass the flag only
> the the host compiler (e.g. -Xarch_host -fstack-protector-strong).
> I'm not sure how to add this prefix to the hardening flags from dpkg-buildflags in a generic way, but I thought it was
> worth mentioning. We could always set them manually for the moment, until HIP language support is working for CMake on
> Debian and we can push the logic up into the standard places.
> Sincerely,
>  Cory Bloor
>  



Reply to: