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

Enabling hardening flags for HIP libraries



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: