Changeset 44

Timestamp:
Apr 28, 2003, 2:39:53 PM (23 years ago)
Author:
bird
Message:

Patches from Andy.

Location:
trunk/src/gcc/gcc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/config/i386/emx.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r43 r44  
    136136}
    137137
    138 /* Return string which is the former assembler name modified with a 
    139    suffix consisting of an atsign (@) followed by the number of bytes of 
     138/* Return string which is the former assembler name modified with a
     139   suffix consisting of an atsign (@) followed by the number of bytes of
    140140   arguments */
    141141
     
    151151
    152152  if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
    153     if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) 
     153    if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
    154154        == void_type_node)
    155155      {
     
    174174}
    175175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
    176188/* Cover function to implement ENCODE_SECTION_INFO.  */
    177189
     
    191203    if (lookup_attribute ("stdcall",
    192204                          TYPE_ATTRIBUTES (TREE_TYPE (decl))))
    193       XEXP (DECL_RTL (decl), 0) = 
     205      XEXP (DECL_RTL (decl), 0) =
    194206        gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
    195 }
     207    else if (lookup_attribute ("optlink",
     208                               TYPE_ATTRIBUTES (TREE_TYPE (decl)))
     209             || lookup_attribute ("system",
     210                                  TYPE_ATTRIBUTES (TREE_TYPE (decl))))
     211      XEXP (DECL_RTL (decl), 0) =
     212        gen_rtx (SYMBOL_REF, Pmode, emx_remove_underscore (decl));
     213}
  • trunk/src/gcc/gcc/config/i386/emx.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r43 r44  
    173173    if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", LOG)
    174174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
    175186/* Define this macro if references to a symbol must be treated
    176187   differently depending on something about the variable or
     
    179190#define ENCODE_SECTION_INFO(DECL) emx_encode_section_info (DECL)
    180191extern void emx_encode_section_info PARAMS ((tree));
    181 
    182 /* Utility used only in this file.  */
    183 #define EMX_STRIP_ENCODING(SYM_NAME)                                    \
    184   ((SYM_NAME) + ((SYM_NAME)[0] == '@' ?                                 \
    185     ((SYM_NAME)[3] == '*' ? 4 : 3) : 0) + ((SYM_NAME)[0] == '*' ? 1 : 0))
    186192
    187193/* This macro gets just the user-specified name
     
    192198do {                                                                    \
    193199  const char *_p;                                                       \
    194   const char *_name = EMX_STRIP_ENCODING (SYMBOL_NAME);                 \
     200  const char *_name = SYMBOL_NAME;                                      \
     201  if (*_name == '\b') _name++;                                          \
    195202  for (_p = _name; *_p && *_p != '@'; ++_p)                             \
    196203    ;                                                                   \
     
    210217#undef ASM_OUTPUT_LABELREF
    211218#define ASM_OUTPUT_LABELREF(STREAM, NAME)                               \
    212   fprintf (STREAM, "%s%s", USER_LABEL_PREFIX,                           \
    213            EMX_STRIP_ENCODING (NAME))
     219  fprintf (STREAM, "%s%s",       \
     220)
    214221
    215222/* Handle _optlink attributes */
     
    244251#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)                          \
    245252    (emx_return_pops_args (FUNDECL, FUNTYPE, SIZE))
    246 
    247 /******************************************************************************
    248  *                             - P - A - T - H - S -
    249  ******************************************************************************/
    250 
    251 #ifndef CROSS_COMPILE
    252 #undef TOOLDIR_BASE_PREFIX
    253 #define TOOLDIR_BASE_PREFIX             "/gcc/"
    254 #undef STANDARD_BINDIR_PREFIX
    255 #define STANDARD_BINDIR_PREFIX          "/gcc/bin/"
    256 #undef STANDARD_STARTFILE_PREFIX
    257 #define STANDARD_STARTFILE_PREFIX       "/gcc/lib/"
    258 #undef STANDARD_EXEC_PREFIX
    259 #define STANDARD_EXEC_PREFIX            "/gcc/lib/gcc-lib/"
    260 
    261 #define GCC_INCLUDE_DIR                 "/gcc/include/"
    262 #undef STANDARD_INCLUDE_DIR
    263 #define STANDARD_INCLUDE_DIR            "/gcc/include/"
    264 #define STANDARD_INCLUDE_COMPONENT      "GCC"
    265 #undef LOCAL_INCLUDE_DIR
    266 #undef PREFIX_INCLUDE_DIR
    267 #undef TOOL_INCLUDE_DIR
    268 #undef SYSTEM_INCLUDE_DIR
    269 #endif /* not CROSS_COMPILE */
    270 
    271 /* for prefix.c */
    272 #define UPDATE_PATH_HOST_CANONICALIZE(path)                                    \
    273 {                                                                              \
    274   char prefix_buffer [260 + 1], *c;                                            \
    275   _abspath (prefix_buffer, path, sizeof (prefix_buffer));                      \
    276   free (path);                                                                 \
    277   /* Way too often gcc generates double slashes, it looks bad */               \
    278   for (c = prefix_buffer; *c; c++)                                             \
    279     if ((c [0] == '/') && (c [1] == '/'))                                      \
    280       memmove (c, c + 1, strlen (c));                                          \
    281   path = xstrdup (prefix_buffer);                                              \
    282 }
    283 
    284 #define EMX_INITIALIZE_ENVIRONMENT(taildirs)                                   \
    285   /* Add the GCC_ROOT and BINUTILS_ROOT env vars if they don't exist */        \
    286   if (!getenv ("GCC_ROOT") || !getenv ("G++_ROOT") || !getenv ("BINUTILS_ROOT"))\
    287     {                                                                          \
    288       char buffer [14 + 260 + 1];                                              \
    289       if (!_execname (buffer + 14, sizeof (buffer) - 14))                      \
    290       {                                                                        \
    291         int i;                                                                 \
    292         for (i = 0; i < taildirs; i++)                                         \
    293           {                                                                    \
    294             char *name = _getname (buffer + 14);                               \
    295             if (name > buffer + 14)                                            \
    296               {                                                                \
    297                 if (i < taildirs - 1) name--;                                  \
    298                 if (*name != ':') *name = 0;                                   \
    299               }                                                                \
    300           }                                                                    \
    301         if (!getenv ("GCC_ROOT"))                                              \
    302           {                                                                    \
    303             memcpy (buffer + 5, "GCC_ROOT=", 9);                               \
    304             putenv (xstrdup (buffer + 5));                                     \
    305           }                                                                    \
    306         if (!getenv ("G++_ROOT"))                                              \
    307           {                                                                    \
    308             memcpy (buffer + 5, "G++_ROOT=", 9);                               \
    309             putenv (xstrdup (buffer + 5));                                     \
    310           }                                                                    \
    311         if (!getenv ("BINUTILS_ROOT"))                                         \
    312           {                                                                    \
    313             memcpy (buffer, "BINUTILS_ROOT=", 14);                             \
    314             putenv (xstrdup (buffer));                                         \
    315           }                                                                    \
    316       }                                                                        \
    317     }
    318 
    319 /* emxomf does not understand stabs+, so for frontends we have to
    320    switch to standard stabs if -Zomf is used. We also do many other
    321    argv preprocessing here. */
    322 #define GCC_DRIVER_HOST_INITIALIZATION                                         \
    323   {                                                                            \
    324     int i, j, new_argc, max_argc, omf = 0, g_found = 0;                        \
    325     const char **new_argv;                                                     \
    326     _emxload_env ("GCCLOAD");                                                  \
    327     _envargs (&argc, (char ***)&argv, "GCCOPT");                               \
    328     _response (&argc, (char ***)&argv);                                        \
    329     _wildcard (&argc, (char ***)&argv);                                        \
    330     /* Copy argv into a new location and modify it while copying */            \
    331     new_argv = (const char **)malloc ((max_argc = argc) * sizeof (char *));    \
    332     new_argv [0] = argv [0];                                                   \
    333     for (i = 1, new_argc = 1; i < argc; i++)                                   \
    334       {                                                                        \
    335         int arg_count = 1;                                                     \
    336         const char *arg [4];                                                   \
    337         arg [0] = argv [i];                                                    \
    338         if (!strcmp (argv [i], "-Zomf"))                                       \
    339           omf = 1;                                                             \
    340         else if (!strncmp (argv [i], "-g", 2)                                  \
    341               && ((argv [i][2] == 0) || ISDIGIT (argv [i][2])))                \
    342           g_found = new_argc;                                                  \
    343         else if (!strcmp (argv [i], "-Zmts"))                                  \
    344           {                                                                    \
    345             arg [0] = "-Zmt";                                                  \
    346             arg [1] = "-static";                                               \
    347             arg_count = 2;                                                     \
    348           }                                                                    \
    349         else if (!strcmp (argv [i], "-Zmtd"))                                  \
    350           {                                                                    \
    351             arg [0] = "-Zmt";                                                  \
    352             arg [1] = "-Zcrtdll=c_import";                                     \
    353             arg_count = 2;                                                     \
    354           }                                                                    \
    355         else if (!strcmp (argv [i], "-Zcrtdll"))                               \
    356             arg [0] = "-Zcrtdll=c_import";                                     \
    357         else if (!strcmp (argv [i], "-Zlinker"))                               \
    358           {                                                                    \
    359             if (i + 1 >= argc)                                                 \
    360                 fatal ("argument to `-Zlinker' is missing");                   \
    361             arg [0] = "-Xlinker";                                              \
    362             arg [1] = "-O";                                                    \
    363             arg [2] = "-Xlinker";                                              \
    364             arg [3] = argv [++i];                                              \
    365             arg_count = 4;                                                     \
    366           }                                                                    \
    367         if (new_argc + arg_count > max_argc)                                   \
    368             new_argv = (const char **)realloc (new_argv,                       \
    369                 (new_argc + arg_count) * sizeof (char *));                     \
    370         for (j = 0; j < arg_count; j++)                                        \
    371             new_argv [new_argc++] = arg [j];                                   \
    372       }                                                                        \
    373     argv = new_argv; argc = new_argc;                                          \
    374     if (g_found && omf)                                                        \
    375       {                                                                        \
    376         char *temp = (char *)malloc (strlen (argv [g_found]) + 5 + 1);         \
    377         strcpy (temp, "-gstabs");                                              \
    378         strcat (temp, &argv [g_found][2]);                                     \
    379         ((char **)argv) [g_found] = temp;                                      \
    380       }                                                                        \
    381     EMX_INITIALIZE_ENVIRONMENT(2)                                                      \
    382   }
    383253
    384254/******************************************************************************
  • trunk/src/gcc/gcc/config/i386/t-emx

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r43 r44  
    4242LIB1ASMFUNCS = _alloca _udivdi3 _umoddi3 _divdi3 _moddi3
    4343
    44 # Extra functions to add to libgcc (bird: don't forget $(srcdir) prefixing)
    45 LIB2FUNCS_EXTRA = $(srcdir)/config/i386/emx-ctordtor.c
    46 LIB2ADDEH = $(srcdir)/config/i386/emx-eh.c $(srcdir)/config/i386/emx-dllinit.c \
    47   $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c
     44# Extra functions to add to libgcc
     45LIB2FUNCS_EXTRA = config/i386/emx-ctordtor.c
     46LIB2ADDEH = config/i386/emx-dllinit.c \
     47  unwind-sjlj.c
    4848#LIB2ADDEHDEP
    4949
  • trunk/src/gcc/gcc/config/i386/xm-emx.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r43 r44  
    2424/* No block device special files on OS/2 */
    2525#define S_ISBLK(x) 0
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
    26175
    27176/* Do some OS/2-specific work upon initialization of all compilers */
     
    32181    /* Compilers don't fork (thanks God!) so we can use >32MB RAM */           \
    33182    _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);                              \
    34     EMX_INITIALIZE_ENVIRONMENT(4)                                                      \
     183    EMX_INITIALIZE_ENVIRONMENT(                                              \
    35184  }
    36185
  • trunk/src/gcc/gcc/emx-nextstage

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r43 r44  
    1515log='emx-build.log'
    1616emxload -q
    17 #export GCCLOAD=
     17export GCCLOAD=1
    1818
    1919[ -z "$SHELL" ] && SHELL=$BASH
    2020[ -z "$SHELL" ] && SHELL=sh
     21
     22
     23
     24
    2125
    2226for stage in 4 3 2 1 0; do
     
    6064         OLDCC="gcc -O6 -mno-stack-align-double -s" OLDCFLAGS= \
    6165         LOOSE_WARN="-W -Wall -Wwrite-strings -Wstrict-prototypes" \
    62          exec_prefix=/emx LANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log
     66         exec_prefix= LANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log
    6367
    6468    if [ $? = 0 ] && [ -f mt/gcc*.dll ]; then
     69
     70
     71
     72
    6573      emxload -q
    6674      stage=`expr ${stage} + 1`
    6775      make stage${stage}
     76
     77
    6878    fi
    6979    break;
Note: See TracChangeset for help on using the changeset viewer.