Page MenuHomeFreeBSD

Add `__' prefix to the ABI of libmd

Authored by ume on Jan 16 2015, 5:32 AM.




Add `__' prefix to the ABI of libmd to avoid name conflicts with libcrypto.

( Related to D2216: Avoid symbol clashes between libmd and libcrypto )

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

kuriyama retitled this revision from to Change OpenSSL derived digest functions to return boolean values.
kuriyama updated this object.
kuriyama edited the test plan for this revision. (Show Details)
kuriyama updated this object.

I don't think it is a good idea.

There is too much code out there written under assumption that those functions can't fail and original interface emphasizes the intent. *_Init is a little bit trickier because it requires parameter validation, etc. But in our case it still never fails.

I think changing API is not good idea. How about the attached patch? It changes function names to avoid conflicts with libcrypto.

"__" prefix is reserved and should not be used in the library. If you want to rename the symbols, let's simply rename them, as well as all API consumers.

Have you considered adding symbol versioning to libmd? I think it should resolve original install issue -- I assume it to be two shared libraries providing the same symbol.

BTW there should be a way to update patch in review, instead of posting link to a file.

The use of `__' is intentional, here. It seems you are confusing ABI
with API. Though it changes the ABI of libmd, as far as the
applications include the corresponding header file, it doesn't change
the API.
Use of symbol versioning is overkill for this purpose, IMHO.

ume added a reviewer: kuriyama.
ume retitled this revision from Change OpenSSL derived digest functions to return boolean values to Add `__' prefix to the API of libmd.
ume updated this object.
ume updated this object.
ume retitled this revision from Add `__' prefix to the API of libmd to Add `__' prefix to the ABI of libmd.Feb 3 2015, 5:25 PM

You would need to bump shlib major.
"__" is reserved I will be against this patchset as long as it stays there.
What is intent of providing weak_reference?
I don't see how listing those symbols in single file in order to enable symbol versioning can be more complicated than current approach.

No, we don't need to bump shlib major until removing weak_reference.
The weak_reference is for keeping ABI backward compatibility.

FWIW, I tested ume's patch on my environment, and it works fine.

Gleb, still you against this patch?

'__' is reserved for implementation (by POSIX.1-2008), so I think this is correct usage. We already use a lot of these prefix symbols in our libraries.

kuriyama edited edge metadata.