[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

Paolo Carlini  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE

--- Comment #9 from Paolo Carlini  2011-09-22 
14:42:38 UTC ---
Duplicate.

*** This bug has been marked as a duplicate of bug 36022 ***


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #8 from Jonathan Wakely  2011-09-22 
13:45:10 UTC ---
I think before the default visibility was added everywhere it was pretty easy
to cause segfaults by using -fvisibility=hidden


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #7 from Paolo Carlini  2011-09-22 
13:23:41 UTC ---
Seems so, thanks Jon. The older one also includes some rationale from Benjamin.


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #6 from Jonathan Wakely  2011-09-22 
12:26:56 UTC ---
dup of PR 36022 ?


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread vincenzo.innocente at cern dot ch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #5 from vincenzo Innocente  
2011-09-22 11:49:29 UTC ---
indeed
and in "exception" header-file is a place where visibility is correctly handled
#pragma GCC visibility push(default)
extern "C++" {

namespace std
{
}
#pragma GCC visibility pop


I would have preferred specific __attribute((visibility( "default" )))
on each exception class though (push and pop and error-prone)


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #4 from Pawel Sikora  2011-09-22 11:23:14 
UTC ---
(In reply to comment #3)

> I think that, unless not imposed by the standard (why??) the visibility of
> "namespace std" SHALL NOT BE forced to default

part of the std:: (exceptions typeinfo symbols) must be visible-by-default
for proper throw-catch/dynamic_cast working across shared libs boundaries.


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-22 Thread vincenzo.innocente at cern dot ch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

vincenzo Innocente  changed:

   What|Removed |Added

 CC||vincenzo.innocente at cern
   ||dot ch

--- Comment #3 from vincenzo Innocente  
2011-09-22 11:05:21 UTC ---
I did a small test removing the visibily just in stl_vector.h
grep namespace
/afs/cern.ch/user/i/innocent/w2/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_vector.h
namespace std /* _GLIBCXX_VISIBILITY(default) */
and got
++ -fvisibility=hidden -fvisibility-inlines-hidden -fPIC bha.cc -Wall -shared
-o libx.so 
[vinavx0] ~/public/ctest $ readelf -sW libx.so | grep -v UND | sed 's/.local/
.local/g' | c++filt

Symbol table '.dynsym' contains 14 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 2: 0540 0 FUNCGLOBAL DEFAULT9 _init
 3: 0758 0 FUNCGLOBAL DEFAULT   12 _fini
 6: 066c30 FUNCGLOBAL DEFAULT   11 bar()
 7: 06fc26 FUNCWEAK   DEFAULT   11
std::allocator::allocator()
 8: 06fc26 FUNCWEAK   DEFAULT   11
std::allocator::allocator()
 9: 071610 FUNCWEAK   DEFAULT   11
__gnu_cxx::new_allocator::new_allocator()
10: 071610 FUNCWEAK   DEFAULT   11
__gnu_cxx::new_allocator::new_allocator()
11: 1ae8 0 NOTYPE  GLOBAL DEFAULT  ABS _edata
12: 1ae8 0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
13: 1af8 0 NOTYPE  GLOBAL DEFAULT  ABS _end

Symbol table '.symtab' contains 39 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 1: 05a0 0 FUNCLOCAL  DEFAULT   11 call_gmon_start
 2:  0 FILELOCAL  DEFAULT  ABS crtstuff.c
 3: 1ac0 0 OBJECT  LOCAL  DEFAULT   19 __CTOR_LIST__
 4: 1ad0 0 OBJECT  LOCAL  DEFAULT   20 __DTOR_LIST__
 5: 1ae0 0 OBJECT  LOCAL  DEFAULT   21 __JCR_LIST__
 6: 05c0 0 FUNCLOCAL  DEFAULT   11
__do_global_dtors_aux
 7: 1ae8 1 OBJECT  LOCAL  DEFAULT   22 completed.5901
 8: 1af0 8 OBJECT  LOCAL  DEFAULT   22 dtor_idx.5903
 9: 0640 0 FUNCLOCAL  DEFAULT   11 frame_dummy
10:  0 FILELOCAL  DEFAULT  ABS bha.cc
11:  0 FILELOCAL  DEFAULT  ABS crtstuff.c
12: 1ac8 0 OBJECT  LOCAL  DEFAULT   19 __CTOR_END__
13: 0840 0 OBJECT  LOCAL  DEFAULT   13 __FRAME_END__
14: 1ae0 0 OBJECT  LOCAL  DEFAULT   21 __JCR_END__
15: 0720 0 FUNCLOCAL  DEFAULT   11
__do_global_ctors_aux
16: 1ab8 0 OBJECT  LOCAL  HIDDEN18 __dso_handle
17: 068a26 FUNCLOCAL  HIDDEN11 std::vector >::vector()
18: 068a26 FUNCLOCAL  HIDDEN11 std::vector >::vector()
19: 06a426 FUNCLOCAL  HIDDEN11 std::_Vector_base >::_Vector_base()
20: 06a426 FUNCLOCAL  HIDDEN11 std::_Vector_base >::_Vector_base()
21: 06be61 FUNCLOCAL  HIDDEN11 std::_Vector_base >::_Vector_impl::_Vector_impl()
22: 06be61 FUNCLOCAL  HIDDEN11 std::_Vector_base >::_Vector_impl::_Vector_impl()
23: 1ad8 0 OBJECT  LOCAL  HIDDEN20 __DTOR_END__
24: 1880   496 OBJECT  LOCAL  HIDDEN15 _DYNAMIC
25: 1a8848 OBJECT  LOCAL  HIDDEN17
_GLOBAL_OFFSET_TABLE_
27: 0540 0 FUNCGLOBAL DEFAULT9 _init
28: 0758 0 FUNCGLOBAL DEFAULT   12 _fini
31: 066c30 FUNCGLOBAL DEFAULT   11 bar()
32: 06fc26 FUNCWEAK   DEFAULT   11
std::allocator::allocator()
33: 06fc26 FUNCWEAK   DEFAULT   11
std::allocator::allocator()
34: 071610 FUNCWEAK   DEFAULT   11
__gnu_cxx::new_allocator::new_allocator()
35: 071610 FUNCWEAK   DEFAULT   11
__gnu_cxx::new_allocator::new_allocator()
36: 1ae8 0 NOTYPE  GLOBAL DEFAULT  ABS _edata
37: 1ae8 0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
38: 1af8 0 NOTYPE  GLOBAL DEFAULT  ABS _end

if I add -flto visibility of the "local symbols is turned again to DEFAULT, not
sure if relevant though
g++ -fvisibility=hidden -fvisibility-inlines-hidden -fPIC bha.cc -Wall -shared
-o libx.so -flto
[vinavx0] ~/public/ctest $ readelf -sW libx.so | grep -v UND | sed 's/.local/
.local/g' | c++filt

Symbol table '.dynsym' contains 10 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 2: 000

[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

--- Comment #2 from Paolo Carlini  2011-09-22 
00:29:43 UTC ---
Jason, could you please help me triaging this PR? Should the library do
something else here? Thanks!


[Bug libstdc++/50348] -fvisibility=hidden doesn't hide stl implementation details.

2011-09-11 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348

Paolo Carlini  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #1 from Paolo Carlini  2011-09-11 
15:18:14 UTC ---
I'm not an expert here, but I have an hard time believing this is a library
issue. I can see that we have been doing, for a lot of time:

  namespace std _GLIBCXX_VISIBILITY(default)
  {

Is this wrong?!? Jason?