On Jul 27, 2005, at 6:07 AM, Andreas Grosam wrote:
Please note:
if functions are defined in a dynamic library and if these functions can/will be called from outside this DSO, you *must* explicitly use the visibility attribute to ensure their *symbols* will be exported - means, are accessible from outside the DSO in which they are defined.
In this case, the compiler assumes a reference from outside and will create a non-inlined function, which is accessable from outside the DSO.
Except for using the "visibility attribute" only works with GCC 4.0 and not with GCC 3.3, correct? Isn't GCC 3.3 supposed to export everything? Though if the optimization settings are causing functions to get inlined then I suppose I'd have to use an exported symbols file to ensure that those functions will be exported.
A side note:
Well, interestingly, many problems apparently stem from the new "symbol visbility" feature. This is a new concept in apple gcc-4 - and it actually adds a new dimension of complexity.
In general, this is a great feature! It reduces code, and makes it faster - and also requires almost no effort from the programmer.
But we need to learn it and use it correctly. Basically, it's pretty easy.
I'd really love to be able to use GCC 4.0, I really would. But we're going to have to support Mac OS X 10.2 for many years to come (at least 3-5 years) so GCC 4.0 is not an option. Unless of course Apple makes it so that binaries built with GCC 4.0 will work on 10.2 (either through a software update to 10.2 or by changing GCC 4.0), but that doesn't seem very likely at this point.