Skip to content
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

Weak aliases are not supported on MacOS X #11488

Open
llvmbot opened this issue Oct 12, 2011 · 2 comments
Open

Weak aliases are not supported on MacOS X #11488

llvmbot opened this issue Oct 12, 2011 · 2 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 12, 2011

Bugzilla Link 11116
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@kopinions

Extended Description

When compiling the following (simplified) code fragment:

int get_value(int *value)
{
return *value;
}

int get_value_alias(int *high) attribute ((weak, alias ("get_value")));

for MacOS X, clang reports the following error:

% clang -ccc-host-triple i386-apple-darwin -c -o bug.o bug.c
bug.c:6:54: error: only weak aliases are supported on darwin
int get_value_alias(int *high) attribute ((weak, alias ("get_value")));

It would appear that clang does not support weak aliases on MacOS X (I asked on the cfe-dev list, but nobody suggested a solution). If it is not possible to support weak aliases for this target, I suggest changing the error message to indicate this fact.

@efriedma-quic
Copy link
Collaborator

I'm pretty sure what the error in question is trying to say is that we support weakref, but not any other kind of alias, due to limitations of MachO. It might be worth clarifying the error a bit.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@CodingMarkus
Copy link

Wow, this issue existed for over a decade. The compiler still claims that weak aliases aren't supported but when you use #pragma to define your weak aliases, it works and behaves as expected. See #71001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

3 participants