public inbox for [email protected]
help / color / mirror / Atom feedFrom: Gurjeet Singh <[email protected]>
To: mahendrakar s <[email protected]>
Cc: pgsql-novice <[email protected]>
Subject: Re: using libjansson in postgres extension
Date: Thu, 23 Feb 2023 23:30:40 -0800
Message-ID: <CABwTF4U7ZYdnt8SvrvCEgR+92sAsqQj+pwSNX_L3b5wUZWFvnw@mail.gmail.com> (raw)
In-Reply-To: <CABkiuWpifg0tA_odWOXMXcJEQ8ghk3n+amEFB_0Dg33fEmR6TA@mail.gmail.com>
References: <CABkiuWpifg0tA_odWOXMXcJEQ8ghk3n+amEFB_0Dg33fEmR6TA@mail.gmail.com>
On Thu, Feb 23, 2023 at 5:39 AM mahendrakar s
<[email protected]> wrote:
> I'm developing an extension where in it indirectly references (libjansson) and libjansson has a symbol json_object which conflicts with postgres symbol 'json_object'.
>
> I see below:
> PostgreSQL: Documentation: 11: 38.10. C-Language Functions
> "Symbol names defined within object files must not conflict with each other or with symbols defined in the PostgreSQL server executable. You will have to rename your functions or variables if you get error messages to this effect."
>
> But this requires to maintain libjansson with customizations(have a different symbol) to meet the needs.
>
> Do you have any suggestions to use the libjansson 'as it is' without using the different symbol.
I don't think that'll be possible. The docs are pretty clear, and I'm
afraid any proposal to change Postgres function's name will not be
welcome.
Perhaps you can perform surgery on your library _after_ linking, to
remove any exports of the symbol json_object. See [1] for some ideas.
This will allow you to keep using libjansson code without
modifications, but it will require some post-build complexity, with
platform-specific solutions.
[1]: https://stackoverflow.com/questions/9648655/how-to-hide-the-exported-symbols-name-within-a-shared-li...
Best regards,
Gurjeet
http://Gurje.et
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: using libjansson in postgres extension
In-Reply-To: <CABwTF4U7ZYdnt8SvrvCEgR+92sAsqQj+pwSNX_L3b5wUZWFvnw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox