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> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23306 (master) (cherry picked from commit 274b06d3) Change-Id: I072835cc280b9057e1cb7b038d715634e830216f Signed-off-by:
Marek Chomnicki <marek.chomnicki@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23347 Reviewed-by:
Jim Harris <jim.harris@samsung.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Konrad Sztyber <konrad.sztyber@intel.com>