discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Incomplete Linux patch for gcc3


From: Lars Sonchocky-Helldorf
Subject: Incomplete Linux patch for gcc3
Date: Wed, 20 Mar 2002 12:51:26 +0100

Could be interesting to some of you: patch for Apples gcc3.1 to build it 
on Linux:

----- Forwarded by Lars Sonchocky-Helldorf/BBDO-InterOne/DE on 20.03.2002 
12:52 -----


Stan Shebs <shebs@apple.com>
Sent by: owner-darwin-gcc3@opensource.apple.com
20.03.2002 07:24

 
        To:     darwin-gcc3@opensource.apple.com
        cc: 
        Subject:        Incomplete Linux patch for gcc3

I was hoping to have this all committed before going on vacation,
but the gcc3 sources still fail to bootstrap on Linux - current
problem is __strcpy_small that should get inlined usually, but
doesn't, so stage2 tools won't link.

Anywhere, feel free to play with these, once the anoncvs has been
kicked (mail is in to Dave Z about this).  They won't necessarily
get checked in exactly as you see here, of course, you may need to
do cleanup in the future.

Stan

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/Makefile.in,v
retrieving revision 1.111
diff -p -r1.111 Makefile.in
*** Makefile.in          2002/03/14 07:28:40             1.111
--- Makefile.in          2002/03/20 06:02:37
*************** MALLOC_RENAMES = -Dszone_check_counter=p
*** 1781,1787 ****
  pfe/pfe.o: $(PFE_DIR)/pfe.c $(PFE_H) $(PFE_MEM_H) \
     $(GCONFIG_H) $(SYSTEM_H) $(PFE_HEADER_H) $(TIMEVAR_H) $(TM_P_H) \
     $(MACHMODE_H) langhooks.h
!                $(CC) -c $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H  \
                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                 -DUSE_APPLE_SCALABLE_MALLOC=$(USE_SCALABLE_MALLOC) \
                 $(INCLUDES) -I$(PFE_DIR)/memmgr $(MALLOC_RENAMES) \
--- 1781,1787 ----
  pfe/pfe.o: $(PFE_DIR)/pfe.c $(PFE_H) $(PFE_MEM_H) \
     $(GCONFIG_H) $(SYSTEM_H) $(PFE_HEADER_H) $(TIMEVAR_H) $(TM_P_H) \
     $(MACHMODE_H) langhooks.h
!                $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) 
-DHAVE_CONFIG_H  \
                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                 -DUSE_APPLE_SCALABLE_MALLOC=$(USE_SCALABLE_MALLOC) \
                 $(INCLUDES) -I$(PFE_DIR)/memmgr $(MALLOC_RENAMES) \
*************** pfe/memmgr/scalable_malloc.o: $(PFE_DIR)
*** 1794,1800 ****
     $(PFE_DIR)/memmgr/posix_sched.h \
     $(PFE_H) \
     $(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H \
                                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                                 $(INCLUDES) -I$(PFE_DIR)/memmgr 
$(MALLOC_RENAMES) \
                                 $(PFE_DIR)/memmgr/scalable_malloc.c -o 
pfe/memmgr/scalable_malloc.o
--- 1794,1800 ----
     $(PFE_DIR)/memmgr/posix_sched.h \
     $(PFE_H) \
     $(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) 
-DHAVE_CONFIG_H \
                                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                                 $(INCLUDES) -I$(PFE_DIR)/memmgr 
$(MALLOC_RENAMES) \
                                 $(PFE_DIR)/memmgr/scalable_malloc.c -o 
pfe/memmgr/scalable_malloc.o
*************** pfe/memmgr/scalable_malloc.o: $(PFE_DIR)
*** 1802,1814 ****
  pfe/pfe-mem.o: $(PFE_DIR)/pfe-mem.c \
     $(PFE_DIR)/pfe-mem.h \
     $(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H \
                                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                                 $(INCLUDES) $(MALLOC_RENAMES) \
                                 $(PFE_DIR)/pfe-mem.c -o pfe/pfe-mem.o
 
  pfe/stub-pfe.o: $(PFE_DIR)/stub-pfe.c $(PFE_H) $(PFE_HEADER_H) 
$(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H  \
                 $(ALL_CPPFLAGS) -DGENERATOR_FILE $(INCLUDES) \
                                 $(PFE_DIR)/stub-pfe.c -o pfe/stub-pfe.o
 
--- 1802,1814 ----
  pfe/pfe-mem.o: $(PFE_DIR)/pfe-mem.c \
     $(PFE_DIR)/pfe-mem.h \
     $(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) 
-DHAVE_CONFIG_H \
                                 $(ALL_CPPFLAGS) -DGENERATOR_FILE \
                                 $(INCLUDES) $(MALLOC_RENAMES) \
                                 $(PFE_DIR)/pfe-mem.c -o pfe/pfe-mem.o
 
  pfe/stub-pfe.o: $(PFE_DIR)/stub-pfe.c $(PFE_H) $(PFE_HEADER_H) 
$(GCONFIG_H) $(SYSTEM_H)
!                $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) 
-DHAVE_CONFIG_H  \
                 $(ALL_CPPFLAGS) -DGENERATOR_FILE $(INCLUDES) \
                                 $(PFE_DIR)/stub-pfe.c -o pfe/stub-pfe.o
 
Index: gcc/configure
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/configure,v
retrieving revision 1.52
diff -p -r1.52 configure
*** configure            2002/03/19 19:04:47             1.52
--- configure            2002/03/20 06:02:39
*************** EOF
*** 2098,2104 ****
  fi
 
  # Find some useful tools
! for ac_prog in mawk gawk nawk awk
  do
  # Extract the first word of "$ac_prog", so it can be a program name with 
args.
  set dummy $ac_prog; ac_word=$2
--- 2098,2104 ----
  fi
 
  # Find some useful tools
! for ac_prog in gawk mawk nawk awk
  do
  # Extract the first word of "$ac_prog", so it can be a program name with 
args.
  set dummy $ac_prog; ac_word=$2
Index: gcc/crtstuff.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/crtstuff.c,v
retrieving revision 1.14
diff -p -r1.14 crtstuff.c
*** crtstuff.c           2002/03/14 07:28:50             1.14
--- crtstuff.c           2002/03/20 06:02:40
*************** __do_global_dtors_aux (void)
*** 446,465 ****
  }
 
  /* Stick a call to __do_global_dtors_aux into the .fini section.  */
- 
  CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux)
 
- static void __attribute__ ((__unused__))
- fini_dummy (void)
- {
-   asm (FINI_SECTION_ASM_OP);
-   CRT_CALL_STATIC_FUNCTION (__do_global_dtors_aux);
- #ifdef FORCE_FINI_SECTION_ALIGN
-   FORCE_FINI_SECTION_ALIGN;
- #endif
-   asm (TEXT_SECTION_ASM_OP);
- }
- 
  #if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
  /* Stick a call to __register_frame_info into the .init section.  For 
some
     reason calls with no arguments work more reliably in .init, so stick 
the
--- 446,453 ----
*************** __dereg_frame_dtor (void)
*** 772,779 ****
  }
 
  /* Terminate the frame section with a final zero.  */
! 
! STATIC int __gcc3_EH_FRAME_END__[]
       __attribute__ ((unused, mode(SI), section(EH_FRAME_SECTION_NAME),
                                      aligned(4)))
       = { 0 };
--- 760,766 ----
  }
 
  /* Terminate the frame section with a final zero.  */
! STATIC int __FRAME_END__[]
       __attribute__ ((unused, mode(SI), section(EH_FRAME_SECTION_NAME),
                                      aligned(4)))
       = { 0 };
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/dwarf2out.c,v
retrieving revision 1.29
diff -p -r1.29 dwarf2out.c
*** dwarf2out.c          2002/03/14 07:28:52             1.29
--- dwarf2out.c          2002/03/20 06:02:46
*************** dwarf2out_frame_debug_expr (expr, label)
*** 1773,1781 ****
        break;
 
      default:
!       /* APPLE LOCAL AltiVec shenanigans (VRsave)  */
        if (GET_CODE (dest) == UNSPEC_VOLATILE && flag_altivec)
                 return;
        abort ();
      }
  }
--- 1773,1784 ----
        break;
 
      default:
!       /* APPLE LOCAL begin AltiVec shenanigans (VRsave)  */
! #ifdef TARGET_ALTIVEC
        if (GET_CODE (dest) == UNSPEC_VOLATILE && flag_altivec)
                 return;
+ #endif
+       /* APPLE LOCAL end AltiVec shenanigans (VRsave)  */
        abort ();
      }
  }
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/gcc.c,v
retrieving revision 1.108
diff -p -r1.108 gcc.c
*** gcc.c                2002/03/19 18:49:57             1.108
--- gcc.c                2002/03/20 06:02:50
*************** static const char *cc1_options =
*** 820,826 ****
 
  static const char *asm_options =
  /* APPLE LOCAL fat builds */
! "%a %Y -arch %T %{@:-o %f%u%O}%{!@:%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o 
%d%w%u%O}}";
 
  static const char *invoke_as =
  "%{!S:-o %{|!pipe:%g.s} |\n as %(asm_options) %{!pipe:%g.s} %A }";
--- 820,826 ----
 
  static const char *asm_options =
  /* APPLE LOCAL fat builds */
! "%a %Y %{@:-o %f%u%O}%{!@:%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o 
%d%w%u%O}}";
 
  static const char *invoke_as =
  "%{!S:-o %{|!pipe:%g.s} |\n as %(asm_options) %{!pipe:%g.s} %A }";
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 5121,5130 ****
                     {
                                   char *tmpstr = xmalloc (strlen 
(STANDARD_EXEC_PREFIX) 
                                                 + strlen 
(DEFAULT_TARGET_VERSION) 
!                                                + strlen 
(DEFAULT_TARGET_MACHINE) + 25);
                                   char *header_path = xmalloc (strlen 
(STANDARD_EXEC_PREFIX) 
                                                 + strlen 
(DEFAULT_TARGET_VERSION) 
!                                                + strlen 
(DEFAULT_TARGET_MACHINE) + 25);
                                   do_spec_1 ("-isystem", 1, NULL);
                                   /* Make this a separate argument.  */
                                   do_spec_1 (" ", 0, NULL);
--- 5121,5130 ----
                     {
                                   char *tmpstr = xmalloc (strlen 
(STANDARD_EXEC_PREFIX) 
                                                 + strlen 
(DEFAULT_TARGET_VERSION) 
!                                                + strlen 
(DEFAULT_TARGET_MACHINE) + 1000);
                                   char *header_path = xmalloc (strlen 
(STANDARD_EXEC_PREFIX) 
                                                 + strlen 
(DEFAULT_TARGET_VERSION) 
!                                                + strlen 
(DEFAULT_TARGET_MACHINE) + 1000);
                                   do_spec_1 ("-isystem", 1, NULL);
                                   /* Make this a separate argument.  */
                                   do_spec_1 (" ", 0, NULL);
*************** main (argc, argv)
*** 6686,6691 ****
--- 6686,6695 ----
 
        notice ("Thread model: %s\n", thrmod);
        /* APPLE LOCAL begin Apple banner 2002-01-29 sts */
+ #ifndef APPLE_CC
+ #define APPLE_CC 999
+ #define REALLY_STRINGIFY(X) "999"
+ #endif
        notice ("Apple Computer, Inc. GCC version %s, based on ",
                       REALLY_STRINGIFY (APPLE_CC));
        /* APPLE LOCAL end Apple banner 2002-01-29 sts */
Index: gcc/stor-layout.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/stor-layout.c,v
retrieving revision 1.24
diff -p -r1.24 stor-layout.c
*** stor-layout.c                2002/03/14 07:29:06             1.24
--- stor-layout.c                2002/03/20 06:02:51
*************** place_field (rli, field)
*** 936,942 ****
--- 936,944 ----
        && ! DECL_PACKED (field)
        && maximum_field_alignment == 0
  /* APPLE LOCAL begin Macintosh alignment 2002-2-12 ff */
+ #ifdef PEG_ALIGN_FOR_MAC68K
        && ! TARGET_ALIGN_MAC68K
+ #endif
  /* APPLE LOCAL end Macintosh alignment 2002-2-12 ff */
        && ! integer_zerop (DECL_SIZE (field))
        && host_integerp (DECL_SIZE (field), 1)
Index: gcc/toplev.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/toplev.c,v
retrieving revision 1.114
diff -p -r1.114 toplev.c
*** toplev.c             2002/03/14 07:29:07             1.114
--- toplev.c             2002/03/20 06:02:54
*************** struct env_overrides {
*** 1626,1634 ****
  #define env_ovr_has_arg 2
  #define env_ovr_add_arg 4
  #define env_over_no_msg 8
! static struct env_overrides *override_options;
  static int n_overrides = 0;
! static int override_options_max = 0;
  static int have_added_opts = 0;
  static int add_env_opts = 0;
  static int env_ovr_confirm = 1;
--- 1626,1634 ----
  #define env_ovr_has_arg 2
  #define env_ovr_add_arg 4
  #define env_over_no_msg 8
! static struct env_overrides *env_override_options;
  static int n_overrides = 0;
! static int env_override_options_max = 0;
  static int have_added_opts = 0;
  static int add_env_opts = 0;
  static int env_ovr_confirm = 1;
*************** extract_override_options ()
*** 5771,5797 ****
                                   added_flag = have_added_opts;
                                 }
 
!                      if (n_overrides >= override_options_max)
                                 {
!                                  override_options_max += 6;
!                                  override_options = (struct 
env_overrides *) 
! xrealloc (override_options,
                 sizeof (struct env_overrides) 
!                * override_options_max);
                                   if (n_overrides == 0) /* match argv[] 
counting */
                                     ++n_overrides;
                                 }
 
                       if (!has_arg && p[0] == '-' && p[1] == '-')
                                 {
!                                  override_options[n_overrides].flags = 
env_ovr_has_arg | added_flag;
!                                  override_options[n_overrides].option = 
p + 1;
                                   has_arg = 1;
                                 }
                       else
                                 {
!                                  override_options[n_overrides].flags = 
added_flag;
!                                  override_options[n_overrides].option = 
p--;
                                   has_arg = 0;
                                 }
 
--- 5771,5797 ----
                                   added_flag = have_added_opts;
                                 }
 
!                      if (n_overrides >= env_override_options_max)
                                 {
!                                  env_override_options_max += 6;
!                                  env_override_options = (struct 
env_overrides *) 
! xrealloc (env_override_options,
                 sizeof (struct env_overrides) 
!                * env_override_options_max);
                                   if (n_overrides == 0) /* match argv[] 
counting */
                                     ++n_overrides;
                                 }
 
                       if (!has_arg && p[0] == '-' && p[1] == '-')
                                 {
!                                  env_override_options[n_overrides].flags 
= env_ovr_has_arg | added_flag;
! env_override_options[n_overrides].option = p + 1;
                                   has_arg = 1;
                                 }
                       else
                                 {
!                                  env_override_options[n_overrides].flags 
= added_flag;
! env_override_options[n_overrides].option = p--;
                                   has_arg = 0;
                                 }
 
*************** override_option (i, argc, argv)
*** 5899,5920 ****
 
    if (add_env_opts)
      {
!       if ((override_options[i].flags & env_ovr_add_arg) == 0
!           || (override_options[i].flags & env_ovr_used) != 0
!           || override_options[i].option == NULL)
          return 0;
!       argv[i] = override_options[i].option;
!       if (override_options[i].flags & env_ovr_has_arg)
          {
!                  argv[i+1] = override_options[i+1].option;
                   if (env_ovr_confirm
!                      && (override_options[i].flags & env_over_no_msg) == 
0)
                     fprintf (stderr, 
                                      "### QA_OVERRIDE_GCC3_OPTIONS: 
Adding command line option '%s %s'\n",
                                      argv[i], argv[i+1]);
                 }
        else if (env_ovr_confirm
!                && (override_options[i].flags & env_over_no_msg) == 0)
                 fprintf (stderr, "### QA_OVERRIDE_GCC3_OPTIONS: Adding 
command line option '%s'\n",
                                  argv[i]);
        return 1;
--- 5899,5920 ----
 
    if (add_env_opts)
      {
!       if ((env_override_options[i].flags & env_ovr_add_arg) == 0
!           || (env_override_options[i].flags & env_ovr_used) != 0
!           || env_override_options[i].option == NULL)
          return 0;
!       argv[i] = env_override_options[i].option;
!       if (env_override_options[i].flags & env_ovr_has_arg)
          {
!                  argv[i+1] = env_override_options[i+1].option;
                   if (env_ovr_confirm
!                      && (env_override_options[i].flags & 
env_over_no_msg) == 0)
                     fprintf (stderr, 
                                      "### QA_OVERRIDE_GCC3_OPTIONS: 
Adding command line option '%s %s'\n",
                                      argv[i], argv[i+1]);
                 }
        else if (env_ovr_confirm
!                && (env_override_options[i].flags & env_over_no_msg) == 
0)
                 fprintf (stderr, "### QA_OVERRIDE_GCC3_OPTIONS: Adding 
command line option '%s'\n",
                                  argv[i]);
        return 1;
*************** override_option (i, argc, argv)
*** 5939,5945 ****
 
    for (j = 1; j < n_overrides; ++j)
      {
!       p = override_options[j].option;
        letter_opt2 = 0;
        s = 0;
        parg = 0;
--- 5939,5945 ----
 
    for (j = 1; j < n_overrides; ++j)
      {
!       p = env_override_options[j].option;
        letter_opt2 = 0;
        s = 0;
        parg = 0;
*************** override_option (i, argc, argv)
*** 5973,5980 ****
        if (strcmp (p, opt) == 0 && letter_opt1 == letter_opt2)
          {
            if (i < argc - 1 
!               && (override_options[j].flags & env_ovr_has_arg))
!             argv[i + 1] = override_options[j + 1].option;
 
                   if (s)
                     {
--- 5973,5980 ----
        if (strcmp (p, opt) == 0 && letter_opt1 == letter_opt2)
          {
            if (i < argc - 1 
!               && (env_override_options[j].flags & env_ovr_has_arg))
!             argv[i + 1] = env_override_options[j + 1].option;
 
                   if (s)
                     {
*************** override_option (i, argc, argv)
*** 6007,6013 ****
                                                   || strcmp (argv[i+1], 
rep_arg) == 0)
                                                 {
                                                   if (env_ovr_confirm
!                                                      && 
(override_options[j].flags & env_ovr_used) == 0)
 fprintf (stderr, 
       "### QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s 
%s' with '%s %s'\n",
        argv[i], argv[i + 1], rep_option, rep_arg);
--- 6007,6013 ----
                                                   || strcmp (argv[i+1], 
rep_arg) == 0)
                                                 {
                                                   if (env_ovr_confirm
!                                                      && 
(env_override_options[j].flags & env_ovr_used) == 0)
 fprintf (stderr, 
       "### QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s 
%s' with '%s %s'\n",
        argv[i], argv[i + 1], rep_option, rep_arg);
*************** override_option (i, argc, argv)
*** 6018,6024 ****
                                           else  /* s/--opt/rep_option/    
                 */
                                             {
                                               if (env_ovr_confirm
!                                                  && 
(override_options[j].flags & env_ovr_used) == 0)
                                                                 fprintf 
(stderr, 
   "### QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s %s' 
with '%s'\n",
    argv[i], argv[i + 1], rep_option);
--- 6018,6024 ----
                                           else  /* s/--opt/rep_option/    
                 */
                                             {
                                               if (env_ovr_confirm
!                                                  && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                                                 fprintf 
(stderr, 
   "### QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s %s' 
with '%s'\n",
    argv[i], argv[i + 1], rep_option);
*************** override_option (i, argc, argv)
*** 6029,6059 ****
                                       else if (reparg)  /* 
s/-opt/rep_option rep_arg/                               */
                                         {
                                           if (env_ovr_confirm
!                                              && 
(override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, 
                                                                      "### 
QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s' with '%s 
%s'\n",
 argv[i], rep_option, rep_arg);
!                                                  if (n_overrides+1 >= 
override_options_max)
                                                     {
! override_options_max += 6;
!                                                      override_options = 
(struct env_overrides *) 
!                  xrealloc (override_options,
                                     sizeof (struct env_overrides) 
!                                    * override_options_max);
                                                       if (n_overrides == 
0) /* match argv[] counting */
 ++n_overrides;
                                                     }
! override_options[n_overrides  ].option = rep_option;
! override_options[n_overrides++].flags  = env_ovr_has_arg | 
env_ovr_add_arg | env_over_no_msg;
! override_options[n_overrides  ].option = rep_arg;
! override_options[n_overrides++].flags  = env_ovr_add_arg | 
env_over_no_msg;
                                                     argv[i] = NULL;
                                                     have_added_opts = 1;
                                         }
                                       else if (strcmp (argv[i], 
rep_option) != 0) /* s/-opt/rep_option/                          */
                                         {
                                           if (env_ovr_confirm
!                                              && 
(override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, 
                                                                      "### 
QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s' with '%s'\n",
 argv[i], rep_option);
--- 6029,6059 ----
                                       else if (reparg)  /* 
s/-opt/rep_option rep_arg/                               */
                                         {
                                           if (env_ovr_confirm
!                                              && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, 
                                                                      "### 
QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s' with '%s 
%s'\n",
 argv[i], rep_option, rep_arg);
!                                                  if (n_overrides+1 >= 
env_override_options_max)
                                                     {
! env_override_options_max += 6;
! env_override_options = (struct env_overrides *) 
!                  xrealloc (env_override_options,
                                     sizeof (struct env_overrides) 
!                                    * env_override_options_max);
                                                       if (n_overrides == 
0) /* match argv[] counting */
 ++n_overrides;
                                                     }
! env_override_options[n_overrides  ].option = rep_option;
! env_override_options[n_overrides++].flags  = env_ovr_has_arg | 
env_ovr_add_arg | env_over_no_msg;
! env_override_options[n_overrides  ].option = rep_arg;
! env_override_options[n_overrides++].flags  = env_ovr_add_arg | 
env_over_no_msg;
                                                     argv[i] = NULL;
                                                     have_added_opts = 1;
                                         }
                                       else if (strcmp (argv[i], 
rep_option) != 0) /* s/-opt/rep_option/                          */
                                         {
                                           if (env_ovr_confirm
!                                              && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, 
                                                                      "### 
QA_OVERRIDE_GCC3_OPTIONS: Replacing command line option '%s' with '%s'\n",
 argv[i], rep_option);
*************** override_option (i, argc, argv)
*** 6063,6096 ****
                                   else
                                     {
                                       if (env_ovr_confirm
!                                          && (override_options[j].flags & 
env_ovr_used) == 0)
                                                 fprintf (stderr, "### 
QA_OVERRIDE_GCC3_OPTIONS: Deleting command line option '%s", argv[i]);
                                       if (parg)
                                         {
                                                   if (env_ovr_confirm
!                                                      && 
(override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, " 
%s", argv[i + 1]);
                                                   argv[i + 1] = NULL;
                                                 }
                                       if (env_ovr_confirm
!                                                  && 
(override_options[j].flags & env_ovr_used) == 0)
                                         fputs ("'\n", stderr);
                                       argv[i] = NULL;
                                     }
                                 }
                       *(repopt-1) = s;
!                      override_options[j].flags |= env_ovr_used;
                       return argv[i] != NULL;
                     }
!                  else if (strcmp (argv[i], override_options[j].option) 
!= 0)
                     {
                       if (env_ovr_confirm
!                          && (override_options[j].flags & env_ovr_used) 
== 0)
                                 fprintf (stderr, 
                                                  "### 
QA_OVERRIDE_GCC3_OPTIONS: Overriding command line option '%s' with 
'%s'\n",
!                                                 argv[i], 
override_options[j].option);
!                      argv[i] = override_options[j].option;
!                      override_options[j].flags |= env_ovr_used;
                       return 1;
                     }
                 }
--- 6063,6096 ----
                                   else
                                     {
                                       if (env_ovr_confirm
!                                          && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                                 fprintf (stderr, "### 
QA_OVERRIDE_GCC3_OPTIONS: Deleting command line option '%s", argv[i]);
                                       if (parg)
                                         {
                                                   if (env_ovr_confirm
!                                                      && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                                     fprintf (stderr, " 
%s", argv[i + 1]);
                                                   argv[i + 1] = NULL;
                                                 }
                                       if (env_ovr_confirm
!                                                  && 
(env_override_options[j].flags & env_ovr_used) == 0)
                                         fputs ("'\n", stderr);
                                       argv[i] = NULL;
                                     }
                                 }
                       *(repopt-1) = s;
!                      env_override_options[j].flags |= env_ovr_used;
                       return argv[i] != NULL;
                     }
!                  else if (strcmp (argv[i], 
env_override_options[j].option) != 0)
                     {
                       if (env_ovr_confirm
!                          && (env_override_options[j].flags & 
env_ovr_used) == 0)
                                 fprintf (stderr, 
                                                  "### 
QA_OVERRIDE_GCC3_OPTIONS: Overriding command line option '%s' with 
'%s'\n",
!                                                 argv[i], 
env_override_options[j].option);
!                      argv[i] = env_override_options[j].option;
!                      env_override_options[j].flags |= env_ovr_used;
                       return 1;
                     }
                 }
*************** override_option (i, argc, argv)
*** 6105,6111 ****
     to see if QA_OVERRIDE_GCC3_OPTIONS specified any options to be
     added.  If there are we will return 1 to cause another option
     processing pass.  But this time argc and argv will be set to use
!    the override_options[] array and then only to select the added
     options.  */
 
  static int
--- 6105,6111 ----
     to see if QA_OVERRIDE_GCC3_OPTIONS specified any options to be
     added.  If there are we will return 1 to cause another option
     processing pass.  But this time argc and argv will be set to use
!    the env_override_options[] array and then only to select the added
     options.  */
 
  static int
Index: gcc/tree-inline.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/tree-inline.c,v
retrieving revision 1.19
diff -p -r1.19 tree-inline.c
*** tree-inline.c                2002/03/14 08:46:19             1.19
--- tree-inline.c                2002/03/20 06:02:56
*************** expand_call_inline (tp, walk_subtrees, d
*** 856,862 ****
    st = id->decl_map;
    id->decl_map = splay_tree_new (splay_tree_compare_pointers,
                                                                  NULL, 
NULL);
- 
    /* APPLE LOCAL Altivec */
    actparms = TREE_OPERAND (t, 1);
    if (TREE_ASM_WRITTEN (fn) || DECL_SAVED_INSNS (fn))
--- 856,861 ----
Index: gcc/config/i386/i386.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/config/i386/i386.c,v
retrieving revision 1.19
diff -p -r1.19 i386.c
*** i386.c               2002/03/14 07:30:15             1.19
--- i386.c               2002/03/20 06:03:03
*************** Boston, MA 02111-1307, USA.  */
*** 43,48 ****
--- 43,50 ----
  #include "target.h"
  #include "target-def.h"
 
+ #undef TARGET_MACHO
+ 
  #ifndef CHECK_STACK_LIMIT
  #define CHECK_STACK_LIMIT (-1)
  #endif
*************** override_options ()
*** 1196,1202 ****
    }
 
    /* APPLE LOCAL darwin x86  */
! #if TARGET_MACHO
    machopic_add_gc_roots ();
  #endif
  }
--- 1198,1204 ----
    }
 
    /* APPLE LOCAL darwin x86  */
! #ifdef TARGET_MACHO
    machopic_add_gc_roots ();
  #endif
  }
*************** legitimate_pic_address_disp_p (disp)
*** 4693,4698 ****
--- 4695,4701 ----
      }
 
    /* APPLE LOCAL begin darwin x86  */
+ #ifdef TARGET_MACHO
    /* Allow {LABEL | SYMBOL}_REF - SYMBOL_REF-FOR-PICBASE for mach-o.  */
    if (TARGET_MACHO && GET_CODE (disp) == MINUS)
      {
*************** legitimate_pic_address_disp_p (disp)
*** 4705,4710 ****
--- 4708,4714 ----
                       return 1;
                   }
      }
+ #endif /* TARGET_MACHO */
    /* APPLE LOCAL end darwin x86  */
 
    if (GET_CODE (disp) != UNSPEC
*************** legitimate_address_p (mode, addr, strict
*** 4869,4875 ****
                 }
 
        if (flag_pic && (SYMBOLIC_CONST (disp)
! #if TARGET_MACHO
                                        && !machopic_operand_p (disp)
  #endif
                                        ))
--- 4873,4879 ----
                 }
 
        if (flag_pic && (SYMBOLIC_CONST (disp)
! #ifdef TARGET_MACHO
                                        && !machopic_operand_p (disp)
  #endif
                                        ))
*************** output_pic_addr_const (file, x, code)
*** 5315,5321 ****
      case SYMBOL_REF:
        assemble_name (file, XSTR (x, 0));
    /* APPLE LOCAL darwin x86 */
! #if !TARGET_MACHO
        if (code == 'P' && ! SYMBOL_REF_FLAG (x))
                 fputs ("@PLT", file);
  #endif
--- 5319,5325 ----
      case SYMBOL_REF:
        assemble_name (file, XSTR (x, 0));
    /* APPLE LOCAL darwin x86 */
! #ifndef TARGET_MACHO
        if (code == 'P' && ! SYMBOL_REF_FLAG (x))
                 fputs ("@PLT", file);
  #endif
*************** output_pic_addr_const (file, x, code)
*** 5376,5382 ****
 
      case MINUS:
        /* APPLE LOCAL darwin x86 */
! #if !TARGET_MACHO
        putc (ASSEMBLER_DIALECT == ASM_INTEL ? '(' : '[', file);
        /* APPLE LOCAL darwin x86 */
  #endif
--- 5380,5386 ----
 
      case MINUS:
        /* APPLE LOCAL darwin x86 */
! #ifndef TARGET_MACHO
        putc (ASSEMBLER_DIALECT == ASM_INTEL ? '(' : '[', file);
        /* APPLE LOCAL darwin x86 */
  #endif
*************** output_pic_addr_const (file, x, code)
*** 5384,5397 ****
        putc ('-', file);
        output_pic_addr_const (file, XEXP (x, 1), code);
        /* APPLE LOCAL darwin x86 */
! #if !TARGET_MACHO
        putc (ASSEMBLER_DIALECT == ASM_INTEL ? ')' : ']', file);
        /* APPLE LOCAL darwin x86 */
  #endif
        break;
 
        /* APPLE LOCAL darwin x86 */
! #if !TARGET_MACHO
       case UNSPEC:
         if (XVECLEN (x, 0) != 1)
                 abort ();
--- 5388,5401 ----
        putc ('-', file);
        output_pic_addr_const (file, XEXP (x, 1), code);
        /* APPLE LOCAL darwin x86 */
! #ifndef TARGET_MACHO
        putc (ASSEMBLER_DIALECT == ASM_INTEL ? ')' : ']', file);
        /* APPLE LOCAL darwin x86 */
  #endif
        break;
 
        /* APPLE LOCAL darwin x86 */
! #ifndef TARGET_MACHO
       case UNSPEC:
         if (XVECLEN (x, 0) != 1)
                 abort ();
*************** ix86_output_addr_diff_elt (file, value, 
*** 6689,6697 ****
--- 6693,6703 ----
    else if (HAVE_AS_GOTOFF_IN_DATA)
      fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
    /* APPLE LOCAL begin darwin x86  */
+ #ifdef TARGET_MACHO
    else if (TARGET_MACHO)
      fprintf (file, "%s%s%d-%s\n", ASM_LONG, LPREFIX, value,
                                 machopic_function_base_name () + 1);
+ #endif
    /* APPLE LOCAL end darwin x86  */
    else
      asm_fprintf (file, "%s%U_GLOBAL_OFFSET_TABLE_+[.-%s%d]\n",
*************** ix86_svr3_asm_out_constructor (symbol, p
*** 12477,12508 ****
  #endif
 
  /* APPLE LOCAL begin darwin x86 */
  int flag_altivec;
 
- #if 0
- /* apple.c:  Functions for Mac OS X as target machine for GNU C 
compiler.  */
- 
- /* Note that the include below means that we can't debug routines in
-    i386.c when running on a COFF system.  */
- 
- #define MAX_386_STACK_LOCALS 3
- 
- #ifndef FIXED_PIC_REG
- int pic86_reg_num = 0;
- #endif
- 
- static rtx
- lookup_i386_stack_local (mode, n)
-   enum machine_mode mode;
-   int n;
- {
-     if (n < 0 || n >= MAX_386_STACK_LOCALS)
-       abort ();
- 
-     return  i386_stack_locals[(int) mode][n];
- }
- #endif
- 
  static int current_machopic_label_num;                 /* 
config/apple/machopic.c  */
 
  void
--- 12483,12491 ----
  #endif
 
  /* APPLE LOCAL begin darwin x86 */
+ #ifdef TARGET_MACHO
  int flag_altivec;
 
  static int current_machopic_label_num;                 /* 
config/apple/machopic.c  */
 
  void
*************** machopic_symbolic_operand (op, mode)
*** 12758,12763 ****
--- 12741,12747 ----
  #endif
    return 0;
  }
+ #endif
  #endif
  /* APPLE LOCAL end darwin x86 */
 
Index: gcc/pfe/pfe-mem.c
===================================================================
RCS file: /cvs/Darwin/gcc3/gcc/pfe/pfe-mem.c,v
retrieving revision 1.2
diff -p -r1.2 pfe-mem.c
*** pfe-mem.c            2001/12/21 19:53:53             1.2
--- pfe-mem.c            2002/03/20 06:03:25
*************** TUNING:
*** 120,126 ****
 
  /* Flag indicating whether this is an implementation specific for
     Macintosh OS X.  */
! #define APPLE_OS_X_IMPLEMENTATION 1
 
  #if TEST_PFEM
  #define PARAMS(x) x
--- 120,126 ----
 
  /* Flag indicating whether this is an implementation specific for
     Macintosh OS X.  */
! #define APPLE_OS_X_IMPLEMENTATION 0
 
  #if TEST_PFEM
  #define PARAMS(x) x
Index: include/libiberty.h
===================================================================
RCS file: /cvs/Darwin/gcc3/include/libiberty.h,v
retrieving revision 1.14
diff -p -r1.14 libiberty.h
*** libiberty.h          2002/03/14 07:33:09             1.14
--- libiberty.h          2002/03/20 06:03:53
*************** extern int asprintf PARAMS ((char **, co
*** 273,281 ****
--- 273,283 ----
     must be freed by the caller.  */
 
  /* APPLE LOCAL  Make vasprintf prototype agree with <stdio.h>  */
+ #if 0
  #include <machine/ansi.h>
  extern int vasprintf PARAMS ((char **, const char *, _BSD_VA_LIST_))
    ATTRIBUTE_PRINTF(2,0);
+ #endif
 
  #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]