]> git.itanic.dy.fi Git - linux-stable/commit
modpost: avoid using the alias attribute
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 27 Jan 2024 13:28:11 +0000 (22:28 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 31 Jan 2024 14:24:27 +0000 (23:24 +0900)
commitcda5f94e88b45c9209599bac15fc44add5a59f60
tree9e022990f26e1aaae78b3e354c70cf845116a21d
parent89876175c8c83c35cf0cc8e21b7460dfed7b118a
modpost: avoid using the alias attribute

Aiden Leong reported modpost fails to build on macOS since commit
16a473f60edc ("modpost: inform compilers that fatal() never returns"):

  scripts/mod/modpost.c:93:21: error: aliases are not supported on darwin

Nathan's research indicates that Darwin seems to support weak aliases
at least [1]. Although the situation might be improved in future Clang
versions, we can achieve a similar outcome without relying on it.

This commit makes fatal() a macro of error() + exit(1) in modpost.h, as
compilers recognize that exit() never returns.

[1]: https://github.com/llvm/llvm-project/issues/71001

Fixes: 16a473f60edc ("modpost: inform compilers that fatal() never returns")
Reported-by: Aiden Leong <aiden.leong@aibsd.com>
Closes: https://lore.kernel.org/all/d9ac2960-6644-4a87-b5e4-4bfb6e0364a8@aibsd.com/
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c
scripts/mod/modpost.h