varnamproject / govarnam

Easily type Indic languages on computer and mobile. GoVarnam is a cross-platform transliteration library. Manglish -> Malayalam, Thanglish -> Tamil, Hinglish -> Hindi plus another 10 languages. GoVarnam is a near-Go port of libvarnam
https://varnamproject.com
Other
145 stars 11 forks source link

Limit exported symbols #35

Closed agx closed 1 year ago

agx commented 1 year ago

This greatly reduces the number of exported symbols by limiting the namespace of exported symbols to {varnam,varray,vm}_ thus avoiding the export of all the _cg symbols from go.

Before:

    $ readelf -s /usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
    248

After:

    $ readelf -s /usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
    52

With this we can make sure applications don't link against accidentally exported symbols and break on library upgrades without us being able to notice. It also allows us to notice when symbols go missing and we hence need to bump the ABI version.

I've put this on top of #34

This also allows us to use symbol versioning for new symbols if desired.

agx commented 1 year ago

Thanks for merging this in so quickly!