Discussion:
[freetds] freeTDS configure works but make doesn't
Vann, David
2013-05-09 13:13:40 UTC
Permalink
Any help would be appreciated.

I'm trying to run freeTDS on AIX 5.3 64bit. I've tried versions 0.91 and 0.92.79. I using unixODBC driver manager version 2.3.1. It has compiled cleanly and is running. It was compiled in 64 bit mode. The ultimate result is to run with Oracle 11gR2 which is also 64 bit.

. The configure seems to work fine, but the make fails.

Export OBJECT_MODE=64
Export CFLAGS=-maix64
./configure --prefix=/usr/local --with-unixodbc=/usr/local --with-tdsver=8.0 --enable-msdblib 2>&1 | tee configure.log
-- This looks good, but when I run make I get errors.

You can see I enabled MSDBLIB however during the make it fails and it looks like it still wants to compile Sybase. It's all on fisql.c and I found the objects(.dbcoltype;.dbcollen;.dbcolname;etc) it's referenced in sybdb.h. I'm not sure why it's compiling Sybase nor do I understand why it can't find the objects referenced when they're in the TDS source directory. I've tried setting the srcdir and that didn't help.

Below is a snapshot of the make that fails.
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE -maix64 -W
declaration-after-statement -o .libs/fisql fisql.o terminal.o edit.o handlers.o
interrupt.o -L/usr/local/lib -L../../dblib/.libs -lsybdb ../../replacements/.li
bs/libreplacements.a -liconv -lcurses -lreadline -lpthreads -Wl,-blibpath:/usr/l
ocal/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .dbcoltype
ld: 0711-317 ERROR: Undefined symbol: .dbcollen
ld: 0711-317 ERROR: Undefined symbol: .dbcolname
ld: 0711-317 ERROR: Undefined symbol: .dbdead
ld: 0711-317 ERROR: Undefined symbol: .dbinit
ld: 0711-317 ERROR: Undefined symbol: .dblogin
ld: 0711-317 ERROR: Undefined symbol: .dbmsghandle
ld: 0711-317 ERROR: Undefined symbol: .dberrhandle
ld: 0711-317 ERROR: Undefined symbol: .dbsetlname
ld: 0711-317 ERROR: Undefined symbol: .dbsetlbool
ld: 0711-317 ERROR: Undefined symbol: .dbsetllong
ld: 0711-317 ERROR: Undefined symbol: .dbsetifile
ld: 0711-317 ERROR: Undefined symbol: .dbsettime
ld: 0711-317 ERROR: Undefined symbol: .dbsetlogintime
ld: 0711-317 ERROR: Undefined symbol: .tdsdbopen
ld: 0711-317 ERROR: Undefined symbol: .dbsetopt
ld: 0711-317 ERROR: Undefined symbol: .dbuse
ld: 0711-317 ERROR: Undefined symbol: .dbcancel
ld: 0711-317 ERROR: Undefined symbol: .dbexit

Information Services
220 Campus Blvd, Suite 320
Winchester, VA 22601
W:540 536-3213
C:540 532-8309
F:540 536-8989
dvann2 at valleyhealthlink.com<mailto:dvann2 at valleyhealthlink.com>
Eduard Heimann
2013-05-09 19:34:56 UTC
Permalink
Post by Vann, David
Any help would be appreciated.
I'm trying to run freeTDS on AIX 5.3 64bit. I've tried versions 0.91 and
0.92.79. I using unixODBC driver manager version 2.3.1. It has compiled
cleanly and is running. It was compiled in 64 bit mode. The ultimate
result is to run with Oracle 11gR2 which is also 64 bit.
...
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o terminal.o
edit.o handlers.o interrupt.o -L/usr/local/lib -L../../dblib/.libs -lsybdb
../../replacements/.li bs/libreplacements.a -liconv -lcurses -lreadline
.dbcollen ld: 0711-317 ERROR: Undefined symbol: .dbcolname ld: 0711-317
.dberrhandle ld: 0711-317 ERROR: Undefined symbol: .dbsetlname ld: 0711-317
.dbsetllong ld: 0711-317 ERROR: Undefined symbol: .dbsetifile ld: 0711-317
0711-317 ERROR: Undefined symbol: .dbsetopt ld: 0711-317 ERROR: Undefined
symbol: .dbuse ld: 0711-317 ERROR: Undefined symbol: .dbcancel ld: 0711-317
ERROR: Undefined symbol: .dbexit
My AIX-Experience 15 Years ago (sorry)... my hint is:

try to swap the link order "-lsybdb
../../replacements/.libs/libreplacements.a" to
"../../replacements/.libs/libreplacements.a -lsybdb". At least in AIX4, the
linker was a quite simple minded one pass library extractor. (No dependencies
graph resolver)

Hope this will cure your linker probs!
Vann, David
2013-05-11 11:45:10 UTC
Permalink
I can't get that to work.

I tried running configure with --disable-shared and now make and make install work, but that's not going to work for what I'm trying to do. At least I don't think it will. I'm trying to query MS SQL from an Oracle DB and I can't do that w/o the shared object.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Eduard Heimann
Sent: Thursday, May 09, 2013 3:35 PM
To: freetds at lists.ibiblio.org
Subject: Re: [freetds] freeTDS configure works but make doesn't

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Vann, David
Any help would be appreciated.
I'm trying to run freeTDS on AIX 5.3 64bit. I've tried versions 0.91
and 0.92.79. I using unixODBC driver manager version 2.3.1. It has
compiled cleanly and is running. It was compiled in 64 bit mode. The
ultimate result is to run with Oracle 11gR2 which is also 64 bit.
...
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o
terminal.o edit.o handlers.o interrupt.o -L/usr/local/lib
-L../../dblib/.libs -lsybdb ../../replacements/.li
0711-317
.dberrhandle ld: 0711-317 ERROR: Undefined symbol: .dbsetlname ld: 0711-317
.dbsetllong ld: 0711-317 ERROR: Undefined symbol: .dbsetifile ld: 0711-317
0711-317 ERROR: Undefined symbol: .dbsetopt ld: 0711-317 ERROR: Undefined
symbol: .dbuse ld: 0711-317 ERROR: Undefined symbol: .dbcancel ld: 0711-317
ERROR: Undefined symbol: .dbexit
My AIX-Experience 15 Years ago (sorry)... my hint is:

try to swap the link order "-lsybdb
../../replacements/.libs/libreplacements.a" to "../../replacements/.libs/libreplacements.a -lsybdb". At least in AIX4, the linker was a quite simple minded one pass library extractor. (No dependencies graph resolver)

Hope this will cure your linker probs!
Vann, David
2013-05-11 12:07:25 UTC
Permalink
Are there any CC or CFLAGS or LD_LIBRARY_PATH or LIBPATH for aix that need to be set during the configure. Or are there any LDFLAGS that would fix the compile since the make is failing? I've tried everything I can think of.

-----Original Message-----
From: Vann, David
Sent: Saturday, May 11, 2013 7:45 AM
To: 'FreeTDS Development Group'
Subject: RE: [freetds] freeTDS configure works but make doesn't

I can't get that to work.

I tried running configure with --disable-shared and now make and make install work, but that's not going to work for what I'm trying to do. At least I don't think it will. I'm trying to query MS SQL from an Oracle DB and I can't do that w/o the shared object.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Eduard Heimann
Sent: Thursday, May 09, 2013 3:35 PM
To: freetds at lists.ibiblio.org
Subject: Re: [freetds] freeTDS configure works but make doesn't

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Vann, David
Any help would be appreciated.
I'm trying to run freeTDS on AIX 5.3 64bit. I've tried versions 0.91
and 0.92.79. I using unixODBC driver manager version 2.3.1. It has
compiled cleanly and is running. It was compiled in 64 bit mode. The
ultimate result is to run with Oracle 11gR2 which is also 64 bit.
...
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o
terminal.o edit.o handlers.o interrupt.o -L/usr/local/lib
-L../../dblib/.libs -lsybdb ../../replacements/.li
0711-317
.dberrhandle ld: 0711-317 ERROR: Undefined symbol: .dbsetlname ld: 0711-317
.dbsetllong ld: 0711-317 ERROR: Undefined symbol: .dbsetifile ld: 0711-317
0711-317 ERROR: Undefined symbol: .dbsetopt ld: 0711-317 ERROR: Undefined
symbol: .dbuse ld: 0711-317 ERROR: Undefined symbol: .dbcancel ld: 0711-317
ERROR: Undefined symbol: .dbexit
My AIX-Experience 15 Years ago (sorry)... my hint is:

try to swap the link order "-lsybdb
../../replacements/.libs/libreplacements.a" to "../../replacements/.libs/libreplacements.a -lsybdb". At least in AIX4, the linker was a quite simple minded one pass library extractor. (No dependencies graph resolver)

Hope this will cure your linker probs!
Vann, David
2013-05-11 12:10:27 UTC
Permalink
One other note. If I run as 32 bit it will compile, but I need 64 bit for Oracle to communicate properly.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Vann, David
Sent: Saturday, May 11, 2013 8:07 AM
To: FreeTDS Development Group
Subject: Re: [freetds] freeTDS configure works but make doesn't

Are there any CC or CFLAGS or LD_LIBRARY_PATH or LIBPATH for aix that need to be set during the configure. Or are there any LDFLAGS that would fix the compile since the make is failing? I've tried everything I can think of.

-----Original Message-----
From: Vann, David
Sent: Saturday, May 11, 2013 7:45 AM
To: 'FreeTDS Development Group'
Subject: RE: [freetds] freeTDS configure works but make doesn't

I can't get that to work.

I tried running configure with --disable-shared and now make and make install work, but that's not going to work for what I'm trying to do. At least I don't think it will. I'm trying to query MS SQL from an Oracle DB and I can't do that w/o the shared object.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Eduard Heimann
Sent: Thursday, May 09, 2013 3:35 PM
To: freetds at lists.ibiblio.org
Subject: Re: [freetds] freeTDS configure works but make doesn't

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Vann, David
Any help would be appreciated.
I'm trying to run freeTDS on AIX 5.3 64bit. I've tried versions 0.91
and 0.92.79. I using unixODBC driver manager version 2.3.1. It has
compiled cleanly and is running. It was compiled in 64 bit mode. The
ultimate result is to run with Oracle 11gR2 which is also 64 bit.
...
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o
terminal.o edit.o handlers.o interrupt.o -L/usr/local/lib
-L../../dblib/.libs -lsybdb ../../replacements/.li
0711-317
.dberrhandle ld: 0711-317 ERROR: Undefined symbol: .dbsetlname ld: 0711-317
.dbsetllong ld: 0711-317 ERROR: Undefined symbol: .dbsetifile ld: 0711-317
0711-317 ERROR: Undefined symbol: .dbsetopt ld: 0711-317 ERROR: Undefined
symbol: .dbuse ld: 0711-317 ERROR: Undefined symbol: .dbcancel ld: 0711-317
ERROR: Undefined symbol: .dbexit
My AIX-Experience 15 Years ago (sorry)... my hint is:

try to swap the link order "-lsybdb
../../replacements/.libs/libreplacements.a" to "../../replacements/.libs/libreplacements.a -lsybdb". At least in AIX4, the linker was a quite simple minded one pass library extractor. (No dependencies graph resolver)

Hope this will cure your linker probs!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlGL+mAACgkQUzMNXFvaJEYk4ACgq/Qwp4uTzx3AwgWTXGXI3CyI
RHoAoJ1kGzMr8fzS3pq6raRiu6FWByJc
=bf/o
-----END PGP SIGNATURE-----
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
James K. Lowden
2013-05-12 20:22:26 UTC
Permalink
On Thu, 9 May 2013 13:13:40 +0000
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o
terminal.o edit.o handlers.o interrupt.o -L/usr/local/lib
-L../../dblib/.libs
-lsybdb ../../replacements/.libs/libreplacements.a -liconv -lcurses
-lreadline -lpthreads -Wl,-blibpath:/usr/local/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .dbcoltype
ld: 0711-317 ERROR: Undefined symbol: .dbcollen
ld: 0711-317 ERROR: Undefined symbol: .dbcolname
ld: 0711-317 ERROR: Undefined symbol: .dbdead
ld: 0711-317 ERROR: Undefined symbol: .dbinit
ld: 0711-317 ERROR: Undefined symbol: .dblogin
fisql uses db-lib, and these are db-lib symbols. You are
correctly linking to libsybdb; that's what "-lsybdb" does. However,
the linker is not finding that library, or (unlikely) the library it
does find doesn't export those symbols.

I would use the AIX equivalent of nm(1) to
examine ../../dblib/.libs/libsybdb.a (if that's what it's called) to
make sure e.g. dbinit is defined as a public symbol. Potentially
there's a 32-bit version in /usr/local/lib that's hiding the 64-bit
version in your build tree. That would explain why you can build the
32-bit version.

I'm not sure why -L/usr/local/lib appears first among the -L options.
ISTM it shouldn't be there at all, because fisql should be linked to
the library in the build tree that will be installed when fisql is
installed.

HTH.

--jkl
Vann, David
2013-05-14 16:13:04 UTC
Permalink
Problem solved.

I thought for sure I had configured with LIB path settings, but this is what was needed. I used both LIBPATH and LD_LIBRARY_PATH. I think AIX uses LIBPATH

export OBJECT_MODE=64
export CFLAGS=-maix64
export LIBPATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
./configure --prefix=/usr/local --with-unixodbc=/usr/local --with-tdsver=8.0 --enable-msdblib 2>&1 | tee configure.log

After that the make worked.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: Sunday, May 12, 2013 4:22 PM
To: freetds at lists.ibiblio.org
Subject: Re: [freetds] freeTDS configure works but make doesn't

On Thu, 9 May 2013 13:13:40 +0000
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc -D_THREAD_SAFE
-maix64 -W declaration-after-statement -o .libs/fisql fisql.o
terminal.o edit.o handlers.o interrupt.o -L/usr/local/lib
-L../../dblib/.libs -lsybdb ../../replacements/.libs/libreplacements.a
-liconv -lcurses -lreadline -lpthreads
-Wl,-blibpath:/usr/local/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .dbcoltype
ld: 0711-317 ERROR: Undefined symbol: .dbcollen
ld: 0711-317 ERROR: Undefined symbol: .dbcolname
ld: 0711-317 ERROR: Undefined symbol: .dbdead
ld: 0711-317 ERROR: Undefined symbol: .dbinit
ld: 0711-317 ERROR: Undefined symbol: .dblogin
fisql uses db-lib, and these are db-lib symbols. You are correctly linking to libsybdb; that's what "-lsybdb" does. However, the linker is not finding that library, or (unlikely) the library it does find doesn't export those symbols.

I would use the AIX equivalent of nm(1) to examine ../../dblib/.libs/libsybdb.a (if that's what it's called) to make sure e.g. dbinit is defined as a public symbol. Potentially there's a 32-bit version in /usr/local/lib that's hiding the 64-bit version in your build tree. That would explain why you can build the 32-bit version.

I'm not sure why -L/usr/local/lib appears first among the -L options.
ISTM it shouldn't be there at all, because fisql should be linked to the library in the build tree that will be installed when fisql is installed.

HTH.

--jkl
James K. Lowden
2013-05-16 01:32:36 UTC
Permalink
On Tue, 14 May 2013 16:13:04 +0000
Post by Vann, David
Problem solved.
I thought for sure I had configured with LIB path settings, but this
is what was needed. I used both LIBPATH and LD_LIBRARY_PATH. I
think AIX uses LIBPATH
export OBJECT_MODE=64
export CFLAGS=-maix64
export LIBPATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
./configure --prefix=/usr/local --with-unixodbc=/usr/local
--with-tdsver=8.0 --enable-msdblib 2>&1 | tee configure.log
After that the make worked.
http://seriousbirder.com/blogs/aix-shared-and-static-libraries-explained/

http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds3%2Fld.htm

Thanks for following up with the outcome. I'm not quite sure how that
fixed the problem, even though I'm sure you needed LIBPATH. Let's
compare notes.

As IBM's documentation says (a little obliquely), the value of LIBPATH,
if extant, is

"used as the default library path information."
and
"[T]he default library path information is written in the loader
section of the output file."

IOW, LIBPATH causes the linker to embed a library search path in the
executable.

In ELF executables, there's a place for something called the RPATH,
which is a set of paths to be searched by the runtime linker to find
shared objects. (Many Linux distributions discourage the use of
RPATH. Let's just say that if you control the installation directory,
RPATH will make your life simpler.)

Most ELF-based systems -- Linux and the BSDs -- use the GNU
static linker, which sets the RPATH via the "-R" or "-rpath" option. No
environment variable provides a default RPATH to the GNU linker.

Entirely distinct is the -L option: it tells the static linker -- the
thing producing the executable -- where to search for libraries, both
static and dynamic.

AIX it seems uses XCOFF, not ELF, but has a similar notion of embedding
a library search path in the executable. Instead of -R or -rpath, the
AIX linker uses -blibpath or, in its absence, the value of LIBPATH.

You're using --prefix=/usr/local, so you correctly have
"LIBPATH=/usr/local/lib". That way, after "make install", when the
runtime linker loads fisql, it will consult the RPATH (equivalent) it
finds "in the output file" (i.e., the fisql binary) and will find the
library, libsybdb.a (on AIX), that provides the db-lib symbols. (Your
linker command line also uses -L../../dblib/.libs to point the static
linker at the pre-installed library location.)

What's confusing is that setting LIBPATH solved your build-time
problem, because LIBPATH isn't used at build-time for symbol
resolution: "LIBPATH is not used when searching for libraries that are
specified from the command line." The linker should have found those
symbols in ../../dblib/.libs/libsybdb.a.

LD_LIBRARY_PATH, by the way, is not a build-time variable. It is used
only by the runtime linker; see the documentaiton for dlopen(3). On
AIX, LIBPATH also serves to inform dlopen(3) at runtime, exactly as
LD_LIBRARY_PATH does.

So, you needed LIBPATH, yes. But according to the documentation I
found, the lack of LIBPATH shouldn't have prevented linking. It would
have prevented running unless you'd set it or LD_LIBRARY_PATH at
runtime.

HTH.

--jkl
Post by Vann, David
-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of James K.
freetds at lists.ibiblio.org Subject: Re: [freetds] freeTDS configure
works but make doesn't
On Thu, 9 May 2013 13:13:40 +0000
Post by Vann, David
libtool: link: /usr/local/TDS/freetds-0.91/compile gcc
-D_THREAD_SAFE -maix64 -W declaration-after-statement
-o .libs/fisql fisql.o terminal.o edit.o handlers.o interrupt.o
-L/usr/local/lib -L../../dblib/.libs
-lsybdb ../../replacements/.libs/libreplacements.a -liconv -lcurses
-lreadline -lpthreads -Wl,-blibpath:/usr/local/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .dbcoltype
ld: 0711-317 ERROR: Undefined symbol: .dbcollen
ld: 0711-317 ERROR: Undefined symbol: .dbcolname
ld: 0711-317 ERROR: Undefined symbol: .dbdead
ld: 0711-317 ERROR: Undefined symbol: .dbinit
ld: 0711-317 ERROR: Undefined symbol: .dblogin
fisql uses db-lib, and these are db-lib symbols. You are correctly
linking to libsybdb; that's what "-lsybdb" does. However, the linker
is not finding that library, or (unlikely) the library it does find
doesn't export those symbols.
I would use the AIX equivalent of nm(1) to
examine ../../dblib/.libs/libsybdb.a (if that's what it's called) to
make sure e.g. dbinit is defined as a public symbol. Potentially
there's a 32-bit version in /usr/local/lib that's hiding the 64-bit
version in your build tree. That would explain why you can build the
32-bit version.
I'm not sure why -L/usr/local/lib appears first among the -L options.
ISTM it shouldn't be there at all, because fisql should be linked to
the library in the build tree that will be installed when fisql is
installed.
HTH.
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Loading...