Re: Problem porting to Sun
Posted in 1997
>From: Teresa Griffith <Teresa.Griffith@bridge.bellsouth.com>
>Date: Wed, 13 Aug 1997 08:54:31 -0500
>X-Informix-List-Id: <news.41594>
>
>We are in the process of porting our software to a Sun Ultra 1 (OS
>5.5.1), and have run into a few problems with compiling the esql/C++
>code.
>
>The migration is from HPUX (INFORMIX-ESQL Version 7.10.UD1) to Sun Ultra
>1 (INFORMIX-ESQL Version 7.23.UC1), so we're not sure if it's "features"
>of the Sun port or the informix upgrade, or some of both.
>
>First problem - compiling library files. Done in one step, we get the
>following:
>
>/bto/sys/informix/bin/esql -c -g -D_SUN_SOURCE -DMOTIF -DXT_CODE
>-I/local_dev/tn_src/include/ -I/local_dev/tn_src/include/
>-I/bto/sys/nav/usr/include/ -I/bto/sys/bscasvcs/include/
>-I/usr/local/include/RW_tools -I/bto/sys/tn3270/Hllapi
>-I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/uimx2.9/include
>-I/bto/sys/vt100/include -I/bto/sys/informix/incl/esql
>-I/bto/sys/informix/incl/esql QueryList.ec -o QueryList.o
>
>output generated for this file.
>
>Loading libBSqryList.a ...
>
>---
>We have verified that checkapi.o is there and has read permissions for
>everybody.
The problem is that 'CC -c' doesn't like being told to deal with object
files, but checkapi.o is listed on the command line. If you used GCC/G++,
you'd get a whole lot more warning messages about the unused library options.
I believe that the latest (9.1x) versions of ESQL/C have this much fixed
in the script. It is only a warning, not an error, though it is horrid.
You can force that warning by typing:
CC -c somefile.o
If the ESQL/C code compiled OK, the exit code is still zero.
>We did manage to circument this problem by breaking it out into two
>steps - esql -e then CC. Is there an easier way to do this?
Have you checked the esql++ script in the IIUG archives? Or rather,
the version I posted a month or so ago which hasn't yet been inserted
into the archives. Look in DejaNews (http://www.dejanews.com) for it.
I'm not sure that it circumvents this problem, but it may be worth
checking anyway.
>Second problem - linking the execs. We would like to link to the shared
>libraries, but the compiler insists on linking to the static libraries.
>So we get complaints about undefined symbols in libos.a & libgls.a:
>
>ild: (undefined symbol) gcvchdir -- referenced in the text segment of
>/bto/sys/informix/lib/esql/libos.a(osdnet.o)
>ild: (undefined symbol) gl_ext_malloc -- referenced in the text segment
>of /bto/sys/informix/lib/esql/libgls.a(glsextfn.o)
>(and many more follow this)
This is weird... I don't run into that problem on my Sparc 20 running
Solaris 2.5.1 with ESQL/C 7.23.UC1, especially not with the esql++
script. You don't show the command line you are using. Is there
anything in your environment which could be forcing the static
linking? Or is it that your ESQL/C installation was not done
properly? I spent a considerable amount of time recently debugging a
Solaris linking problem which turned out to be that the distributed
libraries with names such as isqls07a.so had not been linked to the
correct names (libixsql.so).
>OK, so I just fixed this by adding in the link options from
>"esql -libs". However, I got the impression from the esql/C programmers
>manual that esql automatically links these libraries in. We are
>hesitant to specify them in the makefiles because we still have to
>support the HP compiles, and the libraries have different names. Can
>someone tell me what the difference is with the lib? and libix?, and
>what me might be doing wrong to get the static libraries instead of the
>shared libraries?
FWIW: given the source file:
#include <stdlib.h>
main()
{
EXEC SQL WHENEVER ERROR STOP;
EXEC SQL CONNECT TO "apt" AS 'conn1';
EXEC SQL CREATE TEMP TABLE T(T INTEGER);
EXEC SQL CONNECT TO "apt" AS 'conn2';
EXEC SQL CREATE TEMP TABLE T(T INTEGER);
EXEC SQL DISCONNECT 'conn2';
EXEC SQL DISCONNECT 'conn1';
return(0);
}
I was able to compile this using the command line:
INFORMIXC="CC" esql -o kk kk.ec
When I ran the esql script with 'sh -x' to get the debugging output, the
final line of the script was:
exec CC -I/usr/informix/7.23.UC1/incl/esql -o kk kk.c \\
-L/usr/informix/7.23.UC1/lib -L/usr/informix/7.23.UC1/lib/esql \\
-lixsql -lixasf -lixgen -lixos -lixgls -lnsl -lsocket -laio -lm \\
/usr/informix/7.23.UC1/lib/esql/checkapi.o -lixglx
If you are not using the esql script to direct the linking, think again!
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
PS: Warning I do not reply to messages with anti-spam in the return path.