[comp.sys.hp] Problem compiling gnuEmacs

bill@boulder.Colorado.EDU (06/06/89)

   Hi, I'm having a strange problem, and I wonder if anybody can
make any suggestions.

   I have an HP350 running HP-UX 6.5, and I've been trying to compile
version 18.54 of gnuEmacs, which I just ftp'ed from prep.ai.mit.  As
far as I can tell, there's no reason why it shouldn't work -- but when
the make gets to the "ld" stage, it complains about some undefined
externals, namely "flag_fpa", "fpa_loc", and "float_loc".

   I'm using the ordinary HP-UX version of cc, with -O.

   I assume the problem is that I'm not linking in some necessary
library, but I can't figure out what library it should be.  I can't
even figure out where those externals are used -- their names do not
appear anywhere in the Emacs source code, or in any header file in
/usr/include or /usr/include/sys.  They look like they have something
to do with a floating point accelerator, but that doesn't help me
very much.

   Judging by the documentation, people have been able to get gnuEmacs
running on 300-series machines without encountering this problem -- is
it something new with 6.5?  Can anybody enlighten me?

   Maybe it would be best to reply by email, but then again maybe this
problem will be of general interest.

   In any case, thanks for any help you can give --

					Bill Skaggs

mike@hpfcdc.HP.COM (Mike McNelly) (06/06/89)

These symbols are defined in /lib/crt0.o for C, or /lib/frt0.o for FORTRAN.
They are necessary as initializers for floating point hardware (if any) or
code that accesses the floating point hardware.

Use adb to disassemble /lib/crt0.o to see what's going on. It's very simple.
Some of the GNU stuff does not load /lib/crt0.o.

Mike McNelly
mike%hpfcla@hplabs.hp.com

ericr@hpvcfs1.HP.COM (Eric Ross) (06/07/89)

Here is the context diff that I use for 6.5 to define those globals.
crt0.c has been a major thorn of incompatibility ever since Gnu Emacs
has been ported to the Series 300.  In any case this should fix
your problem.  

Eric Ross
Hewlett Packard, Vancouver Division
ericr%hpvcper@hplabs.hp.com


*** crt0.c	Wed Apr 26 07:13:17 1989
--- crt0.c.orig	Tue Aug 30 23:48:46 1988
***************
*** 446,455
  #else /* new hp assembler */
  
  	asm("	text");
- 	asm("	set	float_loc,0xFFFFB000");
- 	asm("	set	fpa_loc,0xFFF08000");
- 	asm("	global	float_loc");
- 	asm("	global	fpa_loc");
  	asm("	global	__start");
  	asm("	global	_exit");
  	asm("	global	_main");

--- 446,451 -----
  #else /* new hp assembler */
  
  	asm("	text");
  	asm("	global	__start");
  	asm("	global	_exit");
  	asm("	global	_main");
***************
*** 465,473
  	asm("skip_float:");
  	asm("	subx.w	%d1,%d1");
  	asm("	mov.w	%d1,flag_68010");
- 	asm("	add.l	%d0,%d0");
- 	asm("	subx.w	%d1,%d1");
- 	asm("	mov.w	%d1,flag_fpa");
  	asm("	mov.l	4(%a7),%d0");
  	asm("	beq.b	skip_1");
  	asm("	mov.l	%d0,%a0");

--- 461,466 -----
  	asm("skip_float:");
  	asm("	subx.w	%d1,%d1");
  	asm("	mov.w	%d1,flag_68010");
  	asm("	mov.l	4(%a7),%d0");
  	asm("	beq.b	skip_1");
  	asm("	mov.l	%d0,%a0");
***************
*** 499,505
  	asm("	comm	float_soft, 4");
  	asm("	comm	flag_68881, 4");
  	asm("	comm	flag_68010, 4");
- 	asm("	comm	flag_fpa,   4");	
  	
  #endif /* new hp assembler */
  #endif /* hp9000s300 */

--- 492,497 -----
  	asm("	comm	float_soft, 4");
  	asm("	comm	flag_68881, 4");
  	asm("	comm	flag_68010, 4");
  	
  #endif /* new hp assembler */
  #endif /* hp9000s300 */

ted@hpwrce.HP.COM ( Ted Johnson) (06/08/89)

I think the problem is tha gnuemacs uses its own crt.o file, and 
doesn't define these  vars.  As I recall, the problem can be
solved by adding 4 lines of assembly to one of the ifdef'd 
files....

To find out the values of flag_fpa, fpa_loc, and float_loc,
do: nm /lib/crt0.o |grep fpa_loc, etc.


-Ted