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

GCC produces ABI-incompatible libc++ dylibs #29739

Closed
llvmbot opened this issue Sep 15, 2016 · 2 comments
Closed

GCC produces ABI-incompatible libc++ dylibs #29739

llvmbot opened this issue Sep 15, 2016 · 2 comments
Labels
bugzilla Issues migrated from bugzilla confirmed Verified by a second party libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 15, 2016

Bugzilla Link 30391
Version unspecified
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @mclow

Extended Description

GCC handles _LIBCPP_INLINE_VISIBILITY differently than Clang. In particular when the attributes are applied to symbols which are externally instantiated.

For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'.

// RUN: g++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
// RUN: clang++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
template
struct Foo {
void foo();
void bar();
};

template
void Foo::foo() {}

template
inline attribute((visibility("hidden"), always_inline))
void Foo::bar() {}

template struct Foo;

One way to fix this would be to add _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY which is defined as attribute((visibility("default"), always_inline)).

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 15, 2016

See also:

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@llvmbot llvmbot added the confirmed Verified by a second party label Jan 26, 2022
@philnik777
Copy link
Contributor

This has been addressed by https://llvm.org/D24602.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla confirmed Verified by a second party libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

2 participants