Switch from _Noreturn to __attribute__((noreturn))
commit460748d4aeb1ed3c78efdd562fcf3d2eaa9ff536
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 23 Mar 2022 15:51:00 +0000 (23 08:51 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Mar 2022 15:51:00 +0000 (23 08:51 -0700)
tree4306b254cee276ba810e507173a0a75d42b9a311
parentb73505c7e056417cba73dcf51b49062c84fd2b59
Switch from _Noreturn to  __attribute__((noreturn))

Parts of the Linux kernel build system struggle with _Noreturn.  This
results in the following warnings when building on RHEL 8.5, and likely
other environments.  Switch to using the __attribute__((noreturn)).

  warning: objtool: dbuf_free_range()+0x2b8:
    return with modified stack frame
  warning: objtool: dbuf_free_range()+0x0:
    stack state mismatch: cfa1=7+40 cfa2=7+8
  ...
  WARNING: EXPORT symbol "arc_buf_size" [zfs.ko] version generation
    failed, symbol will not be versioned.
  WARNING: EXPORT symbol "spa_open" [zfs.ko] version generation
    failed, symbol will not be versioned.
  ...

Additionally, __thread_exit() has been renamed spl_thread_exit() and
made a static inline function.  This was needed because the kernel
will generate a warning for symbols which are __attribute__((noreturn))
and then exported with EXPORT_SYMBOL.

While we could continue to use _Noreturn in user space I've also
switched it to __attribute__((noreturn)) purely for consistency
throughout the code base.

Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13238
29 files changed:
cmd/raidz_test/raidz_test.c
cmd/zfs/zfs_main.c
cmd/zgenhostid/zgenhostid.c
cmd/zhack/zhack.c
cmd/zpool/zpool_main.c
cmd/ztest/ztest.c
include/libuutil.h
include/os/linux/spl/sys/thread.h
include/sys/zfs_context.h
lib/libuutil/uu_pname.c
lib/libzpool/kernel.c
lib/libzpool/taskq.c
module/lua/ldo.c
module/os/linux/spl/spl-thread.c
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu_recv.c
module/zfs/dmu_redact.c
module/zfs/dmu_send.c
module/zfs/mmp.c
module/zfs/spa.c
module/zfs/txg.c
module/zfs/vdev_initialize.c
module/zfs/vdev_rebuild.c
module/zfs/vdev_removal.c
module/zfs/vdev_trim.c
module/zfs/zthr.c
tests/zfs-tests/cmd/mkbusy/mkbusy.c
tests/zfs-tests/cmd/mkfile/mkfile.c