dhammaBum has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to compile perl5.6.0 on AIX 4.2 and get the following error:

cc -o miniperl -L/lib `echo gv.o toke.o perly.o op.o regcomp. +o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ct +l.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o + xsutils.o globals.o perlio.o perlapi.o | sed 's/ op.o / /'` minipe +rlmain.o opmini.o perl.o ld: 0711-317 ERROR: Undefined symbol: .floor ld: 0711-317 ERROR: Undefined symbol: .sqrt ld: 0711-317 ERROR: Undefined symbol: .log ld: 0711-317 ERROR: Undefined symbol: .exp ld: 0711-317 ERROR: Undefined symbol: .cos ld: 0711-317 ERROR: Undefined symbol: .sin ld: 0711-317 ERROR: Undefined symbol: .atan2 ld: 0711-317 ERROR: Undefined symbol: .fmod ld: 0711-317 ERROR: Undefined symbol: .pow ld: 0711-317 ERROR: Undefined symbol: .__set_errno128 ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more info +rmation. make: The error code from the last command is 8.

This occurs using gcc or IBM's cc (ver 4.4) and all works just fine on AIX 4.3, but it would be quite awkward to upgrade just now.

I presume these functions are in libm.a which duly resides in /lib (and glibm.a in the gcc lib directory), but why can't it be found??

Thanks for the help.

Replies are listed 'Best First'.
Re: YACQ (yet another compiler question)
by rjray (Chaplain) on Feb 06, 2002 at 23:30 UTC

    It looks like the compiler isn't actually trying to link the math library (libm.a). Was this library located correctly during the Configure phase?

    There is also one point in Configure where you have the option of modifying the list of libraries that perl will be linked against. Have you checked to see that '-lm' is on that list?

    --rjray

      I looked thru the config.sh and added -lm to:

      lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).ex +p -b noentry -lC -lc -lm - L/usr/local/lib'
      I also added m to:

      libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dl +d ld sun m C c cposix posi x ndir dir crypt sec ucb bsd BSD PW x iconv'
      both to no avail. Strange, no?