Changeset 44 for trunk/src/gcc
- Timestamp:
- Apr 28, 2003, 2:39:53 PM (22 years ago)
- 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
to1.2
r43 r44 136 136 } 137 137 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 140 140 arguments */ 141 141 … … 151 151 152 152 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)))) 154 154 == void_type_node) 155 155 { … … 174 174 } 175 175 176 const char * 177 emx_remove_underscore (decl) 178 tree decl; 179 { 180 /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead 181 of DECL_ASSEMBLER_NAME. */ 182 const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); 183 char *newsym = xmalloc (strlen (asmname) + 2); 184 sprintf (newsym, "\b%s", asmname); 185 return IDENTIFIER_POINTER (get_identifier (newsym)); 186 } 187 176 188 /* Cover function to implement ENCODE_SECTION_INFO. */ 177 189 … … 191 203 if (lookup_attribute ("stdcall", 192 204 TYPE_ATTRIBUTES (TREE_TYPE (decl)))) 193 XEXP (DECL_RTL (decl), 0) = 205 XEXP (DECL_RTL (decl), 0) = 194 206 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 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/emx.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r43 r44 173 173 if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", LOG) 174 174 175 /******************************************************************* 176 The following encodings are used for label names 177 depending on their attributes: 178 179 stdcall labels get a suffix consisting of an at-sign '@' and 180 the size of parameters in bytes rounded to next multiple of 4. 181 182 optlink labels get a prefix of '\b' (e.g. backspace). This kind of 183 means that the symbol name should not be prefixed by an underscore. 184 *******************************************************************/ 185 175 186 /* Define this macro if references to a symbol must be treated 176 187 differently depending on something about the variable or … … 179 190 #define ENCODE_SECTION_INFO(DECL) emx_encode_section_info (DECL) 180 191 extern 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))186 192 187 193 /* This macro gets just the user-specified name … … 192 198 do { \ 193 199 const char *_p; \ 194 const char *_name = EMX_STRIP_ENCODING (SYMBOL_NAME); \ 200 const char *_name = SYMBOL_NAME; \ 201 if (*_name == '\b') _name++; \ 195 202 for (_p = _name; *_p && *_p != '@'; ++_p) \ 196 203 ; \ … … 210 217 #undef ASM_OUTPUT_LABELREF 211 218 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \ 212 fprintf (STREAM, "%s%s", USER_LABEL_PREFIX,\213 EMX_STRIP_ENCODING (NAME))219 fprintf (STREAM, "%s%s", *NAME == '\b' ? "" : USER_LABEL_PREFIX, \ 220 *NAME == '\b' ? NAME + 1 : NAME) 214 221 215 222 /* Handle _optlink attributes */ … … 244 251 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ 245 252 (emx_return_pops_args (FUNDECL, FUNTYPE, SIZE)) 246 247 /******************************************************************************248 * - P - A - T - H - S -249 ******************************************************************************/250 251 #ifndef CROSS_COMPILE252 #undef TOOLDIR_BASE_PREFIX253 #define TOOLDIR_BASE_PREFIX "/gcc/"254 #undef STANDARD_BINDIR_PREFIX255 #define STANDARD_BINDIR_PREFIX "/gcc/bin/"256 #undef STANDARD_STARTFILE_PREFIX257 #define STANDARD_STARTFILE_PREFIX "/gcc/lib/"258 #undef STANDARD_EXEC_PREFIX259 #define STANDARD_EXEC_PREFIX "/gcc/lib/gcc-lib/"260 261 #define GCC_INCLUDE_DIR "/gcc/include/"262 #undef STANDARD_INCLUDE_DIR263 #define STANDARD_INCLUDE_DIR "/gcc/include/"264 #define STANDARD_INCLUDE_COMPONENT "GCC"265 #undef LOCAL_INCLUDE_DIR266 #undef PREFIX_INCLUDE_DIR267 #undef TOOL_INCLUDE_DIR268 #undef SYSTEM_INCLUDE_DIR269 #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 to320 switch to standard stabs if -Zomf is used. We also do many other321 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 }383 253 384 254 /****************************************************************************** -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/t-emx
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r43 r44 42 42 LIB1ASMFUNCS = _alloca _udivdi3 _umoddi3 _divdi3 _moddi3 43 43 44 # Extra functions to add to libgcc (bird: don't forget $(srcdir) prefixing)45 LIB2FUNCS_EXTRA = $(srcdir)/config/i386/emx-ctordtor.c46 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.c44 # Extra functions to add to libgcc 45 LIB2FUNCS_EXTRA = config/i386/emx-ctordtor.c 46 LIB2ADDEH = config/i386/emx-eh.c config/i386/emx-dllinit.c \ 47 unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c 48 48 #LIB2ADDEHDEP 49 49 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/xm-emx.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r43 r44 24 24 /* No block device special files on OS/2 */ 25 25 #define S_ISBLK(x) 0 26 27 /****************************************************************************** 28 * - P - A - T - H - S - 29 ******************************************************************************/ 30 31 #ifndef CROSS_COMPILE 32 #undef TOOLDIR_BASE_PREFIX 33 #define TOOLDIR_BASE_PREFIX "/gcc/" 34 #undef STANDARD_BINDIR_PREFIX 35 #define STANDARD_BINDIR_PREFIX "/gcc/bin/" 36 #undef STANDARD_STARTFILE_PREFIX 37 #define STANDARD_STARTFILE_PREFIX "/gcc/lib/" 38 #undef STANDARD_EXEC_PREFIX 39 #define STANDARD_EXEC_PREFIX "/gcc/lib/gcc-lib/" 40 41 #undef GCC_INCLUDE_DIR 42 #define GCC_INCLUDE_DIR "/gcc/include/" 43 #undef GPLUSPLUS_INCLUDE_DIR 44 #define GPLUSPLUS_INCLUDE_DIR "/gcc/include/c++/3.2.2" 45 #undef GPLUSPLUS_TOOL_INCLUDE_DIR 46 #define GPLUSPLUS_TOOL_INCLUDE_DIR "/gcc/include/c++/3.2.2/i386-pc-os2-emx" 47 #undef GPLUSPLUS_BACKWARD_INCLUDE_DIR 48 #define GPLUSPLUS_BACKWARD_INCLUDE_DIR "/gcc/include/c++/3.2.2/backward" 49 #undef LOCAL_INCLUDE_DIR 50 #undef CROSS_INCLUDE_DIR 51 #undef TOOL_INCLUDE_DIR 52 #undef STANDARD_INCLUDE_DIR 53 /* -- no need to duplicate GCC_INCLUDE_DIR -- 54 #define STANDARD_INCLUDE_DIR "/gcc/include/" 55 #define STANDARD_INCLUDE_COMPONENT "GCC" 56 */ 57 #undef LOCAL_INCLUDE_DIR 58 #undef PREFIX_INCLUDE_DIR 59 #undef TOOL_INCLUDE_DIR 60 #undef SYSTEM_INCLUDE_DIR 61 #endif /* not CROSS_COMPILE */ 62 63 /* for prefix.c */ 64 #define UPDATE_PATH_HOST_CANONICALIZE(path) \ 65 { \ 66 char prefix_buffer [260 + 1], *c; \ 67 _abspath (prefix_buffer, path, sizeof (prefix_buffer)); \ 68 free (path); \ 69 /* Way too often gcc generates double slashes, it looks bad */ \ 70 for (c = prefix_buffer; *c; c++) \ 71 if ((c [0] == '/') && (c [1] == '/')) \ 72 memmove (c, c + 1, strlen (c)); \ 73 path = xstrdup (prefix_buffer); \ 74 } 75 76 #define EMX_INITIALIZE_ENVIRONMENT(taildirs) \ 77 /* Add the GCC_ROOT and BINUTILS_ROOT env vars if they don't exist */ \ 78 if (!getenv ("GCC_ROOT") || !getenv ("G++_ROOT") || !getenv ("BINUTILS_ROOT"))\ 79 { \ 80 char buffer [14 + 260 + 1]; \ 81 if (!_execname (buffer + 14, sizeof (buffer) - 14)) \ 82 { \ 83 int i; \ 84 for (i = 0; i < taildirs; i++) \ 85 { \ 86 char *name = _getname (buffer + 14); \ 87 if (name > buffer + 14) \ 88 { \ 89 if (i < taildirs - 1) name--; \ 90 if (*name != ':') *name = 0; \ 91 } \ 92 } \ 93 if (!getenv ("GCC_ROOT")) \ 94 { \ 95 memcpy (buffer + 5, "GCC_ROOT=", 9); \ 96 putenv (xstrdup (buffer + 5)); \ 97 } \ 98 if (!getenv ("G++_ROOT")) \ 99 { \ 100 memcpy (buffer + 5, "G++_ROOT=", 9); \ 101 putenv (xstrdup (buffer + 5)); \ 102 } \ 103 if (!getenv ("BINUTILS_ROOT")) \ 104 { \ 105 memcpy (buffer, "BINUTILS_ROOT=", 14); \ 106 putenv (xstrdup (buffer)); \ 107 } \ 108 } \ 109 } 110 111 /* emxomf does not understand stabs+, so for frontends we have to 112 switch to standard stabs if -Zomf is used. We also do many other 113 argv preprocessing here. */ 114 #define GCC_DRIVER_HOST_INITIALIZATION \ 115 { \ 116 int i, j, new_argc, max_argc, omf = 0, g_found = 0; \ 117 const char **new_argv; \ 118 _emxload_env ("GCCLOAD"); \ 119 _envargs (&argc, (char ***)&argv, "GCCOPT"); \ 120 _response (&argc, (char ***)&argv); \ 121 _wildcard (&argc, (char ***)&argv); \ 122 /* Copy argv into a new location and modify it while copying */ \ 123 new_argv = (const char **)malloc ((max_argc = argc) * sizeof (char *)); \ 124 new_argv [0] = argv [0]; \ 125 for (i = 1, new_argc = 1; i < argc; i++) \ 126 { \ 127 int arg_count = 1; \ 128 const char *arg [4]; \ 129 arg [0] = argv [i]; \ 130 if (!strcmp (argv [i], "-Zomf")) \ 131 omf = 1; \ 132 else if (!strncmp (argv [i], "-g", 2) \ 133 && ((argv [i][2] == 0) || ISDIGIT (argv [i][2]))) \ 134 g_found = new_argc; \ 135 else if (!strcmp (argv [i], "-Zmts")) \ 136 { \ 137 arg [0] = "-Zmt"; \ 138 arg [1] = "-static"; \ 139 arg_count = 2; \ 140 } \ 141 else if (!strcmp (argv [i], "-Zmtd")) \ 142 { \ 143 arg [0] = "-Zmt"; \ 144 arg [1] = "-Zcrtdll=c_import"; \ 145 arg_count = 2; \ 146 } \ 147 else if (!strcmp (argv [i], "-Zcrtdll")) \ 148 arg [0] = "-Zcrtdll=c_import"; \ 149 else if (!strcmp (argv [i], "-Zlinker")) \ 150 { \ 151 if (i + 1 >= argc) \ 152 fatal ("argument to `-Zlinker' is missing"); \ 153 arg [0] = "-Xlinker"; \ 154 arg [1] = "-O"; \ 155 arg [2] = "-Xlinker"; \ 156 arg [3] = argv [++i]; \ 157 arg_count = 4; \ 158 } \ 159 if (new_argc + arg_count > max_argc) \ 160 new_argv = (const char **)realloc (new_argv, \ 161 (new_argc + arg_count) * sizeof (char *)); \ 162 for (j = 0; j < arg_count; j++) \ 163 new_argv [new_argc++] = arg [j]; \ 164 } \ 165 argv = new_argv; argc = new_argc; \ 166 if (g_found && omf) \ 167 { \ 168 char *temp = (char *)malloc (strlen (argv [g_found]) + 5 + 1); \ 169 strcpy (temp, "-gstabs"); \ 170 strcat (temp, &argv [g_found][2]); \ 171 ((char **)argv) [g_found] = temp; \ 172 } \ 173 EMX_INITIALIZE_ENVIRONMENT(2) \ 174 } 26 175 27 176 /* Do some OS/2-specific work upon initialization of all compilers */ … … 32 181 /* Compilers don't fork (thanks God!) so we can use >32MB RAM */ \ 33 182 _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY); \ 34 EMX_INITIALIZE_ENVIRONMENT( 4)\183 EMX_INITIALIZE_ENVIRONMENT(5) \ 35 184 } 36 185 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/emx-nextstage
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r43 r44 15 15 log='emx-build.log' 16 16 emxload -q 17 #export GCCLOAD= 17 export GCCLOAD=1 18 18 19 19 [ -z "$SHELL" ] && SHELL=$BASH 20 20 [ -z "$SHELL" ] && SHELL=sh 21 22 # Find emx directory 23 emxdir=`echo "$PATH" | sed -e "s/.*;\([#-:<-~]*emx[#-:<-~]*\);.*/\1/" -e 'y,\\\\,//,'` 24 [ -z "$emxdir" ] && emxdir=/emx 21 25 22 26 for stage in 4 3 2 1 0; do … … 60 64 OLDCC="gcc -O6 -mno-stack-align-double -s" OLDCFLAGS= \ 61 65 LOOSE_WARN="-W -Wall -Wwrite-strings -Wstrict-prototypes" \ 62 exec_prefix= /emxLANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log66 exec_prefix=$emxdir LANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log 63 67 64 68 if [ $? = 0 ] && [ -f mt/gcc*.dll ]; then 69 echo -n "Compilation finished succesfully. Finish this stage? [Y/N] " 70 read answer 71 case $answer in 72 [yY] | [yY][eE][sSzZaA] | [oO][kK] | [oO][kK][aA][yY] | [jJ][aA] | [dD][aA] | [€| ]) 65 73 emxload -q 66 74 stage=`expr ${stage} + 1` 67 75 make stage${stage} 76 ;; 77 esac 68 78 fi 69 79 break; -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.