Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 11d7327

Browse files
2009-09-01 Tristan Gingold <[email protected]>
* makefile.vms: Ported to Itanium VMS. Remove useless variable and dependencies. Reindent. * configure.com: Ported to Itanium VMS. Now generates a build.com to build without make. Add messages but make edit silent. * hosts/alphavms.h: Add a prototype for stpcpy. * vms.c: Add a missing include for Alpha VMS. * elfxx-ia64.c (ELF_OSABI): Define for OpenVMS.
1 parent 817aadd commit 11d7327

File tree

6 files changed

+144
-53
lines changed

6 files changed

+144
-53
lines changed

bfd/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2009-09-01 Tristan Gingold <[email protected]>
2+
3+
* makefile.vms: Ported to Itanium VMS. Remove useless variable and
4+
dependencies. Reindent.
5+
* configure.com: Ported to Itanium VMS. Now generates a build.com
6+
to build without make. Add messages but make edit silent.
7+
* hosts/alphavms.h: Add a prototype for stpcpy.
8+
* vms.c: Add a missing include for Alpha VMS.
9+
* elfxx-ia64.c (ELF_OSABI): Define for OpenVMS.
10+
111
2009-08-31 Jan Beulich <[email protected]>
212

313
* elf-bfd.h (bfd_elf_get_default_section_type): Declare.

bfd/configure.com

Lines changed: 107 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
$!
2-
$! This file configures the bfd library for use with openVMS (Alpha and Vax)
2+
$! This file configures the bfd library for use with openVMS.
33
$!
44
$! We do not use the configure script, since we do not have /bin/sh
55
$! to execute it.
66
$!
77
$! Written by Klaus K"ampf ([email protected])
8+
$! Rewritten by Tristan Gingold ([email protected])
89
$!
9-
$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
10-
$arch = f$element(arch_indx,"|","|VAX|Alpha|")
10+
$ arch=F$GETSYI("ARCH_NAME")
11+
$ arch=F$EDIT(arch,"LOWERCASE")
12+
$if arch .eqs. "alpha" then target = "alpha"
13+
$if arch .eqs. "ia64" then target = "ia64"
1114
$!
12-
$if arch .eqs. "Alpha"
15+
$if (arch .eqs. "alpha") .or. (arch .eqs. "ia64")
1316
$then
14-
$ write sys$output "Configuring for Alpha target"
15-
$ target = "alpha"
17+
$!
18+
$ write sys$output "Configuring BFD for ''target' target"
19+
$!
1620
$!
1721
$! copy bfd-in2.h to bfd.h, replacing @ macros
1822
$!
@@ -23,6 +27,7 @@ $DECK
2327
! Copy file, changing lines with macros (@@)
2428
!
2529
!
30+
set (success,off);
2631
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
2732
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
2833
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -111,6 +116,12 @@ $DECK
111116
ERASE(match_pos);
112117
COPY_TEXT('bfd_vma ufile_ptr');
113118
ENDIF;
119+
match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
120+
IF match_pos <> 0 THEN;
121+
POSITION(BEGINNING_OF(match_pos));
122+
ERASE(match_pos);
123+
COPY_TEXT('0');
124+
ENDIF;
114125
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
115126
QUIT
116127
$ EOD
@@ -122,13 +133,15 @@ $ target = "vax"
122133
$!
123134
$! copy bfd-in2.h to bfd.h, replacing @ macros
124135
$!
136+
$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
125137
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
126138
[]bfd-in2.h /output=[]bfd.h
127139
$DECK
128140
!
129141
! Copy file, changing lines with macros (@@)
130142
!
131143
!
144+
set (success,off);
132145
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
133146
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
134147
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -186,17 +199,18 @@ $DECK
186199
$ EOD
187200
$endif
188201
$
189-
$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
190202
$!
191203
$! create bfdver.h
192204
$!
205+
$ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
193206
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
194207
[]version.h /output=[]bfdver.h
195208
$DECK
196209
!
197210
! Copy file, changing lines with macros (@@)
198211
!
199212
!
213+
set (success,off);
200214
vfile := CREATE_BUFFER("vfile", "configure.in");
201215
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
202216
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -241,11 +255,11 @@ $DECK
241255
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
242256
QUIT
243257
$ EOD
244-
$ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
245258
$!
246259
$!
247260
$! create targmatch.h
248261
$!
262+
$ write sys$output "Generate `targmatch.h'"
249263
$ open/write tfile []targmatch.h
250264
$ write tfile "{ """ + target + "-*-*vms*""" + ","
251265
$ write tfile "#if defined (SELECT_VECS)"
@@ -255,11 +269,11 @@ $ write tfile "UNSUPPORTED_TARGET"
255269
$ write tfile "#endif"
256270
$ write tfile "},"
257271
$ close tfile
258-
$ write sys$output "Generated `targmatch.h'"
259272
$!
260273
$!
261274
$! create config.h
262275
$!
276+
$ write sys$output "Generate `config.h'"
263277
$ create []config.h
264278
/* config.h-vms. Generated by hand by Klaus K�mpf, [email protected]. */
265279
/* config.in. Generated automatically from configure.in by autoheader. */
@@ -304,5 +318,88 @@ $ create []config.h
304318
/* Disable NLS */
305319
#undef ENABLE_NLS
306320
$!
307-
$ write sys$output "Generated `config.h'"
321+
$ write sys$output "Generate build.com"
322+
$!
323+
$ if ARCH.eqs."alpha"
324+
$ then
325+
$ create build.com
326+
$DECK
327+
$ DEFS="""SELECT_VECS=&vms_alpha_vec"","+-
328+
"""SELECT_ARCHITECTURES=&bfd_alpha_arch"""
329+
$ FILES="cpu-alpha,vms,vms-hdr,vms-gsd,vms-tir,vms-misc,"
330+
$EOD
331+
$ endif
332+
$ if ARCH.eqs."ia64"
333+
$ then
334+
$ create build.com
335+
$DECK
336+
$ DEFS="""SELECT_VECS=&bfd_elf64_ia64_vms_vec"","+-
337+
"""SELECT_ARCHITECTURES=&bfd_ia64_arch"""
338+
$ FILES="cpu-ia64,elf64-ia64,elf-strtab,corefile,stabs,merge,elf-eh-frame,"+-
339+
"elflink,elf-attrs,dwarf1,elf64,"
340+
$EOD
341+
$ create substxx.tpu
342+
$DECK
343+
set (success,off);
344+
file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
345+
found_range := CREATE_RANGE(BEGINNING_OF(file), BEGINNING_OF(file));
308346

347+
LOOP
348+
rang := CREATE_RANGE (END_OF(found_range),END_OF(file));
349+
match_pos := SEARCH_QUIETLY('NN', FORWARD, EXACT, rang);
350+
EXITIF match_pos = 0;
351+
POSITION(BEGINNING_OF(match_pos));
352+
ERASE(match_pos);
353+
COPY_TEXT('64');
354+
ENDLOOP;
355+
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
356+
QUIT
357+
$ EOD
358+
$ write sys$output "Generate elf64-ia64.c from elfxx-ia64.c"
359+
$ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
360+
[]elfXX-ia64.c /output=[]elf64-ia64.c
361+
$ write sys$output "Generate elf64-target.h from elfxx-target.h"
362+
$ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
363+
[]elfXX-target.h /output=[]elf64-target.h
364+
$ del substxx.tpu;*
365+
$ copy [.hosts]alphavms.h sysdep.h
366+
$ endif
367+
$ append sys$input build.com
368+
$DECK
369+
$ DEFS=DEFS + ",""unlink=remove"",""DEBUGDIR=""""GNU$DEBUGDIR:"""""""
370+
$ OPT="/noopt/debug"
371+
$ CFLAGS="/name=(as_is,shortened)" + -
372+
"/include=([],""../"",""../include"")" + -
373+
"/define=(" + DEFS + ")" + OPT
374+
$ FILES=FILES + "archive,archive64,archures,bfd,bfdio,binary,cache,coffgen,"+-
375+
"compress,corefile,dwarf2,elf,format,hash,ihex,init,libbfd,linker,"+-
376+
"opncls,reloc,section,simple,srec,stab-syms,syms,targets,tekhex,verilog"
377+
$ write sys$output "CFLAGS=",CFLAGS
378+
$ cflags_libbfd="/warning=(disable=missingreturn)"
379+
$ cflags_nil=""
380+
$ NUM = 0
381+
$ OBJS=""
382+
$ LOOP:
383+
$ F = F$ELEMENT(NUM,",",FILES)
384+
$ IF F.EQS."," THEN GOTO END
385+
$ eflags_name="cflags_''f'"
386+
$ name_len=f$length(eflags_name)
387+
$ dash_pos=f$locate("-",eflags_name)
388+
$ if dash_pos.ne.name_len
389+
$ then
390+
$ eflags_name['dash_pos,1]:="_"
391+
$ dash_pos=f$locate("-",eflags_name)
392+
$ if dash_pos.ne.name_len then eflags_name['dash_pos,1]:="_"
393+
$ endif
394+
$ if f$type('eflags_name).eqs."" then eflags_name="cflags_nil"
395+
$ eflags='eflags_name
396+
$ write sys$output "Compiling ", F, ".c", eflags
397+
$ cc 'CFLAGS 'eflags 'F.c
398+
$ IF OBJS.NES."" THEN OBJS=OBJS + ","
399+
$ OBJS=OBJS + F + ".obj"
400+
$ NUM = NUM + 1
401+
$ GOTO LOOP
402+
$ END:
403+
$ purge
404+
$ lib/create libbfd 'OBJS
405+
$EOD

bfd/elfxx-ia64.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6031,6 +6031,9 @@ elfNN_vms_close_and_cleanup (bfd *abfd)
60316031

60326032
#undef elf_backend_want_p_paddr_set_to_zero
60336033

6034+
#undef ELF_OSABI
6035+
#define ELF_OSABI ELFOSABI_OPENVMS
6036+
60346037
#undef ELF_MAXPAGESIZE
60356038
#define ELF_MAXPAGESIZE 0x10000 /* 64KB */
60366039

bfd/hosts/alphavms.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ typedef BFD_HOST_64_BIT int64_type;
6767
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
6868
#endif
6969

70-
extern int getpagesize PARAMS ((void));
70+
extern int getpagesize (void);
71+
extern char *stpcpy (char *, const char *);
7172

7273
/* No intl. */
7374
#define gettext(Msgid) (Msgid)

bfd/makefile.vms

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,49 @@
11
#
2-
# Makefile for bfd library under openVMS (Alpha and Vax)
2+
# Makefile for bfd library under openVMS
33
#
44
# For use with gnu-make for vms
55
#
66
# Created by Klaus K"ampf, [email protected]
77
#
88
#
99

10-
CC=cc
11-
10+
ifeq ($(ARCH),IA64)
11+
HOSTFILE=alphavms.h
12+
OBJS:=cpu-ia64.obj,elf64-ia64.obj,elf-strtab.obj,corefile.obj,stabs.obj,\
13+
merge.obj,elf-eh-frame.obj,elflink.obj,elf-attrs.obj,dwarf1.obj,elf64.obj
14+
DEFS=SELECT_VECS="&bfd_elf64_ia64_vms_vec",SELECT_ARCHITECTURES="&bfd_ia64_arch"
15+
endif
1216
ifeq ($(ARCH),ALPHA)
1317
HOSTFILE=alphavms.h
14-
TARGETOBJS = cpu-alpha.obj
15-
else
18+
OBJS:=vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,vms-misc.obj,cpu-alpha.obj
19+
DEFS=SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch"
20+
endif
21+
ifeq ($(ARCH),VAX)
1622
HOSTFILE=vaxvms.h
17-
TARGETOBJS = cpu-vax.obj
23+
OBJS:=vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,vms-misc.obj,cpu-vax.obj
24+
DEFS=SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch"
1825
endif
1926

20-
21-
OBJS=archive.obj,archive64.obj,archures.obj,bfd.obj,bfdio.obj,binary.obj,\
22-
cache.obj,coffgen.obj,compress.obj,corefile.obj,dwarf2.obj,elf.obj,\
23-
format.obj,hash.obj,ihex.obj,init.obj,libbfd.obj,linker.obj,opncls.obj,\
24-
reloc.obj,section.obj,simple.obj,srec.obj,stab-syms.obj,syms.obj,\
25-
targets.obj,tekhex.obj,verilog.obj,\
26-
vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,vms-misc.obj,$(TARGETOBJS)
27+
OBJS:=$(OBJS),archive.obj,archive64.obj,archures.obj,bfd.obj,bfdio.obj,\
28+
binary.obj,cache.obj,coffgen.obj,compress.obj,corefile.obj,dwarf2.obj,\
29+
elf.obj,format.obj,hash.obj,ihex.obj,init.obj,libbfd.obj,linker.obj,\
30+
opncls.obj,reloc.obj,section.obj,simple.obj,srec.obj,stab-syms.obj,\
31+
syms.obj,targets.obj,tekhex.obj,verilog.obj
2732

2833
ifeq ($(CC),gcc)
29-
ifeq ($(ARCH),ALPHA)
30-
DEFS=/define=(SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch",\
31-
"HAVE_vms_alpha_vec=1")
32-
else
33-
DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\
34-
"HAVE_vms_vax_vec=1")
35-
endif
3634
CFLAGS=/include=([],[-.include])$(DEFS)
3735
else
38-
ifeq ($(ARCH),ALPHA)
39-
DEFS=/define=(SELECT_VECS="&vms_alpha_vec",\
40-
SELECT_ARCHITECTURES="&bfd_alpha_arch",\
41-
"HAVE_vms_alpha_vec=1","unlink=remove","DEBUGDIR=NULL")
42-
else
43-
DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\
44-
"HAVE_vms_vax_vec=1","unlink=remove")
45-
endif
4636
OPT=/noopt/debug
47-
CFLAGS=/name=(as_is,shortened)/include=([],[-.include])$(DEFS)$(OPT)
37+
CFLAGS=/name=(as_is,shortened)/include=([],"../include")\
38+
/define=("unlink=remove",DEBUGDIR="""GNU$$DEBUGDIR:""",$(DEFS))$(OPT)
4839
endif
4940

50-
51-
libbfd.olb: sysdep.h bfd.h $(OBJS)
41+
libbfd.olb: $(OBJS)
5242
purge
5343
lib/create libbfd $(OBJS)
5444

55-
sysdep.h: [.hosts]$(HOSTFILE) config.h
56-
$(CP) $< $@
57-
58-
bfd.h: bfd-in2.h
59-
$$ @configure
60-
6145
targmatch.h: bfd.h
6246
config.h: bfd.h
63-
6447
vms.c: vms.h
6548
vms-mhd.c: vms.h
6649
vms-gsd.c: vms.h
@@ -71,8 +54,4 @@ targets.c: targmatch.h
7154
clean:
7255
$$ purge
7356
$(RM) libbfd.olb;
74-
$(RM) sysdep.h;
75-
$(RM) bfd.h;
76-
$(RM) targmatch.h;
77-
$(RM) config.h;
7857
$(RM) *.obj;

bfd/vms.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#ifdef VMS
2626
#include <rms.h>
27+
#include <unixlib.h>
2728
#include <starlet.h>
2829
#define RME$C_SETRFM 0x00000001
2930
#include <unistd.h>

0 commit comments

Comments
 (0)