GCC for SPARC Systems problems

I've got gccfss version 4.0.4 installed. The problem I am seeing is gccfss makes some symbols in a shared library to be local, so they can't be seen by other libraries that depend on those symbols, where a normal gcc makes those symbols global.

The library below was compiled with normal gcc:

[root@ultra10] nm /opt/pkg/lib/libiconv.so | grep locale

[963]|96608|992|FUNC |GLOB |0|11|locale_charset

This library was compiled with gccfss:

[root@ultra10] nm /opt/sandbox2/opt/pkg/lib/libiconv.so | grep locale_charset

[942]|958456|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC0

[943]|958464|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC1

[944]|958480|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC2

[945]|958496|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC3

[948]|958512|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC4

[949]|958520|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC5

[950]|958536|0|OBJT |GLOB |0|12|$XB_sgccXYjZGxOU.locale_charset..LLC6

[709]|140600|1068|FUNC |LOCL |2|11|locale_charset

My questions are: why gccfss makes some symbols local when they should be global? Is it overoptimising too much?

[1260 byte] By [segva] at [2007-11-27 6:36:13]
# 1

Answer: It seems to me it's doing what it was asked to do. :)

But first here are my assumptions:

. you build with -xipo=* flag (special name prefixes point to that)

. you use default libiconv makefiles that includes -fvisibility=hidden flag

GCCfss supports -fvisibility flag, whereas plain GCC on Solaris does not.

When you compile with plain gcc 4.0.4 you probably should see the warning like:

../../lib/../libcharset/lib/localcharset.c: In function 'locale_charset':

../../lib/../libcharset/lib/localcharset.c:467: warning: visibility attribute not supported in this configuration; ignored

but with GCCfss you don't see it and in assembler file you'll have:

".hidden locale_charset" statement.

By 'nm localcharset.o' you'll see that this function is still global, but when you

link it into shared library it becomes static, which is exactly what linker suppose to do

with hidden visibility.

Going further I'm not sure whether it's a problem for your builds, but you can either

fix libiconv makefiles to get rid of -fvisiblity flag or use system libiconv functionality which is the part of Solaris libc.so

Alex.

alexey_a at 2007-7-12 18:03:43 > top of Java-index,Open Source Technologies,OpenSPARC...
# 2
OK, thanks for explaining everything, it makes sense now
segva at 2007-7-12 18:03:43 > top of Java-index,Open Source Technologies,OpenSPARC...