Skip to Content.
Sympa Menu

freetds - RE: [freetds] [PATCH] make replacements more configurable

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Craig A. Berry" <craigberry AT mac.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: RE: [freetds] [PATCH] make replacements more configurable
  • Date: Mon, 27 Jan 2003 22:06:09 -0600

At 9:32 AM -0500 1/27/03, Castellano, Nicholas wrote:
>This patch is wrong. The whole idea of the autoconf AC_REPLACE_FUNCS() is
>to make this sort of kludgery unnecessary. UNIX shared libraries have
>versioning information to make this sort of brain damage unnecessary.

Hmm. I'll try to respond to what little actual content there is here
in between the name calling. I suggested a simple solution that
presupposes nothing except the way macros work in C. You say it's
wrong because some platform-specific configuration tool hides the
functions from the compiler when they're not needed. I'm sure that
solution works fine in some contexts, but it is neither general nor
portable. If you do have a better solution that is both general and
portable I'd really like to hear about it.

>In other words, you shouldn't be compile-time linking against one version of
>the C library, and run-time linking against an incompatible version.

That's not at all what I said. It is the FreeTDS libraries (if they
intrude on the namespace of the standard C library by including
symbols identical to standard function names) that introduce the
incompatibility. James understands it somewhat better so I will take
this up further in responding to his post.

>Attempting to do so will only get you into trouble, as you have already
>discovered.

I haven't noticed any trouble at all. Things work just fine after my
patch -- not at all before it.

>Hiding the problem by tricking the system into making this work
>is only going to get you into worse trouble later on.

That's excellent general advice. If only I could think of some way
it applied to the current situation.

>
>Cheers,
>--nick
>
>-----Original Message-----
>From: freetds-admin AT lists.ibiblio.org
>[mailto:freetds-admin AT lists.ibiblio.org]
>Sent: Sunday, January 26, 2003 7:25 PM
>To: freetds AT lists.ibiblio.org
>Subject: [freetds] [PATCH] make replacements more configurable
>
>
>In porting FreeTDS to VMS (which is nearly finished) I hit a small snag
>using the strtok_r function supplied in src/replacements/strtok_r.c. The
>latest version of the C run-time has its own strtok_r, but the second
>latest doesn't. If I build FreeTDS with the older version, then upgrade
>the C run-time, then link against the TDS libraries, I'll get a multiply
>defined symbol error because the home-made strtok_r collides with the
>system-supplied one. Similar problems are latent for the other
>replacement functions.
>
>The easiest around this was to prefix all the function names with
>"freetds_" and then locate them when and where needed via the HAVE_xxx
>macros. Patch below. Does anyone have any objections or see any
>potential problems with this?

--
________________________________________
Craig A. Berry
mailto:craigberry AT mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser




Archive powered by MHonArc 2.6.24.

Top of Page