Subject: Re: 2.0 isn't self-building
To: None <port-vax@netbsd.org>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: port-vax
Date: 03/01/2005 21:54:59
I wrote:

> I've just installed 2.0 on a 4000-500, and got lots of weird errors
> ("illegal instruction" from temacs when building Emacs, [...]

Running a fresh -current, this still happens:

| LC_ALL=C ./temacs -batch -l loadup dump
| Loading loadup (source)...
| Using load-path (/usr/pkgsrc/editors/emacs/work/emacs-21.4/lisp)
| Loading byte-run...
| Loading subr...
| [...]
| Loading buff-menu...
| Loading float-sup...
| [1]   Illegal instruction (core dumped) LC_ALL=C ./temac...
| *** Error code 132

GDB says:

| (gdb) where
| #0  0x7f5b3ee7 in atan2 (16512, 0, 16512, 0) from /usr/lib/libm.so.0
| #1  0x7f7e26be in _rtld_bind_start (16512, 0, 16512, 0)
|    from /usr/libexec/ld.elf_so
| #2  0x7f5b3bd8 in atan (16512, 0) from /usr/lib/libm.so.0
| #3  0x000f0f5e in Fatan (1)
| #4  0x000efb76 in Ffuncall (2, 2147476292)
| #5  0x00113d4b in Fbyte_code (809746436, 1078203264, 2)
| #6  0x000ef304 in Feval (1345781908)
| [...]

It's the "polyd" instruction in n_atan2.S that does it.  The KA680
seems not to support that instruction.  Commenting that single line
out breaks atan2(), of course, but it does make it possible to build a
working Emacs on this box.  :-)

Now, the weird thing is /usr/src/lib/libm/Makefile, which has comments
in it that *seem* to indicate that it's avoiding anything that uses
polyd, because it's not always present, and not yet emulated.  I may
be misunderstanding something, but it looks to me as if the comments
in that Makefile don't completely hold true...?

Also, I wasn't being entirely truthful about Emacs getting built OK.
It gets built, and installed, but it never gets registered as an
installed package, because awk core dumps along the way:

| [...]
| gmake[1]: Entering directory `/usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src'
| gmake[1]: Nothing to be done for `maybe-blessmail'.
| gmake[1]: Leaving directory `/usr/pkgsrc/editors/emacs/work/emacs-21.4/lib-src'
| /usr/sbin/chown -R root:wheel /usr/local/share/emacs
| [1]   Done                    /usr/bin/awk "BE... |
|       Done                    /usr/bin/sort -u |
|       Done                    /usr/bin/sed -e ... |
|       Done                    /usr/bin/xargs -... |
|       Illegal instruction (core dumped) /usr/bin/awk "{ ...
| [1]   Done                    echo ${pkglist} |
|       Done                    /usr/bin/xargs -... |
|       Done                    /usr/bin/sort -u |
|       Done                    /usr/bin/xargs -... |
|       Illegal instruction (core dumped) /usr/bin/awk "/^...
| [1]   Done                    echo ${size_this... |
|       Illegal instruction (core dumped) /usr/bin/awk "{ ...
| *** Error code 132

GDB says:

| (gdb) where
| #0  0x7f7454f2 in modf (0, 0, 2147477240) from /usr/lib/libc.so.12
| #1  0x0001dacc in get_str_val (319488, 281256)
| #2  0x0001db66 in getpssval (319488)
| #3  0x0001bf05 in printstat (291536, 319)
| #4  0x000191e9 in execute (291520)
| [...]

Hmm.  Another math function.

But hey, Emacs is working.  I can edit comfortably!  :-)

-tih
-- 
Don't ascribe to stupidity what can be adequately explained by ignorance.