Nick Connolly 424cbc3957 lib/util/math.c: improve portability
__builtin_clzl takes an unsigned long argument which may be smaller
than uint64_t on some platforms. GCC silently ignores the mismatch,
returning the wrong answer at runtime. Use __builtin_clzll instead and
add static assertions to detect the issue.

Attribute 'target_clones' requires 'ifunc' support which only applies to
ELF targets. Add check for defined(__ELF__).

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Iff76640b34223649de531250ad40471d829512c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6317
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-02-10 08:44:01 +00:00
..
2020-09-15 07:12:44 +00:00
2020-08-27 08:34:07 +00:00
2019-05-15 18:54:27 +00:00
2021-02-05 14:43:47 +00:00
2021-02-10 08:44:01 +00:00
2020-03-31 07:59:26 +00:00
2018-12-06 22:25:09 +00:00