Index: config/mh-interix =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/config/mh-interix,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 mh-interix --- config/mh-interix 28 May 2010 05:42:53 -0000 1.1.1.1 +++ config/mh-interix 28 May 2010 08:28:50 -0000 @@ -1,5 +1,6 @@ -# The shell may not be in /bin. -SHELL = sh +CFLAGS_FOR_BUILD = -g -O2 -D_ALL_SOURCE +CFLAGS = -g -O2 -D_ALL_SOURCE +BOOT_CFLAGS = -g -O2 -D_ALL_SOURCE # We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be # built without debugging information Index: gcc/config.gcc =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/config.gcc,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 config.gcc --- gcc/config.gcc 28 May 2010 05:43:59 -0000 1.1.1.1 +++ gcc/config.gcc 28 May 2010 08:28:50 -0000 @@ -1426,7 +1426,8 @@ i[34567]86-*-interix3*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h" tmake_file="${tmake_file} i386/t-interix" - extra_objs=winnt.o + extra_objs="winnt.o winnt-stubs.o" + cxx_target_objs=winnt-cxx.o target_gtfiles="\$(srcdir)/config/i386/winnt.c" if test x$enable_threads = xyes ; then thread_file='posix' Index: gcc/system.h =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/system.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 system.h --- gcc/system.h 28 May 2010 05:45:01 -0000 1.1.1.1 +++ gcc/system.h 28 May 2010 08:28:51 -0000 @@ -422,6 +422,7 @@ #include #endif +#ifndef __INTERIX /* If the system doesn't provide strsignal, we get it defined in libiberty but no declaration is supplied. */ #if !defined (HAVE_STRSIGNAL) \ @@ -430,6 +431,7 @@ extern const char *strsignal (int); # endif #endif +#endif #ifdef HAVE_GETRLIMIT # if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT Index: gcc/config/i386/i386-interix.h =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/config/i386/i386-interix.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 i386-interix.h --- gcc/config/i386/i386-interix.h 28 May 2010 05:45:52 -0000 1.1.1.1 +++ gcc/config/i386/i386-interix.h 28 May 2010 08:28:51 -0000 @@ -272,7 +272,9 @@ ld -r (specifically -rU). */ #define CTOR_LISTS_DEFINED_EXTERNALLY 1 +/* Enable alias attribute support. */ #define SET_ASM_OP "\t.set\t" + /* Output a definition (implements alias) */ #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ do \ @@ -325,6 +327,9 @@ differently depending on something about the variable or function named by the symbol (such as what section it is in). */ +#undef TARGET_ENCODE_SECTION_INFO +#undef SUBTARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info #define SUBTARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info #undef TARGET_STRIP_NAME_ENCODING #define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full @@ -360,3 +365,44 @@ #define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \ (TYPE_MODE (TYPE) == BLKmode \ || (AGGREGATE_TYPE_P (TYPE) && int_size_in_bytes (TYPE) > 8 )) + +/* Select attributes for named sections. */ +#define TARGET_SECTION_TYPE_FLAGS i386_pe_section_type_flags + +/* Write the extra assembler code needed to declare a function + properly. If we are generating SDB debugging information, this + will happen automatically, so we only need to handle other cases. */ +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do \ + { \ + if (write_symbols != SDB_DEBUG) \ + i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + } \ + while (0) + +/* Add an external function to the list of functions to be declared at + the end of the file. */ +#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ + do \ + { \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + i386_pe_record_external_function (DECL, NAME); \ + } \ + while (0) + +/* Declare the type properly for any external libcall. */ +#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ + i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) + +/* This says out to put a global symbol in the BSS section. */ +#undef ASM_OUTPUT_ALIGNED_BSS +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ + asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) + +/* External function declarations. */ +extern void i386_pe_record_external_function PARAMS ((tree, const char *)); +extern void i386_pe_declare_function_type PARAMS ((FILE *, const char *, int)); +extern void i386_pe_record_exported_symbol PARAMS ((const char *, int)); +extern void i386_pe_asm_file_end PARAMS ((FILE *)); Index: gcc/config/i386/t-interix =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/config/i386/t-interix,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 t-interix --- gcc/config/i386/t-interix 28 May 2010 05:46:02 -0000 1.1.1.1 +++ gcc/config/i386/t-interix 28 May 2010 08:28:51 -0000 @@ -6,3 +6,15 @@ $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/i386/winnt.c + +winnt-cxx.o: $(srcdir)/config/i386/winnt-cxx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(COMPILER) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/winnt-cxx.c + +winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(COMPILER) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/winnt-stubs.c