[LLVMbugs] [Bug 12835] New: regression(r156821): chromium components build broken due to changes in visibility handling

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 15 13:07:54 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12835

             Bug #: 12835
           Summary: regression(r156821): chromium components build broken
                    due to changes in visibility handling
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8568
  --> http://llvm.org/bugs/attachment.cgi?id=8568
repro

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<typename DataType>
class DeviceDataProviderImplBase : public DeviceDataProviderImplBaseHack {};

template<typename DataType>
class DeviceDataProvider {
  typedef DeviceDataProviderImplBase<DataType>* (*ImplFactoryFunction)(void);
  __attribute__((visibility("default"))) static
DeviceDataProviderImplBase<DataType>*       DefaultFactoryFunction();
  __attribute__((visibility("default"))) static ImplFactoryFunction
factory_function_;
};

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

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list