Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!comp.vuw.ac.nz!asjl From: asjl@comp.vuw.ac.nz Newsgroups: gnu.utils.bug Subject: Re: Req help bldg GNU gas 1.34 on hpux Message-ID: <8909172150.AA15958@comp.vuw.ac.nz> Date: 18 Sep 89 18:09:15 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: asjl@comp.vuw.ac.nz Distribution: gnu Organization: GNUs Not Usenet Lines: 115 X-Unparsable-Date: Mon, 18 Sep 89 9:50:42 GMT+12:00 Forwarded message: > >(Building on HP 9000/300) > >I'm having problems building write.c from the gas-1.34 distribution on >prep.ai.mit.edu. The offending section is > > md_number_to_chars((char *)&the_exec.a_machtype, EXEC_MACHINE_TYPE, sizeof(the_exec.a_machtype)); > >What I've fixed so far is the original definition > >#define EXEC_MACHINE_TYPE HP9000S200_ID > >which only makes sense when you rewrite as > >#ifdef hpux >#include >#define EXEC_MACHINE_TYPE HP9000S200_ID >#endif > I wrote the conditional in write.c as: #ifdef hpux #define EXEC_MACHINE_TYPE HP9000S200_ID #endif and used the following a.out.h -- /* Special version of for use under hp-ux. Copyright (C) 1988 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this file; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* The `exec' structure and overall layout must be close to HP's when we are running on an HP system, otherwise we will not be able to execute the resulting file. */ /* Allow this file to be included twice. */ #ifndef __GNU_EXEC_MACROS__ struct exec { unsigned short a_machtype; /* machine type */ unsigned short a_magic; /* magic number */ unsigned long a_spare1; unsigned long a_spare2; unsigned long a_text; /* length of text, in bytes */ unsigned long a_data; /* length of data, in bytes */ unsigned long a_bss; /* length of uninitialized data area for file, in bytes */ unsigned long a_trsize; /* length of relocation info for text, in bytes */ unsigned long a_drsize; /* length of relocation info for data, in bytes */ unsigned long a_spare3; /* HP = pascal interface size */ unsigned long a_spare4; /* HP = symbol table size */ unsigned long a_spare5; /* HP = debug name table size */ unsigned long a_entry; /* start address */ unsigned long a_spare6; /* HP = source line table size */ unsigned long a_spare7; /* HP = value table size */ unsigned long a_syms; /* length of symbol table data in file, in bytes */ unsigned long a_spare8; }; /* Tell a.out.gnu.h not to define `struct exec'. */ #define __STRUCT_EXEC_OVERRIDE__ #include "a.out.gnu.h" #undef N_MAGIC #undef N_MACHTYPE #undef N_FLAGS #undef N_SET_INFO #undef N_SET_MAGIC #undef N_SET_MACHTYPE #undef N_SET_FLAGS #define N_MAGIC(exec) ((exec) . a_magic) #define N_MACHTYPE(exec) ((exec) . a_machtype) #define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic)) #define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype)) #undef N_BADMAG #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x))) #define _N_BADMACH(x) \ (((N_MACHTYPE (x)) != HP9000S200_ID) && \ ((N_MACHTYPE (x)) != HP98x6_ID)) #define HP98x6_ID 0x20A #define HP9000S200_ID 0x20C #undef _N_HDROFF #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec))) #define SEGMENT_SIZE 0x1000 #endif /* __GNU_EXEC_MACROS__ */ -- EMAIL = asjl@comp.vuw.ac.nz FAX = +64 4 712 070 PHONE = +64 4 721 000 x8978 SNAIL = Computer Science Dept, Victoria University, Wellington, NEW ZEALAND