Loading
mock.h: apply "used" attribute to DECLARE_WRAPPER, not DEFINE_WRAPPER
Some unit tests such as nvmf/tcp use DECLARE_WRAPPER but then define it explicitly rather than using DEFINE_WRAPPER. DEFINE_WRAPPER would apply __attribute__((used)) to the function definition, nvmf/tcp doesn't have that for its __wrap_RAND_bytes() function, and LTO would complain. By applying it to the DECLARE_WRAPPER instead, any users of these macros get that attribute applied, whether they use DEFINE_WRAPPER or define the wrapper function themselves. Fixes issue #3386. Signed-off-by:Jim Harris <jim.harris@samsung.com> Change-Id: I072835cc280b9057e1cb7b038d715634e830216f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23306 Reviewed-by:
Konrad Sztyber <konrad.sztyber@intel.com> Community-CI: Mellanox Build Bot Reviewed-by:
Ben Walker <ben@nvidia.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>