First I run make and build a static cryptlib library, 'libcl.a', and copied
it over to /usr/lib. The CC compiler options used, was
-O2 -maxmem=4096 -qroconst
Made a minimal test application 'test.c', and compiled it via
# cc test.c -I. -c
# cc test.o -bstatic -lcl
Gee, here where some of the messages:
ld: 0711-317 ERROR: Undefined symbol: __loadx
ld: 0711-317 ERROR: Undefined symbol: _exit
ld: 0711-317 ERROR: Undefined symbol: __unload
ld: 0711-317 ERROR: Undefined symbol: errno
ld: 0711-317 ERROR: Undefined symbol: disclaim
ld: 0711-317 ERROR: Undefined symbol: sbrk
ld: 0711-317 ERROR: Undefined symbol: brk
ld: 0711-317 ERROR: Undefined symbol: kwritev
ld: 0711-317 ERROR: Undefined symbol: fstatx
ld: 0711-317 ERROR: Undefined symbol: statx
ld: 0711-317 ERROR: Undefined symbol: _system_configuration
ld: 0711-317 ERROR: Undefined symbol: .__quous
ld: 0711-317 ERROR: Undefined symbol: mntctl
ld: 0711-317 ERROR: Undefined symbol: open
ld: 0711-317 ERROR: Undefined symbol: klseek
ld: 0711-317 ERROR: Undefined symbol: kreadv
ld: 0711-317 ERROR: Undefined symbol: fstatfs
ld: 0711-317 ERROR: Undefined symbol: statfs
<snip>
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
ld: 0711-317 ERROR: Undefined symbol: .pthread_self
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .shmdt
ld: 0711-317 ERROR: Undefined symbol: .shmctl
ld: 0711-317 ERROR: Undefined symbol: .shmget
ld: 0711-317 ERROR: Undefined symbol: .shmat
<snip>
ld: 0711-317 ERROR: Undefined symbol: socket
ld: 0711-317 ERROR: Undefined symbol: connect
ld: 0711-317 ERROR: Undefined symbol: sendto
ld: 0711-317 ERROR: Undefined symbol: nrecvfrom
ld: 0711-317 ERROR: Undefined symbol: bind
<snip>
What is my problem here? I have for example libpthread.a in /usr/lib/... do
I need to look at 'dump -Hv libcl.a'?
I tried to re-direct the above error messages to a file, but '>>' didn't
help...
What is a good programmers editor (I hate vi and don't have resources to run
emacs) on AIX?
My last newbie question is, how do I get the last command under ksh? I am
only used to tcsh...but here arrow up doesn't work and no man pages
installed.
--
Tor <torust AT online DOT no>
<snip>
> Made a minimal test application 'test.c', and compiled it via
>
> # cc test.c -I. -c
> # cc test.o -bstatic -lcl
>
> Gee, here where some of the messages:
I have managed to solve most of the problems myself now, only
'h_errno' is still undefined
# cc test.c -I. -lcl -lpthreads -bnoquiet
(ld): halt 4
(ld): savename a.out
(ld): filelist 5 1
(ld): i /lib/crt0.o
(ld): i test.o
(ld): lib /usr/lib/libcl.a
(ld): lib /usr/lib/libpthreads.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libpthreads.a[shr.o]: 99 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 10 symbols imported.
LIBRARY: Shared object libc.a[shr.o]: 1560 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 78 symbols imported.
FILELIST: Number of previously inserted files processed: 5
(ld): resolve
RESOLVE: 1619 of 7017 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 94 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR
Import-File
{Shared-object}
RLD: Address Section Rld-type
Referencing Symbol
-------------------------------------------------------------------------------
---------------
._h_errno [148] ER PR
misc/net_tcp.c(/usr/lib/libcl.a[net_tcp
.o])
00000da8 .text R_RBR [40]
<.getHostE
rror>
ER: The return code is 8.
Hmmm, is it perhaps no developers around here, just SA? Have looked in
the AIX FAQ, but couldn't find any info on 'h_errno'.
Tor
I assume your "test.c" is something like:
$ pwd
/home/sae/AIX/cryptlib
$ cat ctest.c
#include "cryptlib.h"
main(int argc, char *argv[])
{
/* Directly from the manual... */
cryptInit();
/* Calls to cryptlib routines */
cryptEnd();
}
$
> I have managed to solve most of the problems myself now, only
> 'h_errno' is still undefined
>
> # cc test.c -I. -lcl -lpthreads -bnoquiet
Not in my case:
$ cc ctest.c -o ctest -I. -L. -lcl -lpthreads -bnoquiet
(ld): halt 4
(ld): savename ctest
(ld): filelist 5 1
(ld): i /lib/crt0.o
(ld): i ctest.o
(ld): lib ./libcl.a
(ld): lib /usr/lib/libpthreads.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libpthreads.a[shr_comm.o]: 108 symbols imported.
LIBRARY: Shared object libpthreads.a[shr_xpg5.o]: 119 symbols imported.
LIBRARY: Shared object libc.a[shr.o]: 2172 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 78 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 5
(ld): resolve
RESOLVE: 1841 of 7851 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 94 symbols.
(ld): er full
ER: There are no unresolved symbols.
(ld): mismatch
MISMATCH: No type mismatches exist.
(ld): comprld
COMPRLD: Kept 11849 of 11849 relocation entries.
(ld): origin page 0x10000000 0x20000000
(ld): libpath .:/usr/lib:/lib
LIBPATH: Library path set to .:/usr/lib:/lib
(ld): save 1L .
SAVE: Section sizes = 643704+104688+8740 (0x9D278+0x198F0+0x2224 hex)
SAVE: Size of TOC: 1736 (0x6C8 hex)
(ld): rc
RC: Highest return code was 0.
$
>
> Hmmm, is it perhaps no developers around here, just SA? Have looked in
> the AIX FAQ, but couldn't find any info on 'h_errno'.
h_errno is defined in <netdb.h>, it's the error return value for
network database operations.
BTW, I'm using AIX 4.3.3.0 and C for AIX 4.4. cryptlib was built
by issuing "make" in the top-level directory. There were a few
warnings about "/*" in comments, but nothing more.
Take care,
--
Stefaan
--
Every modification you make to a third-party software product is just one
more thing that you have to document, maintain, reimplement with upgrades,
and explain to your co-workers. Most of the time this is a very bad idea.
-- Russ Allbery (r...@stanford.edu)
<snip>
> > Have looked in
> > the AIX FAQ, but couldn't find any info on 'h_errno'.
>
> h_errno is defined in <netdb.h>, it's the error return value for
> network database operations.
>
> BTW, I'm using AIX 4.3.3.0 and C for AIX 4.4. cryptlib was built
> by issuing "make" in the top-level directory. There were a few
> warnings about "/*" in comments, but nothing more.
Problem solved, on AIX 4.2 I needed to use cc_r and/or defining _REENTRANT
and _THREAD_SAFE.
BTW, the aes.c/aes.h didn't compile at all here, so I hacked a bit in
lib_aes.c, did you really the compile same version of cryptlib as I did?
$ rm static-obj/aes.o
$ make
cc -c -D__UNIX__ -DNDEBUG -I. -DDATA_BIGENDIAN -DOSVERSION=3 -O2 -maxmem=4096 -qroconst crypt/aes.c -o ./static-obj/aes.o
$ cksum crypt/aes.[ch]
4276640189 28821 crypt/aes.c
98968704 12126 crypt/aes.h
$
Maybe something to do with the compiler you're using, or the
version of AIX.
Anyhow, glad to know the problem's solved.