New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang claims weak aliases are not supported on Darwin but only when using __attribute__, works fine with #pragma #71001
Comments
This could be seen as a dupe of #11488, albeit that report was about the error message which used to be |
CC @rjmccall |
@llvm/issue-subscribers-clang-frontend Author: None (CodingMarkus)
clang claims weak aliases are not supported on Darwin. The following code doesn't compile:
Output:
But that's not true. Weak aliases are supported on Darwin. The following code will compile and will behave correctly:
|
Aiden Leong reported modpost fails to build on macOS since commit 16a473f ("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]: llvm/llvm-project#71001 Fixes: 16a473f ("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>
Aiden Leong reported modpost fails to build on macOS since commit 16a473f ("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]: llvm/llvm-project#71001 Fixes: 16a473f ("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>
clang claims weak aliases are not supported on Darwin. The following code doesn't compile:
Output:
But that's not true. Weak aliases are supported on Darwin. The following code will compile and will behave correctly:
The text was updated successfully, but these errors were encountered: