linking error /usr/ccs/bin/ld: Unsatisfied symbols: altzone (data) (231 Views)
Reply
Occasional Visitor
David Lyons_2
Posts: 1
Registered: ‎01-14-2005
Message 1 of 2 (231 Views)

linking error /usr/ccs/bin/ld: Unsatisfied symbols: altzone (data)

I am trying to compile bash on a HPUX 11.0 server.

It compiles all the modules and the final linking is as follows:

cc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -g -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o bashline.o siglist.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lsh -lreadline -lhistory -ltermcap -lglob -ltilde -lmalloc lib/intl/libintl.a
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (shell.o) was detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unsatisfied symbols:
altzone (data)
make: *** [bash] Error 1


Now atlzone is in lib/sh/strftime.c
It's defined as...

extern int altzone;

Used here:

#if HAVE_TZNAME
/*
* Systems with tzname[] probably have timezone as
* secs west of GMT. Convert to mins east of GMT.
*/
off = -(daylight ? timezone : altzone) / 60;
#else /* !HAVE_TZNAME */
off = -zone.tz_minuteswest;
#endif /* !HAVE_TZNAME */

Now I can undefine HAVE_TZNAME but that results in more errors.

Anyway, I searched the include files for altzone and it's not there.

Have any of you tried building bash on HPUX and if so, did you encounter this build error? If so, how did you resolve it?


Please use plain text.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 2 of 2 (231 Views)

Re: linking error /usr/ccs/bin/ld: Unsatisfied symbols: altzone (data)

In almost all cases, problems like yours result from improper setting of #define's or a failure to download/install all of the required packages for the install.

On some flavors off UNIX, daylight, timezone, and altzone are part of ctime but not under HP-UX.

The external time_t variable altzone contains the difference, in seconds, between UTC and the alternate time zone. The external variable timezone contains the difference, in seconds, between UTC and local standard time. The external variable daylight indicates whether time should reflect daylight savings time. Both timezone and altzone default to 0 (UTC). The external variable daylight is non-zero if an alternate time zone exists.

You could, of course, examine TZ and do this yourself (write a small routine) that defines these variables to satisfy the link but it's much easier to download and install all the required packages and properly set the define's. Most of the source code packages have a configure script to do this for you.

Finally, don't never ever set root's shell to bash on account of root needs a statically linked shell to operate in single-user mode before them there other filesystems like /usr is mounted.

If it ain't broke, I can fix that.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation