libupnp contains a function called "uuid_unpack" in the file uuid.h/.c
The library called "libuuid" has a function of the same name:
https://sourceforge.net/p/libuuid/code/ci/master/tree/unpack.c
When both are statically linked in a project, there is a naming conflict between the two functions.
Is it possible prepend this (and possibly the other) function with something like "libupnp_" to avoid this symbol conflict?
Here is a patch to fix the issue.
uuid_ methods are renamed to uuid_upnp_
This makes sense as the structure was already named uuid_upnp.
I would prefer to see the names become upnp_uuid_ rather than uuid_upnp. Most other functions and variables take this pattern.
There are at least two dependent packages which reference these uuid_ functions, djmount and gmediaserver. So speaking with my Debian packaging hat on we would have to schedule this change to a major version bump.
Nick,
Do you want me to commit this patch with your suggested name change? I have no problems with calling this new release 1.8 or maybe 1.10, since there has been some confusion about 1.8 beeing the master branch.
Regards,
Marcelo.
Patch follows
Hi Marcelo, the patch looks fine. We could possibly use 'weak' pragmas to alias the old names but in a way that other libraries can override. This would let us keep 1.6.x ABI compatibility. I'll have a try once I've got some Debian updates done.
I've done a test and I think this may be a non-problem. I have a simple
program which statically links both libuuid.a and libupnp.a and there is
no conflict of symbols between them. The uuid_unpack symbol is internal
to both libraries, neither of them has it in their public header files,
and neither of them exports it.
Please can the OP give more details of their build environment -
Makefiles etc - so that I can understand how the problem is arising and
try to reproduce it ? It may be there is a better solution than blindly
renaming private routines.
In the meantime I'd suggest we defer this patch and the API/ABI change.
Nick
Hi, I retested and I still have the issue without the patch:
We're having this issue in the Ring project: https://ring.cx/
We use a contrib system (taken from VLC) to build dependencies from source if they don't exist on the target system and link them statically. This happens when both upnp and uuid are built and linked this way... I will try to reproduce with a simple example when I have time, but you can take a look at our build files by cloning the repo here:
git clone https://gerrit-ring.savoirfairelinux.com/ring-daemon
build instructions:
https://projects.savoirfairelinux.com/projects/ring-daemon/wiki/BuildLinux
thanks,
-stepan
Hi Stepan,
Thanks for the very clear build instructions. I've run through a build on Debian Sid and I don't get the error you do. In that environment, libuuid does contain the uuid_unpack symbol but libupnp still does not export it.
Could you attach the output of the following please so I could compare with mine ?
$ nm contrib/*/lib/libupnp.a
Also, what platform are you getting the error on ?
Thanks
Nick
Also if I could make a contribution, in your contrib/ build, depending on locally installed TLS cert availability, wget may fail on https URLs. Could I suggest the attached patch for ring-daemon ? This option is available since wget 1.10 which introduced the stricter TLS checks that fail on Debian, so the option should work on most current distros.
Hi Nick,
Thanks for the patch, I've submitted it to our code review system:
https://gerrit-ring.savoirfairelinux.com/#/c/3498/ ...though wouldn't the
more safe solution be to install the needed root certs?
I've attached what you asked for. The platform is ubuntu 15.04 x86_64.
-stepan
On Fri, Jan 22, 2016 at 9:45 PM, Nick Leverton leveret@users.sf.net wrote:
Related
Bugs:
#125