Re: [ODBC] Is the linking with -lodbc necessary? (--with-odbc)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [ODBC] Is the linking with -lodbc necessary? (--with-odbc)

Pavel Raiskup
[+cc back psqlodbc]
[+cc unixODBC]

On Tuesday, November 12, 2013 11:46:39 Nick Gorham wrote:

> On 11/11/13 17:50, Pavel Raiskup wrote:
> > Hello all!
> >
> > Long story short: Is there a need to link psqlodbcw.so plugin against
> > libodbc.so?  Principal problem: That library provides ABI for applications
> > - not for plugins; at least it seem to be like that.
> >
> > I tried to remove this linking by following tweak:
>
> Hi,
>
> As you have noticed, there is code in the DM to try and avoid what you
> describe. But AFAIK, a driver would normally link against -lodbcinst to
> gain access to the ini functions SQLGetPrivateProfileString and so on,
> no need to link to the driver manager (-lodbc) that is for application
> land use.
Hello Nick, thanks for looking at the problem from unixODBC perspective!

Would not there be better rather block loading badly linked plugins rather
than just try to expect that the linking is done the same way on all arches?
I attached possible solution.

Pavel

_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev

0001-DM-Don-t-load-plugins-linked-back-against-libodbc.so.patch (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ODBC] Is the linking with -lodbc necessary? (--with-odbc)

Pavel Raiskup
> I attached possible solution.

I removed too much code in the previous patch.  Attached once again.

_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev

0001-DM-Don-t-load-plugins-linked-back-against-libodbc.so.patch (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ODBC] Is the linking with -lodbc necessary? (--with-odbc)

Nick Gorham-2
In reply to this post by Pavel Raiskup
On 13/11/13 10:41, Pavel Raiskup wrote:

> [+cc back psqlodbc]
> [+cc unixODBC]
>
> On Tuesday, November 12, 2013 11:46:39 Nick Gorham wrote:
>> On 11/11/13 17:50, Pavel Raiskup wrote:
>>> Hello all!
>>>
>>> Long story short: Is there a need to link psqlodbcw.so plugin against
>>> libodbc.so?  Principal problem: That library provides ABI for applications
>>> - not for plugins; at least it seem to be like that.
>>>
>>> I tried to remove this linking by following tweak:
>> Hi,
>>
>> As you have noticed, there is code in the DM to try and avoid what you
>> describe. But AFAIK, a driver would normally link against -lodbcinst to
>> gain access to the ini functions SQLGetPrivateProfileString and so on,
>> no need to link to the driver manager (-lodbc) that is for application
>> land use.
> Hello Nick, thanks for looking at the problem from unixODBC perspective!
>
> Would not there be better rather block loading badly linked plugins rather
> than just try to expect that the linking is done the same way on all arches?
> I attached possible solution.
>
> Pavel
Yes, I see your solution. Possible though that the driver is linked
against libiodbc.so or other non unixODBC version of ODBC driver manager
and so has entry point for SQLAllocStmt (for example) that is not in the
driver (as in this case).

There are also situations I have seen where a driver decides to call
itself (say SQLAllocStmt() in the driver makes a call to
SQLAllocHandle() expecting the driver version) but finds the driver
manager entry point.

Anyway you have the good solution for your driver in linking against
libodbcinst

--
Nick Gorham
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev