public inbox for [email protected]help / color / mirror / Atom feed
using libjansson in postgres extension 4+ messages / 3 participants [nested] [flat]
* using libjansson in postgres extension @ 2023-02-23 13:38 mahendrakar s <[email protected]> 0 siblings, 2 replies; 4+ messages in thread From: mahendrakar s @ 2023-02-23 13:38 UTC (permalink / raw) To: pgsql-novice <[email protected]> Hello Hackers, I'm developing an extension where in it indirectly references (libjansson) and libjansson has a symbol json_object <https://github.com/akheron/jansson/blob/master/src/load.c#:~:text=json_t%20*object%20%3D%20json_obje... conflicts with postgres symbol 'json_object <https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/json.c#:~:text=json_object(PG...; '. I see below: PostgreSQL: Documentation: 11: 38.10. C-Language Functions <https://www.postgresql.org/docs/11/xfunc-c.html#id-1.8.3.13.8; "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. Thanks, Mahendrakar. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: using libjansson in postgres extension @ 2023-02-24 01:59 mahendrakar s <[email protected]> parent: mahendrakar s <[email protected]> 1 sibling, 1 reply; 4+ messages in thread From: mahendrakar s @ 2023-02-24 01:59 UTC (permalink / raw) To: pgsql-novice <[email protected]>; [email protected] +andrew. Thoughts? On Thu, 23 Feb 2023 at 19:08, mahendrakar s <[email protected]> wrote: > Hello Hackers, > > I'm developing an extension where in it indirectly references (libjansson) > and libjansson has a symbol json_object > <https://github.com/akheron/jansson/blob/master/src/load.c#:~:text=json_t%20*object%20%3D%20json_obje... > conflicts with postgres symbol 'json_object > <https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/json.c#:~:text=json_object(PG...; > '. > > I see below: > PostgreSQL: Documentation: 11: 38.10. C-Language Functions > <https://www.postgresql.org/docs/11/xfunc-c.html#id-1.8.3.13.8; > "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. > > Thanks, > Mahendrakar. > > > ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: using libjansson in postgres extension @ 2023-02-24 07:30 Gurjeet Singh <[email protected]> parent: mahendrakar s <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: Gurjeet Singh @ 2023-02-24 07:30 UTC (permalink / raw) To: mahendrakar s <[email protected]>; +Cc: pgsql-novice <[email protected]> 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 ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: using libjansson in postgres extension @ 2023-02-25 15:54 Andrew Dunstan <[email protected]> parent: mahendrakar s <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Andrew Dunstan @ 2023-02-25 15:54 UTC (permalink / raw) To: mahendrakar s <[email protected]>; pgsql-novice <[email protected]> On 2023-02-23 Th 20:59, mahendrakar s wrote: > > On Thu, 23 Feb 2023 at 19:08, mahendrakar s > <[email protected]> wrote: > > Hello Hackers, > > I'm developing an extension where in it indirectly references > (libjansson) and libjansson has a symbol json_object > <https://github.com/akheron/jansson/blob/master/src/load.c#:~:text=json_t%20*object%20%3D%20json_obje... > conflicts with postgres symbol 'json_object > <https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/json.c#:~:text=json_object(PG...;. > > I see below: > PostgreSQL: Documentation: 11: 38.10. C-Language Functions > <https://www.postgresql.org/docs/11/xfunc-c.html#id-1.8.3.13.8; > "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. > > No. AFAICT you will have to create a fork of the library as the documentation suggests. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-02-25 15:54 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-02-23 13:38 using libjansson in postgres extension mahendrakar s <[email protected]> 2023-02-24 01:59 ` mahendrakar s <[email protected]> 2023-02-25 15:54 ` Andrew Dunstan <[email protected]> 2023-02-24 07:30 ` Gurjeet Singh <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox