Re: [AD] About sonames

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Am 12.04.2012 10:27, schrieb Peter Wang:
> On Thu, 12 Apr 2012 09:42:06 +0200, Tobias Hansen <tobias.han@xxxxxxxxxx> wrote:
>> Am 12.04.2012 01:03, schrieb Peter Wang:
>>> On Wed, 11 Apr 2012 23:02:29 +0200, Tobias Hansen <tobias.han@xxxxxxxxxx>
>> wrote:
>>>> Do you assign your
>>>> version numbers with this in mind, so that using them as sonames is
>>>> feasible? Do you always keep the libraries binary compatible when
>>>> changing the third part of the version? Does binary compatibility
>>>> usually break when you change the second part of the version?
>>>
>>> Yes, yes and yes.
>>>
>>
>> Ok, in that case, we could go a step further and track newly added
>> symbols between versions of the same soname. (So games compiled with
>> 5.0.6 but using no newly introduced symbols will work with 5.0.5.)
>>
>> The problem here is that both Allegro 4.4 and 5 seem to export private
>> symbols. For example, liballegro-dialog exports these symbols:
>>
>>  _al_append_native_text_log@xxxxxxxxxx 5.0.6
>>  _al_close_native_text_log@xxxxxxxxxx 5.0.6
>>  _al_open_native_text_log@xxxxxxxxxx 5.0.6
>>  _al_show_native_file_dialog@xxxxxxxxxx 5.0.6
>>  _al_show_native_message_box@xxxxxxxxxx 5.0.6
>>  al_append_native_text_log@xxxxxxxxxx 5.0.6
>>  al_close_native_text_log@xxxxxxxxxx 5.0.6
>>  al_create_native_file_dialog@xxxxxxxxxx 5.0.6
>>  al_destroy_native_file_dialog@xxxxxxxxxx 5.0.6
>>  al_get_allegro_native_dialog_version@xxxxxxxxxx 5.0.6
>>  al_get_native_file_dialog_count@xxxxxxxxxx 5.0.6
>>  al_get_native_file_dialog_path@xxxxxxxxxx 5.0.6
>>  al_get_native_text_log_event_source@xxxxxxxxxx 5.0.6
>>  al_open_native_text_log@xxxxxxxxxx 5.0.6
>>  al_show_native_file_dialog@xxxxxxxxxx 5.0.6
>>  al_show_native_message_box@xxxxxxxxxx 5.0.6
>>
>> The ones starting with an underscore are private, right? Are they
>> exported for a reason?
> 
> Ignorance and laziness, mostly.  Addons are allowed to use private
> symbols from the main library, so not everything can be hidden.
> 
>> Could you remove them?
> 
> If it's easy to do *and* maintain, we can try it on the 5.1 branch.
> I think it's probably too risky for the 5.0 branch.
> 
> Users are not supposed to use any private symbols so you can just
> disregard them, no?
> 

Yes, that should be possible. Now that you have confirmed that really
everything with an underscore is private and not used by anything except
Allegro itself (also for Allegro 4.4?), we can disregard it based on the
underscore. I don't know if there's something specifically for marking
symbols that are only supposed to be used by addons and the like, but
one possibility would be using version scripts, hiding everything that
is not used by addons and assigning the remaining private symbols to a
special version like LIBALLEGRO_INTERNAL.

Here is an example of a version script (that is used in the normal way
and exports no private symbols):
http://repo.or.cz/w/alure.git/commitdiff/c35000a765591373222c313941212685b64b9ed2

There's a good text about these things in chapter 2.2 of
http://www.akkadia.org/drepper/dsohowto.pdf

Best regards,
Tobias




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/