Patches to G++ 1.37.2 for UNIX ISC 2.2 (386)
src at eliabel.sf.ca.us
src at eliabel.sf.ca.us
Sat Aug 18 16:28:32 AEST 1990
Those are the patches to G++ 1.37.2 built from the patched GCC 1.37.1
for ISC 2.2. G++ works fine under the GNU COFF system. Patches
to LIBG++ follow. GDB 3.6- whose patches have been posted supports
G++ 1.37.2.
Eric P. Meyer
ELIABEL Corp.
emeyer at eliabel.sf.ca.us
diff -pr src-g++/Makefile ../g++/Makefile
*** src-g++/Makefile Mon Aug 6 05:56:07 1990
--- ../g++/Makefile Tue Aug 7 22:56:15 1990
*************** CADILLAC_OBJS = cplus-cadillac.o ../cadi
*** 41,47 ****
# use `-dy'.
# On COFF systems, use one of the definitions below. (see collect.c)
! # COFFLAGS = -DUSE_COLLECT -DCOFF
# COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF
# On some BSD systems (like Vax, unlike Sun), there is no file
--- 41,47 ----
# use `-dy'.
# On COFF systems, use one of the definitions below. (see collect.c)
! COFFLAGS = -DUSE_COLLECT -DCOFF
# COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF
# On some BSD systems (like Vax, unlike Sun), there is no file
*************** CADILLAC_OBJS = cplus-cadillac.o ../cadi
*** 50,56 ****
# HAVE_UNISTD_H = -DNO_UNISTD_H
# CFLAGS = -g -DSOS -DESKIT -O
! CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -DFIELD_XREF
CC = gcc
BISON = bison
BISONFLAGS = -v # -d
--- 50,56 ----
# HAVE_UNISTD_H = -DNO_UNISTD_H
# CFLAGS = -g -DSOS -DESKIT -O
! CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -DFIELD_XREF -DUSG
CC = gcc
BISON = bison
BISONFLAGS = -v # -d
*************** BISONFLAGS = -v # -d
*** 57,65 ****
AR = ar
SHELL = /bin/sh
# on sysV, define this as cp.
! INSTALL = install -c
# on sysV, define this as ln.
! LINK = ln -s
# Compiler to use for compiling gnulib.
# OLDCC should not be the GNU C compiler.
--- 57,67 ----
AR = ar
SHELL = /bin/sh
# on sysV, define this as cp.
! #INSTALL = install -c
! INSTALL = cp
# on sysV, define this as ln.
! #LINK = ln -s
! LINK = ln
# Compiler to use for compiling gnulib.
# OLDCC should not be the GNU C compiler.
*************** TDIR = ../gcc-test
*** 128,134 ****
# But don't do that if compiling using GCC.
# If your system has alloca() in /lib/libPW.a, un-comment the following line:
! # CLIB= -lPW
# If your system's malloc() routine fails for any reason (as it does on
# certain versions of Genix), try getting the files
--- 130,136 ----
# But don't do that if compiling using GCC.
# If your system has alloca() in /lib/libPW.a, un-comment the following line:
! CLIB= -lPW
# If your system's malloc() routine fails for any reason (as it does on
# certain versions of Genix), try getting the files
*************** CPLUS_TREE_H = $(TREE_H) cplus-tree.h cp
*** 209,217 ****
# gnulib is not a target because a proper installation of GNU CC
# will place it where g++ can find it. Same with cpp
! all: crt1+.o g++ cc1plus ld++ g++filt # collect crt0+.o
# On COFF systems, use the target below.
! # all: g++ cc1plus collect # crt0+.o crt1+.o
doc: $(srcdir)/cpp.info $(srcdir)/g++.info
--- 211,219 ----
# gnulib is not a target because a proper installation of GNU CC
# will place it where g++ can find it. Same with cpp
! # all: crt1+.o g++ cc1plus ld++ g++filt # collect crt0+.o
# On COFF systems, use the target below.
! all: g++ cc1plus collect # crt0+.o crt1+.o
doc: $(srcdir)/cpp.info $(srcdir)/g++.info
diff -pr src-g++/collect.c ../g++/collect.c
*** src-g++/collect.c Sun Aug 5 21:12:52 1990
--- ../g++/collect.c Thu Aug 9 14:21:03 1990
*************** void pic_label_is_global () {return;};
*** 93,99 ****
#ifndef ASM_OUTPUT_INT_CONST
#define ASM_OUTPUT_INT_CONST(FILE,VALUE) \
! fprintf(FILE,"\t%s %d\n", ASM_INT_OP, VALUE)
#endif
#ifndef ASM_OUTPUT_LABELREF_AS_INT
--- 93,99 ----
#ifndef ASM_OUTPUT_INT_CONST
#define ASM_OUTPUT_INT_CONST(FILE,VALUE) \
! fprintf(FILE,"\t%s%d\n", ASM_INT_OP, VALUE)
#endif
#ifndef ASM_OUTPUT_LABELREF_AS_INT
*************** char *symbol_name;
*** 334,341 ****
ctor_chain_length++;
}
else {
! new->next = dtor_chain;
! dtor_chain = new;
dtor_chain_length++;
}
}
--- 334,349 ----
ctor_chain_length++;
}
else {
! new -> next = NULL;
! if ( dtor_chain == NULL )
! dtor_chain = new;
! else {
! struct ctor_dtor_list_elem *last = dtor_chain;
!
! while ( last -> next )
! last = last -> next;
! last -> next = new;
! }
dtor_chain_length++;
}
}
*************** output_ctor_dtor_table ()
*** 383,389 ****
dtor_chain = dtor_chain->next;
}
ASM_OUTPUT_INT_CONST (outfile, 0);
- ASM_OUTPUT_INT_CONST (outfile, 0);
fclose (outfile);
return OK;
--- 391,396 ----
*************** output_ctor_dtor_table ()
*** 399,404 ****
--- 406,433 ----
#include <ldfcn.h>
+ #ifdef DBX_IN_COFF
+ #if defined(sun386) || defined(sparc)
+ #define IS_DEBUG_SYMBOL(sym, type) (sym->n_zeroes == 0 && sym->n_dbxtype != 0)
+ #define TYPE_OF_DEBUG_SYMBOL(sym,type) (sym->n_dbxtype)
+ #else
+ #define IS_DEBUG_SYMBOL(sym, type) ( type && ( (type & 0xff00) == type))
+ #define TYPE_OF_DEBUG_SYMBOL(sym,type) (type>>8)
+ #endif
+ #endif
+
+ #ifdef i386
+ #define TEXT_SECTION 2
+ #endif
+
+ #ifndef TEXT_SECTION
+ # ifdef M_UNIX
+ # define TEXT_SECTION 2
+ # else
+ # define TEXT_SECTION 1
+ # endif
+ #endif
+
#if defined(EXTENDED_COFF)
# define GCC_SYMBOLS(X) (SYMHEADER(X).isymMax+SYMHEADER(X).iextMax)
# define GCC_SYMENT SYMR
*************** output_ctor_dtor_table ()
*** 407,416 ****
#else
# define GCC_SYMBOLS(X) (HEADER(ldptr).f_nsyms)
# define GCC_SYMENT SYMENT
! #ifndef UNUSUAL_COFF_DEFINITION
# define GCC_OK_SYMBOL(X) (!(((X).n_type & N_TMASK) != (DT_NON << N_BTSHFT)))
#else
! # define GCC_OK_SYMBOL(X) ((X).n_scnum == 1 && (X).n_sclass == C_EXT)
#endif
# define GCC_SYMINC(X) ((X).n_numaux+1)
#endif
--- 436,446 ----
#else
# define GCC_SYMBOLS(X) (HEADER(ldptr).f_nsyms)
# define GCC_SYMENT SYMENT
! #ifdef UNUSUAL_COFF_DEFINITION
# define GCC_OK_SYMBOL(X) (!(((X).n_type & N_TMASK) != (DT_NON << N_BTSHFT)))
#else
! # define GCC_OK_SYMBOL(X) \
! ((X).n_scnum == TEXT_SECTION && (X).n_sclass == C_EXT)
#endif
# define GCC_SYMINC(X) ((X).n_numaux+1)
#endif
diff -pr src-g++/cplus-dem.c ../g++/cplus-dem.c
*** src-g++/cplus-dem.c Tue Jun 26 04:26:15 1990
--- ../g++/cplus-dem.c Tue Aug 7 22:39:05 1990
***************
*** 49,55 ****
--- 49,57 ----
#include <ctype.h>
#ifdef USG
+ #ifndef i386
#include <memory.h>
+ #endif
#include <string.h>
#else
#include <strings.h>
diff -pr src-g++/cplus-field.c ../g++/cplus-field.c
*** src-g++/cplus-field.c Fri Jul 20 17:39:53 1990
--- ../g++/cplus-field.c Tue Aug 7 21:37:28 1990
*************** FIELD_xref_file(name)
*** 246,252 ****
--- 246,256 ----
all_files = xf;
if (wd_name == NULL) {
+ #ifdef USG
+ getcwd(wdbuf);
+ #else
getwd(wdbuf);
+ #endif
wd_name = SALLOC(wdbuf);
};
diff -pr src-g++/cplus-lex.c ../g++/cplus-lex.c
*** src-g++/cplus-lex.c Sun Aug 5 21:31:07 1990
--- ../g++/cplus-lex.c Tue Aug 7 21:37:03 1990
*************** void dump_data()
*** 1889,1895 ****
--- 1889,1899 ----
printf("\nDumping %s to %s...\n", dump_source_name, dump_file_name);
end_of_heap = (caddr_t)sbrk(0);
+ #ifdef USG
+ end_of_data = (caddr_t)((int)(&my_edata));
+ #else
end_of_data = (caddr_t)((int)(&my_edata)&~(getpagesize()-1));
+ #endif
data_size = (int)(end_of_heap-end_of_data);
printf("Data size = %d\n", data_size);
diff -pr src-g++/g++.texinfo ../g++/g++.texinfo
*** src-g++/g++.texinfo Fri Jun 29 16:32:00 1990
--- ../g++/g++.texinfo Tue Aug 14 09:20:15 1990
*************** void foo ()
*** 4594,4611 ****
@{
int *pval = new int [50];
X *pX = new (pval) X [50];
! // ...
! @}
! @end example
however, using the following syntax compiles correctly:
void foo ()
@{
int *pval = new int [50];
X *pX = new {pval} X [50];
! // ...
! @}
@end example
GNU C++ does not yet detect and warn about all possible misuses of
--- 4594,4610 ----
@{
int *pval = new int [50];
X *pX = new (pval) X [50];
! @};
! @end example
however, using the following syntax compiles correctly:
+ @example
void foo ()
@{
int *pval = new int [50];
X *pX = new {pval} X [50];
! @};
@end example
GNU C++ does not yet detect and warn about all possible misuses of
diff -pr src-g++/gcc.c ../g++/gcc.c
*** src-g++/gcc.c Sun Aug 5 21:33:47 1990
--- ../g++/gcc.c Thu Aug 9 12:54:43 1990
*************** struct compiler compilers[] =
*** 302,308 ****
requirements. */
char *collect_spec =
"%{!c:%{!M*:%{!E:%{!S:collect -o %g.s %g.R\n\
! as %g.s -o %g.O\n\
ld %{o*} %g.R %g.O\n\
}}}}";
--- 302,308 ----
requirements. */
char *collect_spec =
"%{!c:%{!M*:%{!E:%{!S:collect -o %g.s %g.R\n\
! as %a %g.s -o %g.O\n\
ld %{o*} %g.R %g.O\n\
}}}}";
*************** ld %{o*} %g.R %g.O\n\
*** 310,316 ****
char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld -r -o %g.R %l\
%{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
%{y*} %{!nostdlib:%S} \
! %{L*} %o %{!nostdlib:-lg++ gnulib%s %{g:-lg} %L}\n }}}}";
#else
/* Here is the spec for running the linker, after compiling all files. */
char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
--- 310,316 ----
char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld -r -o %g.R %l\
%{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
%{y*} %{!nostdlib:%S} \
! %{L*} %o %{!nostdlib:/u/lib/libg++.a gnulib%s %{g:-lg} %L}\n }}}}";
#else
/* Here is the spec for running the linker, after compiling all files. */
char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
diff -pr src-g++/make-links.g++ ../g++/make-links.g++
*** src-g++/make-links.g++ Thu Jun 21 07:43:01 1990
--- ../g++/make-links.g++ Tue Aug 7 20:38:16 1990
***************
*** 32,38 ****
if [ xx${DIR} = xx ]
then
! DIR="../gcc"
fi
if [ xx${CDIR} = xx ]
then
--- 32,38 ----
if [ xx${DIR} = xx ]
then
! DIR="../gcc-1.37.1"
fi
if [ xx${CDIR} = xx ]
then
*************** remove=rm
*** 44,50 ****
make_directory=mkdir
change_directory=cd
hard_link=ln
! symbolic_link='ln -s'
#for Test
#remove="echo rm"
--- 44,51 ----
make_directory=mkdir
change_directory=cd
hard_link=ln
! #symbolic_link='ln -s'
! symbolic_link='ln'
#for Test
#remove="echo rm"
diff -pr src-g++/toplev.c ../g++/toplev.c
*** src-g++/toplev.c Sun Aug 5 21:37:27 1990
--- ../g++/toplev.c Tue Aug 7 22:07:11 1990
*************** void undump_data (path, name)
*** 1978,1984 ****
--- 1978,1988 ----
file_size = lseek (file, 0L, SEEK_END);
brk ((char*)(&my_edata) + file_size);
+ #ifdef USG
+ data = (char *)((int)&my_edata);
+ #else
data = (char *)((int)&my_edata&~(getpagesize()-1));
+ #endif
if ((int)mmap (data, file_size, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, file, 0) < 0)
{
*************** void undump_data (path, name)
*** 2008,2014 ****
--- 2012,2022 ----
}
file_size = lseek(file, 0L, SEEK_END);
lseek(file, 0L, SEEK_SET);
+ #ifdef USG
+ brk((char*)((int)&my_edata) + file_size);
+ #else
brk((char*)((int)&my_edata&~(getpagesize()-1)) + file_size);
+ #endif
if (read (file, &my_edata, file_size) != file_size)
perror(name);
}
More information about the Comp.unix.i386
mailing list