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

regression(r156821): chromium components build broken due to changes in visibility handling #13207

Closed
nico opened this issue May 15, 2012 · 3 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@nico
Copy link
Contributor

nico commented May 15, 2012

Bugzilla Link 12835
Resolution FIXED
Resolved on Nov 07, 2018 00:17
Version unspecified
OS All
Attachments repro
CC @DougGregor

Extended Description

Compile the attachment with

clang++ -c repro.ii -fvisibility=hidden

then run nm -m repro.o.

gcc4.2 and clang prior to r156821 resulted in:

0000000000000000 (__DATA,__data) external __ZN18DeviceDataProviderI9RadioDataE17factory_function_E
(undefined) external __ZN18DeviceDataProviderI9RadioDataE22DefaultFactoryFunctionEv

clang with r156821 results in:

0000000000000000 (__DATA,__data) private external __ZN18DeviceDataProviderI9RadioDataE17factory_function_E
(undefined) external __ZN18DeviceDataProviderI9RadioDataE22DefaultFactoryFunctionEv

This breaks the chromium component build, target 'content_unittest' no longer links.

$ cat repro.ii

struct attribute((visibility("default"))) RadioData {};

class attribute((visibility("default"))) DeviceDataProviderImplBaseHack {};

template
class DeviceDataProviderImplBase : public DeviceDataProviderImplBaseHack {};

template
class DeviceDataProvider {
typedef DeviceDataProviderImplBase* (ImplFactoryFunction)(void);
attribute((visibility("default"))) static DeviceDataProviderImplBase
DefaultFactoryFunction();
attribute((visibility("default"))) static ImplFactoryFunction factory_function_;
};

template<>
DeviceDataProvider::ImplFactoryFunction
DeviceDataProvider::factory_function_ = DefaultFactoryFunction;

@llvmbot
Copy link
Collaborator

llvmbot commented May 15, 2012

reduces to:

template
struct foo {
attribute((visibility("default"))) static int bar;
};

template
int foo::bar;

int f() {
return foo::bar;
}

@llvmbot
Copy link
Collaborator

llvmbot commented May 16, 2012

Fixed in r156897.

@nico
Copy link
Contributor Author

nico commented May 16, 2012

Verified. Thanks!

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

2 participants