This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20218] Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2006 10:47:25 -0000
- Subject: [Bug middle-end/20218] Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
- References: <bug-20218-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #24 from pluto at agmk dot net 2006-11-30 10:47 -------
currently i'm trying to build the kdelibs with gcc42-svn.
my qt and gcc are patched with:
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/gcc-pr20218.patch?rev=HEAD
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/qt-fvisibility.patch?rev=HEAD
it *worked* fine for gcc41 on x86-64, ix86 and ppc.
now it fails only for gcc42 on x86-64 (ix86 and ppc work).
[~/rpm/BUILD/kdelibs-3.5.5/kcmshell]$ make
/bin/sh ../libtool --silent --tag=CXX --mode=link "x86_64-pld-linux-g++"
-Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align
-Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2
-O2 -fno-strict-aliasing -fwrapv -march=x86-64 -gdwarf-2 -g2 -Wformat-security
-Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new
-fno-common -fvisibility=hidden -fvisibility-inlines-hidden
-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT
-DQT_NO_TRANSLATION -Wl,--as-needed -o libkdeinit_kcmshell.la -rpath
/usr/lib64 -no-undefined -avoid-version -L/usr/lib64 main.lo main_skel.lo
../kutils/libkutils.la
/usr/bin/ld: .libs/main_skel.o: relocation R_X86_64_PC32 against
`_ZTV9QMemArrayIcE' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
$ readelf -sW /usr/lib64/libqt-mt.so.3.3.7 | grep _ZTV9QMemArrayIcE
19100: 00000000009989c0 56 OBJECT WEAK DEFAULT 18 _ZTV9QMemArrayIcE
$ readelf -sW main_skel.o | grep _ZTV9QMemArrayIcE
54: 0000000000000000 56 OBJECT WEAK HIDDEN 45 _ZTV9QMemArrayIcE
$ readelf -r main_skel.o|grep _ZTV9QMemArrayIcE
000000000179 003600000002 R_X86_64_PC32 0000000000000000 _ZTV9QMemArrayIcE
+ c
000000000195 003600000002 R_X86_64_PC32 0000000000000000 _ZTV9QMemArrayIcE
+ c
000000000003 003600000002 R_X86_64_PC32 0000000000000000 _ZTV9QMemArrayIcE
+ c
000000000003 003600000002 R_X86_64_PC32 0000000000000000 _ZTV9QMemArrayIcE
+ c
Relocation section '.rela.data.rel.ro._ZTV9QMemArrayIcE' at offset 0x82010
contains 6 entries:
$ readelf -r /usr/lib64/libqt-mt.so.3.3.7| grep _ZTV9QMemArrayIcE
00000099ad68 4a9c00000001 R_X86_64_64 00000000009989c0 _ZTV9QMemArrayIcE
+ 10
0000009e30d0 4a9c00000006 R_X86_64_GLOB_DAT 00000000009989c0 _ZTV9QMemArrayIcE
+ 0
any ideas?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218