[cfe-commits] [patch] Template instantiation and visibility

Nico Weber thakis at chromium.org
Sun Apr 22 22:09:56 PDT 2012


On Sun, Apr 22, 2012 at 9:33 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> The most common cause of that error message is using
>> -fvisibility=hidden or -fvisibility-inlines-hidden inconsistently
>> across translation units.
>
> Probably similar.
>
> We don't merge correctly two or more types with visibility attributes
> in template argument lists. This was not causing problems before, but
> does as we start to mark more symbols hidden.
>
> The attached patch fixes that too. The apple linker is happy at least
> with the delta reduced testcase I had. I will leave a new build
> running during the night.

Thanks. With this patch, 'printing' gives a different linker error:

Undefined symbols for architecture i386:
  "__ZN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiE7SetRectEiiii",
referenced from:
      __ZN8printing9PageSetupC1Ev in printing.page_setup.o
      __ZN8printing9PageSetupC2Ev in printing.page_setup.o
      __ZN8printing9PageSetup5ClearEv in printing.page_setup.o
  "__ZN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiED0Ev",
referenced from:
      __ZTVN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiEE
in printing.printed_document.o
  "__ZN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiED1Ev",
referenced from:
      __ZTVN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiEE
in printing.printed_document.o
  "__ZNK3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiEeqERKS1_",
referenced from:
      __ZNK8printing9PageSetup6EqualsERKS0_ in printing.page_setup.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

tests-MacBook-Pro-2:src test$ nm -m out/Release/libui.dylib | grep
__ZN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiE7SetRectEiiii
00032aa0 (__TEXT,__text) non-external (was a private external)
__ZN3gfx8RectBaseINS_4RectENS_5PointENS_4SizeENS_6InsetsEiE7SetRectEiiii

I'll email you the save-temps output off-thread.

Nico




More information about the cfe-commits mailing list