diff --git a/gas/.Sanitize b/gas/.Sanitize index 8c8a156012..02475174fe 100644 --- a/gas/.Sanitize +++ b/gas/.Sanitize @@ -43,6 +43,7 @@ bignum-copy.c bignum.h bit_fix.h cond.c +conf-a-gas.com conf.in config config-gas.com @@ -77,6 +78,7 @@ literal.c mac-as.r macro.c macro.h +makefile.vms messages.c mpw-config.in mpw-make.sed diff --git a/gas/ChangeLog b/gas/ChangeLog index ce08687405..e79c2ce920 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,21 @@ +Thu Aug 8 12:32:56 1996 Klaus Kaempf + + Add support for openVMS/Alpha. + * as.h (PRINTF_LIKE): Don't define if VMS, for now. + * config/obj-evax.c: New file. + * config/obj-evax.h: New file. + * config/tc-alpha.c: Add support for EVAX format if OBJ_EVAX is + defined. + * config/tc-alpha.h: Add support for EVAX format if OBJ_EVAX is + defined. Add case for bfd_target_evax_flavour. + * config/vms-a-conf.h: New file. + * conf-a-gas.com: New file. + * configure.in: Add target alpha-*-*vms*. + * configure: Rebuild. + * makefile.vms: New file. + * read.c (s_lcomm): Align bss_seg on 8 byte boundary if OBJ_EVAX. + Don't call ffs on openVMS/Alpha. + Wed Aug 7 14:19:03 1996 Philippe De Muyter * configure.in: Make GAS_CHECK_DECL_NEEDED include or diff --git a/gas/conf-a-gas.com b/gas/conf-a-gas.com new file mode 100644 index 0000000000..ca5dd94564 --- /dev/null +++ b/gas/conf-a-gas.com @@ -0,0 +1,168 @@ +$! +$! This file sets things up to build gas on a openVMS/Alpha system to generate +$! object files for a openVMS/Alpha system. +$! We do not use the configure script, since there is no /bin/sh to execute it. +$! +$! If you are running this file, then obviously the host is alpha-dec-vms. +$! +$gas_host="vms" +$! +$cpu_type="alpha" +$emulation="generic" +$obj_format="evax" +$atof="ieee" +$! +$ DELETE = "delete/noConfirm" +$ ECHO = "write sys$output" +$! +$! Target specific information +$call link targ-cpu.c [.config]tc-'cpu_type'.c +$call link targ-cpu.h [.config]tc-'cpu_type'.h +$call link targ-env.h [.config]te-'emulation'.h +$! +$! Code to handle the object file format. +$call link obj-format.h [.config]obj-'obj_format'.h +$call link obj-format.c [.config]obj-'obj_format'.c +$! +$! Code to handle floating point. +$call link atof-targ.c [.config]atof-'atof'.c +$! +$! +$! Create the file version.opt, which helps identify the executable. +$! +$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ +$search Makefile.in "VERSION="/Exact/Output=config-gas-tmp.tmp +$open ifile$ config-gas-tmp.tmp +$read ifile$ line +$close ifile$ +$DELETE config-gas-tmp.tmp;* +$! Discard "VERSION=" and "\n" parts. +$ijk=f$locate("=",line)+1 +$line=f$extract(ijk,f$length(line)-ijk,line) +$! [what "\n" part?? this seems to be useless, but is benign] +$ijk=f$locate("\n",line) +$line=f$extract(0,ijk,line) +$! +$ if f$search("version.opt").nes."" then DELETE version.opt;* +$copy _NL: version.opt +$open/Append ifile$ version.opt +$write ifile$ "identification="+""""+line+"""" +$close ifile$ +$! +$! Now write config.h. +$! +$ if f$search("config.h").nes."" then DELETE config.h;* +$copy _NL: config.h +$open/Append ifile$ config.h +$write ifile$ "/* config.h. Generated by config-gas.com. */ +$write ifile$ "#ifndef GAS_VERSION" +$write ifile$ "#define GAS_VERSION """,line,"""" +$write ifile$ "#endif" +$write ifile$ "/*--*/" +$append [.config]vms-a-conf.h ifile$: +$close ifile$ +$ECHO "Created config.h." +$! +$! Check for, and possibly make, header file . +$! +$ if f$search("tmp-chk-h.*").nes."" then DELETE tmp-chk-h.*;* +$!can't use simple `#include HDR' with `gcc /Define="HDR="' +$!because the 2.6.[0-3] preprocessor handles it wrong (VMS-specific gcc bug) +$ create tmp-chk-h.c +int tmp_chk_h; /* guarantee non-empty output */ +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_UNIXIO_H +#include +#endif +#ifdef HAVE_UNIXLIB_H +#include +#endif +$ on warning then continue +$ CHECK = "call tmp_chk_h" +$ CHECK "HAVE_STDIO_H" +$ if .not.$status +$ then type sys$input: + +? could not compile . + Since gcc is not set up correctly, gas configuration cannot proceed. + +$ DELETE tmp-chk-h.c;* +$ exit %x002C +$ endif +$! +$ CHECK "HAVE_UNISTD_H" +$ if .not.$status +$ then +$ if f$trnlnm("HFILE$").nes."" then close/noLog hfile$ +$ CHECK "HAVE_UNIXIO_H" +$ got_unixio = ($status .and. 1) +$ CHECK "HAVE_UNIXLIB_H" +$ got_unixlib = ($status .and. 1) +$ create []unistd.h !with rudimentary contents +/* substitute for building gas */ +#ifndef UNISTD_H +#define UNISTD_H + +$ open/Append hfile$ []unistd.h +$ if got_unixio +$ then write hfile$ "#include " +$ else append sys$input: hfile$: +/* some of the routines normally prototyped in */ +extern int creat(), open(), close(), read(), write(); +extern int access(), dup(), dup2(), fstat(), stat(); +extern long lseek(); +$ endif +$ write hfile$ "" +$ if got_unixlib +$ then write hfile$ "#include " +$ else append sys$input: hfile$: +/* some of the routines normally prototyped in */ +extern char *sbrk(), *getcwd(), *cuserid(); +extern int brk(), chdir(), chmod(), chown(), mkdir(); +extern unsigned getuid(), umask(); +$ endif +$ append sys$input: hfile$: + +#endif /*UNISTD_H*/ +$ close hfile$ +$ ECHO "Created ""[]unistd.h""." +$ endif !gcc '#include ' failed +$ DELETE tmp-chk-h.c;* +$ +$tmp_chk_h: subroutine +$ set noOn +$ hname = f$edit("<" + (p1 - "HAVE_" - "_H") + ".h>","LOWERCASE") +$ write sys$output "Checking for ''hname'." +$ if f$search("tmp-chk-h.obj").nes."" then DELETE tmp-chk-h.obj;* +$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc +$ define/noLog sys$output _NL: ! driver's use of multiple image activation +$ gcc /Include=([],[-.include]) /Define=("''p1'") tmp-chk-h.c +$!can't just check $status; gcc 2.6.[0-3] preprocessor doesn't set it correctly +$ ok = (($status.and.1).and.(f$search("tmp-chk-h.obj").nes."")) .or. %x10000000 +$ deassign sys$error !restore, more or less +$ deassign sys$output +$ if ok then DELETE tmp-chk-h.obj;* +$ exit ok +$ endsubroutine !tmp_chk_h +$ +$! +$! Done +$! +$ if f$search("config.status") .nes. "" then DELETE config.status;* +$ create config.status +Links are now set up for use with an Alpha running openVMS. +$ type config.status +$exit +$! +$! +$link: +$subroutine +$ if f$search(p1).nes."" then DELETE 'p1';* +$ copy 'p2' 'p1' +$ ECHO "Copied ''f$edit(p2,"LOWERCASE")' to ''f$edit(p1,"LOWERCASE")'." +$endsubroutine diff --git a/gas/config/.Sanitize b/gas/config/.Sanitize index ca1c10a926..ba55943fd4 100644 --- a/gas/config/.Sanitize +++ b/gas/config/.Sanitize @@ -66,6 +66,8 @@ obj-ecoff.c obj-ecoff.h obj-elf.c obj-elf.h +obj-evax.c +obj-evax.h obj-generic.c obj-generic.h obj-hp300.c @@ -153,6 +155,7 @@ te-sun3.h te-sysv32.h vax-inst.h vms-conf.h +vms-a-conf.h Things-to-lose: diff --git a/gas/config/obj-evax.c b/gas/config/obj-evax.c new file mode 100644 index 0000000000..fbe5069a60 --- /dev/null +++ b/gas/config/obj-evax.c @@ -0,0 +1,42 @@ +/* obj-evax.c - EVAX (openVMS/Alpha) object file format. + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Klaus Kämpf (kkaempf@progis.de) of + proGIS Software, Aachen, Germany. + + This file is part of GAS, the GNU Assembler + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + +#define OBJ_HEADER "obj-evax.h" + +#include "as.h" + +void obj_read_begin_hook () {} + +const pseudo_typeS obj_pseudo_table[] = +{ + {0, 0, 0}, +}; /* obj_pseudo_table */ + + +/* + * Local Variables: + * comment-column: 0 + * fill-column: 131 + * End: + */ + +/* end of obj-evax.c */ diff --git a/gas/config/obj-evax.h b/gas/config/obj-evax.h new file mode 100644 index 0000000000..03e3cbdf63 --- /dev/null +++ b/gas/config/obj-evax.h @@ -0,0 +1,115 @@ +/* This file is obj-evax.h + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Klaus Kämpf (kkaempf@progis.de) of + proGIS Software, Aachen, Germany. + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + +/* + * This file is obj-evax.h and is intended to be a template for + * object format specific header files. + */ + +/* define an obj specific macro off which target cpu back ends may key. */ +#define OBJ_EVAX 1 + +/* include whatever target cpu is appropriate. */ +#include "targ-cpu.h" + +#ifdef BFD_ASSEMBLER +#define OUTPUT_FLAVOR bfd_target_evax_flavour +#endif + +/* + * SYMBOLS + */ + +/* + * If your object format needs to reorder symbols, define this. When + * defined, symbols are kept on a doubly linked list and functions are + * made available for push, insert, append, and delete. If not defined, + * symbols are kept on a singly linked list, only the append and clear + * facilities are available, and they are macros. + */ + +/* #define SYMBOLS_NEED_PACKPOINTERS */ + +/* */ +typedef struct + { + void *nothing; + } +obj_symbol_type; /* should be the format's symbol structure */ + +typedef void *object_headers; + +#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ + +#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ + +#define obj_symbol_new_hook(s) {;} + +#define S_SET_OTHER(S,V) +#define S_SET_TYPE(S,T) +#define S_SET_DESC(S,D) +#define S_GET_OTHER(S) 0 +#define S_GET_TYPE(S) 0 +#define S_GET_DESC(S) 0 + +#undef AXP_REG_GP +#define AXP_REG_GP AXP_REG_PV + +#define PDSC_S_K_KIND_FP_STACK 9 +#define PDSC_S_K_KIND_FP_REGISTER 10 +#define PDSC_S_K_KIND_NULL 8 + +#define PDSC_S_K_MIN_STACK_SIZE 32 +#define PDSC_S_K_MIN_REGISTER_SIZE 24 +#define PDSC_S_K_NULL_SIZE 16 + +#define PDSC_S_M_BASE_REG_IS_FP 0x80 /* low byte */ +#define PDSC_S_M_NATIVE 0x10 /* high byte */ +#define PDSC_S_M_NO_JACKET 0x20 /* high byte */ + +#define LKP_S_K_SIZE 16 + +struct evaxProc { + symbolS *symbol; /* proc pdesc symbol */ + int pdsckind; + int framereg; /* register for frame pointer */ + int framesize; /* size of frame */ + int rsa_offset; + int ra_save; + int fp_save; + long imask; + long fmask; + int type; + int prologue; +}; + +typedef struct evaxProc evaxProcT; +typedef struct evaxProc *evaxProcP; + +/* + * Local Variables: + * comment-column: 0 + * fill-column: 131 + * End: + */ + +/* end of obj-evax.h */ diff --git a/gas/config/vms-a-conf.h b/gas/config/vms-a-conf.h new file mode 100644 index 0000000000..688fc6890c --- /dev/null +++ b/gas/config/vms-a-conf.h @@ -0,0 +1,129 @@ +/* vms-alpha-conf.h. Generated manually from conf.in, + and used by config-gas-alpha.com when constructing config.h. */ + +/* Define if using alloca.c. */ +#ifdef __GNUC__ +#undef C_ALLOCA +#else +#define C_ALLOCA +#endif + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define as __inline if that's what the C compiler calls it. */ +#ifdef __GNUC__ +#undef inline +#else +#define inline +#endif + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#define STACK_DIRECTION (-1) + +/* Should gas use high-level BFD interfaces? */ +#define BFD_ASSEMBLER + +/* Some assert/preprocessor combinations are incapable of handling + certain kinds of constructs in the argument of assert. For example, + quoted strings (if requoting isn't done right) or newlines. */ +#ifdef __GNUC__ +#undef BROKEN_ASSERT +#else +#define BROKEN_ASSERT +#endif + +/* If we aren't doing cross-assembling, some operations can be optimized, + since byte orders and value sizes don't need to be adjusted. */ +#undef CROSS_COMPILE + +/* Some gas code wants to know these parameters. */ +#define TARGET_ALIAS "alpha-vms" +#define TARGET_CPU "alpha" +#define TARGET_CANONICAL "alpha-dec-vms" +#define TARGET_OS "openVMS/Alpha" +#define TARGET_VENDOR "dec" + +/* Sometimes the system header files don't declare malloc and realloc. */ +#undef NEED_DECLARATION_MALLOC + +/* Sometimes the system header files don't declare free. */ +#undef NEED_DECLARATION_FREE + +/* Sometimes errno.h doesn't declare errno itself. */ +#undef NEED_DECLARATION_ERRNO + +#undef MANY_SEGMENTS + +/* Needed only for sparc configuration */ +#undef sparcv9 + +/* Define if you have the remove function. */ +#define HAVE_REMOVE + +/* Define if you have the unlink function. */ +#undef HAVE_UNLINK + +/* Define if you have the header file. */ +#define HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#define HAVE_STDARG_H + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H + +/* Define if you have the header file. */ +#define HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#ifdef __GNUC__ +#define HAVE_SYS_TYPES_H +#else +#undef HAVE_SYS_TYPES_H +#endif + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H /* config-gas.com will make one if necessary */ + +/* Define if you have the header file. */ +#undef HAVE_VARARGS_H + +/* VMS-specific: we need to set up EXIT_xxx here because the default + values in as.h are inappropriate for VMS, but we also want to prevent + as.h's inclusion of from triggering redefinition warnings. + guards itself against multiple inclusion, so including it + here turns as.h's later #include into a no-op. (We can't simply use + #ifndef HAVE_STDLIB_H here, because the in several older + gcc-vms distributions neglects to define these two required macros.) */ +#ifdef HAVE_STDLIB_H +#include +#endif +#if __DECC +#undef EXIT_SUCCESS +#undef EXIT_FAILURE +#define EXIT_SUCCESS 1 /* SS$_NORMAL, STS$K_SUCCESS */ +#define EXIT_FAILURE 0x10000002 /* (STS$K_ERROR | STS$M_INHIB_MSG) */ +#endif + +#include +#if __DECC +extern int strcasecmp (); +extern int strncasecmp (); +#endif diff --git a/gas/makefile.vms b/gas/makefile.vms new file mode 100644 index 0000000000..c9d4d7e522 --- /dev/null +++ b/gas/makefile.vms @@ -0,0 +1,54 @@ +# +# makefile for gas +# +# Created by Klaus Kämpf, kkaempf@progis.de +# + +CC=gcc + +ifeq ($(CC),gcc) +DEFS= +CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) +LFLAGS= +LIBS=,GNU_CC:[000000]LIBGCC2/lib,GNU_CC:[000000]LIBGCCLIB/lib,\ + sys$$library:vaxcrtl.olb/lib,GNU_CC:[000000]crt0.obj +else +DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\ +"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ +"_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec","const=") +CFLAGS=/noopt/debug/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) +LFLAGS= +LIBS= +endif + +OBJS=targ-cpu.obj,obj-format.obj,atof-targ.obj,app.obj,as.obj,atof-generic.obj,\ + bignum-copy.obj,cond.obj,expr.obj,flonum-konst.obj,flonum-copy.obj,\ + flonum-mult.obj,frags.obj,hash.obj,input-file.obj,input-scrub.obj,\ + literal.obj,messages.obj,output-file.obj,read.obj,subsegs.obj,symbols.obj,\ + write.obj,listing.obj,ecoff.obj,stabs.obj,sb.obj,macro.obj + +LIBIBERTY = [-.libiberty]libiberty.olb +LIBBFD = [-.bfd]libbfd.olb +LIBOPCODES = [-.opcodes]libopcodes.olb + + +as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY) + link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) + +gasp.exe: gasp.obj $(LIBBFD) $(LIBIBERTY) + link$(LFLAGS)/exe=$@ gasp.obj,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) + +targ-cpu.c: [.config]tc-alpha.c + copy $< $@ +targ-cpu.h: [.config]tc-alpha.h + copy $< $@ +targ-env.h: [.config]te-generic.h + copy $< $@ +obj-format.h: [.config]obj-evax.h + copy $< $@ +obj-format.c: [.config]obj-evax.c + copy $< $@ +atof-targ.c: [.config]atof-ieee.c + copy $< $@ + +targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c