Changeset 543


Ignore:
Timestamp:
Aug 7, 2003, 8:39:55 PM (22 years ago)
Author:
zap
Message:

See changelog.

Location:
trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/Makefile

    • Property cvs2svn:cvs-rev changed from 1.30 to 1.31
    r542 r543  
    3434ifndef GENRULES
    3535GENRULES = $.genrules.smak
     36endif
     37
     38# Check if MODE has a valid value
     39ifneq ($(filter-out /opt/ /dbg/ /prf/,/$(MODE)/),)
     40$(error MODE should have one of the following values: opt, dbg, prf)
    3641endif
    3742
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r542 r543  
    538538    "__getcwd2" @562
    539539    "__getdrive" @563
    540     "__getegid" @564
    541     "__geteuid" @565
    542540    "__getext" @566
    543541    "__getext2" @567
    544     "__getgrgid" @568
    545542    "__getname" @569
    546543    "__getpass1" @570
     
    804801    "__ea_set_errno" @828
    805802    "__ea_write" @829
    806    
     803    "__std_getegid" @830
     804    "__std_geteuid" @831
     805    "__std_getgrgid" @832
  • trunk/src/emx/src/lib/misc/getegid.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r542 r543  
    55#include <sys/types.h>
    66
    7 gid_t _getegid (void)
     7gid_t _STD(getegid) (void)
    88{
    99  return 0;
  • trunk/src/emx/src/lib/misc/geteuid.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r542 r543  
    55#include <sys/types.h>
    66
    7 uid_t _geteuid (void)
     7uid_t _STD(geteuid) (void)
    88{
    99  return 0;
  • trunk/src/emx/src/lib/misc/getgrgid.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r542 r543  
    88/* Dummy function */
    99
    10 struct group *_getgrgid (gid_t gid)
     10struct group *_STD(getgrgid) (gid_t gid)
    1111{
    1212  static struct group tmp_grp;
  • trunk/src/gcc/gcc/Makefile.in

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r542 r543  
    10621062          CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
    10631063          LIB1ASMSRC='$(LIB1ASMSRC)' \
    1064           MAKEOVERRIDES= \
     1064          MAKEOVERRIDES= SHELL=$(SHELL) \
    10651065          -f libgcc.mk all
    10661066
     
    11041104          CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
    11051105          LIB1ASMSRC='$(LIB1ASMSRC)' \
    1106           MAKEOVERRIDES= \
     1106          MAKEOVERRIDES= SHELL=$(SHELL) \
    11071107          -f libgcc.mk all
    11081108        $(STAMP) stmp-multilib
     
    27792779          DESTDIR="$(DESTDIR)" \
    27802780          libsubdir="$(libsubdir)" \
    2781           slibdir="$(slibdir)" \
     2781          slibdir="$(slibdir)" SHELL=$(SHELL) \
    27822782          -f libgcc.mk install
    27832783
     
    28062806          DESTDIR="$(DESTDIR)" \
    28072807          libsubdir="$(libsubdir)" \
    2808           slibdir="$(slibdir)" \
     2808          slibdir="$(slibdir)" SHELL=$(SHELL) \
    28092809          -f libgcc.mk install
    28102810
     
    31893189            && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
    31903190        done
     3191endif
    31913192        case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
    31923193        for dir in tmp-foo intl $(SUBDIRS); do \
     
    32003201        done
    32013202        -rm -f tmp-foo*
    3202 endif   
    32033203        case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
    32043204        if [ -f .bad_compare ]; then \
     
    32453245stage1-start:
    32463246        -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
    3247         $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage1
     3247        $(MAKE) SHELL=$(SHELL) -f libgcc.mk libgcc-stage-start stage=stage1
    32483248        -for dir in intl $(SUBDIRS) ; \
    32493249         do \
     
    32743274stage2-start:
    32753275        -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
    3276         $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2
     3276        $(MAKE) SHELL=$(SHELL) -f libgcc.mk libgcc-stage-start stage=stage2
    32773277        -for dir in intl $(SUBDIRS) ; \
    32783278         do \
     
    33033303stage3-start:
    33043304        -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
    3305         $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3
     3305        $(MAKE) SHELL=$(SHELL) -f libgcc.mk libgcc-stage-start stage=stage3
    33063306        -for dir in intl $(SUBDIRS) ; \
    33073307         do \
     
    33323332stage4-start:
    33333333        -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
    3334         $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4
     3334        $(MAKE) SHELL=$(SHELL) -f libgcc.mk libgcc-stage-start stage=stage4
    33353335        -for dir in intl $(SUBDIRS) ; \
    33363336         do \
  • trunk/src/gcc/gcc/cfg.sh

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r542 r543  
    2020export LDFLAGS="-s -Zexe -Zcrtdll"
    2121
     22# Many tests will fail if we'll include toolkit's types.h instead of emx's
     23unset C_INCLUDE_PATH
     24export C_INCLUDE_PATH
     25
    2226export TOPLEVEL_CONFIGURE_ARGUMENTS="--enable-clh --enable-threads --enable-shared --enable-nls --without-included-gettext --prefix=/gcc --srcdir=`pwd`"
    2327
  • trunk/src/gcc/gcc/config/i386/emx-dllinit.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r542 r543  
    66extern void __ctordtorInit (void);
    77extern void __ctordtorTerm (void);
    8 extern void __ehInitDLL (void);
    9 extern void __ehTermDLL (void);
    108
    119unsigned long _System _DLL_InitTerm (unsigned long mod_handle, unsigned long flag)
     
    1614      if (_CRT_init () != 0)
    1715        break;
    18       __ehInitDLL ();
    1916      __ctordtorInit ();
    2017      return 1;
    2118    case 1:
    2219      __ctordtorTerm ();
    23       __ehTermDLL ();
    2420      return 1;
    2521  }
  • trunk/src/gcc/gcc/config/i386/emx-eh.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r542 r543  
    1 /* Called at startup to register frame unwind info tables and at shutdown
    2    to deregister FUI tables. Used when frame unwinding info is enabled
    3    (C++ without --fno-exceptions and without -fsjlj-exceptions). */
     1/* This piece of code is linked into the program from gcc.a if any of the
     2   object files that are linked together use exception (e.g. have exception
     3   frame tables inside). The code automatically registers all exception
     4   tables into a central list (meant to be placed inside gcc*.dll),
     5   upon program exit these lists are deregistered. */
    46
    57extern int __eh_frame__;
    68extern void __register_frame_table (void *begin);
    79extern void __deregister_frame (void *begin);
    8 extern int atexit(void (*f)());
    910
    1011/** Exception handler stuff init indicator. 0 means not inited, 1 means inited. */
     
    1516 * Intended external caller is _DLL_InitTerm.
    1617 */
    17 void __ehInitDLL (void)
     18void __attribute__((constructor)) __ehInit (void)
    1819{
    1920  if (!inited)
     
    2930 * Intended external caller is _DLL_InitTerm.
    3031 */
    31 void __ehTermDLL (void)
     32void __attribute__((destructor)) __ehTerm (void)
    3233{
    3334  if (inited)
     
    3839    }
    3940}
    40 
    41 /**
    42  * atexit() procedure used to terminate exception stuff in programs.
    43  * Registered by __ehInit.
    44  */
    45 static void __ehTerm (void)
    46 {
    47   __ehTermDLL ();
    48 }
    49 
    50 /**
    51  * Init exception handler stuff for a program.
    52  * Intended external caller is GCC generated main() code.
    53  */
    54 void __ehInit (void)
    55 {
    56   if (!inited)
    57     {
    58       atexit (__ehTerm);
    59       __ehInitDLL ();
    60     }
    61 }
  • trunk/src/gcc/gcc/config/i386/emx.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r542 r543  
    11/* emx.c: Functions for emx as target system.
    22
    3 Written by Eberhard Mattes, based on i386.c.
    4 r=bird: Shouldn't Andy be in here too?
     3Original version by Eberhard Mattes, based on i386.c.
     4Heavily modified by Andrew Zabolotny and Knut St. Osmundsen.
    55
    66This file is part of GNU CC.
     
    3636#endif
    3737
    38 extern int ix86_return_pops_args (tree fundecl, tree funtype, int size);
    39 
    40 tree ix86_handle_optlink_attribute (tree *node, tree name, tree args,
     38static void (*old_lang_set_decl_assembler_name) (tree decl);
     39
     40static void emx_lang_set_decl_assembler_name (tree decl)
     41{
     42  tree id;
     43
     44  if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (TREE_TYPE (decl))))
     45    {
     46      size_t sl;
     47      const char *oldsym;
     48      char *newsym;
     49
     50      old_lang_set_decl_assembler_name (decl);
     51      id = DECL_ASSEMBLER_NAME (decl);
     52      /* Remove the leading underscore */
     53remove_underscore:
     54      oldsym = IDENTIFIER_POINTER (id);
     55      sl = strlen (oldsym) + 2;
     56      newsym = xmalloc (sl);
     57      /* Specifying '*' as first symbol character tells gcc (see varasm.c,
     58         function assemble_name()) to output the label as-is rather than
     59         invoking the ASM_OUTPUT_LABELREF macro (which prepends a underscore) */
     60      newsym [0] = '*';
     61      memcpy (newsym + 1, oldsym, sl + 1);
     62      XEXP (DECL_RTL (decl), 0) = gen_rtx (SYMBOL_REF, Pmode,
     63        IDENTIFIER_POINTER (get_identifier (newsym)));
     64    }
     65  else if (lookup_attribute ("system", TYPE_ATTRIBUTES (TREE_TYPE (decl))))
     66    {
     67      id = get_identifier (IDENTIFIER_POINTER (DECL_NAME (decl)));
     68      SET_DECL_ASSEMBLER_NAME (decl, id);
     69      goto remove_underscore;
     70    }
     71  else
     72    old_lang_set_decl_assembler_name (decl);
     73}
     74
     75/* The first time we encounter a _Optlink or _System function we hook the
     76 * lang_set_decl_assembler_name function so that instead of calling the
     77 * original mangler function our function gets called. Then, if the function
     78 * attribute is _System or _Optlink we mangle it according to respective
     79 * rules (_System functions always get the name as-is (e.g. no underscore,
     80 * no C++ mangling) and _Optlink don't get the leading underscore.
     81 */
     82static void hook_mangler (void)
     83{
     84  if (lang_set_decl_assembler_name != emx_lang_set_decl_assembler_name)
     85    {
     86      old_lang_set_decl_assembler_name = lang_set_decl_assembler_name;
     87      lang_set_decl_assembler_name = emx_lang_set_decl_assembler_name;
     88    }
     89}
     90
     91tree ix86_handle_system_attribute (tree *node, tree name, tree args,
    4192  int flags, bool *no_add_attrs)
    4293{
     
    52103    }
    53104
     105  hook_mangler ();
     106
    54107  return NULL_TREE;
    55108}
    56109
    57 /* Value is the number of bytes of arguments automatically
    58    popped when returning from a subroutine call.
    59    FUNDECL is the declaration node of the function (as a tree),
    60    FUNTYPE is the data type of the function (as a tree),
    61    or for a library call it is an identifier node for the subroutine name.
    62    SIZE is the number of bytes of arguments passed on the stack.
    63 
    64    On the 80386, the RTD insn may be used to pop them if the number
    65    of args is fixed, but if the number is variable then the caller
    66    must pop them all.  RTD can't be used for library calls now
    67    because the library is compiled with the Unix compiler.
    68    Use of RTD is a selectable option, since it is incompatible with
    69    standard Unix calling sequences.  If the option is not selected,
    70    the caller must always pop the args.
    71 
    72    The attribute stdcall is equivalent to RTD on a per module basis.  */
    73 
    74 int
    75 emx_return_pops_args (fundecl, funtype, size)
    76      tree fundecl;
    77      tree funtype;
    78      int size;
    79 {
    80   return ix86_return_pops_args (fundecl, funtype, size);
    81 #if 0
    82   int rtd = TARGET_RTD && (!fundecl || TREE_CODE (fundecl) != IDENTIFIER_NODE);
    83 
    84     /* Cdecl functions override -mrtd, and never pop the stack */
    85   if (!lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))
    86    && !lookup_attribute ("system", TYPE_ATTRIBUTES (funtype)))
    87   {
    88     /* Stdcall functions will pop the stack if not variable args */
    89     if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype)))
    90       rtd = 1;
    91 
    92     /* `optlink' functions taking a variable number of arguments
    93        should also pop the stack, but that's not implemented.
    94        We treat `optlink' functions taking a variable number of
    95        arguments like `system' functions.  */
    96     if (lookup_attribute ("regparm", TYPE_ATTRIBUTES (funtype)))
    97       rtd = 1;
    98 
    99     if (rtd
    100         && (TYPE_ARG_TYPES (funtype) == NULL_TREE
    101             || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (funtype))) == void_type_node)))
    102       return size;
    103   }
    104 
    105   /* Lose any fake structure return argument */
    106   /* @@@ This makes the generated code incompatible with that generated
    107    * by 2.7.2. I think this belongs in the if (rtd) ... case. Any ideas? */
    108   if (aggregate_value_p (TREE_TYPE (funtype)))
    109     return GET_MODE_SIZE (Pmode);
    110 
    111   return 0;
    112 #endif
     110tree ix86_handle_optlink_attribute (tree *node, tree name, tree args,
     111  int flags, bool *no_add_attrs)
     112{
     113  (void)args; (void)flags;
     114  if (TREE_CODE (*node) != FUNCTION_TYPE
     115      && TREE_CODE (*node) != METHOD_TYPE
     116      && TREE_CODE (*node) != FIELD_DECL
     117      && TREE_CODE (*node) != TYPE_DECL)
     118    {
     119      warning ("`%s' attribute only applies to functions",
     120               IDENTIFIER_POINTER (name));
     121      *no_add_attrs = true;
     122    }
     123
     124  hook_mangler ();
     125
     126  return NULL_TREE;
    113127}
    114128
     
    178192}
    179193
    180 const char *
    181 emx_remove_underscore (tree decl)
    182 {
    183   /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
    184      of DECL_ASSEMBLER_NAME.  */
    185   const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
    186   char *newsym = xmalloc (strlen (asmname) + 2);
    187   sprintf (newsym, "\b%s", asmname);
    188   return IDENTIFIER_POINTER (get_identifier (newsym));
    189 }
    190 
    191 /* Cover function to implement ENCODE_SECTION_INFO.  */
     194/* Cover function to implement ENCODE_SECTION_INFO.
     195   Note that this could be implemented much better by doing the
     196   stdcall mangling like optlink and system, but unfortunately */
    192197
    193198void
    194199emx_encode_section_info (tree decl)
    195200{
    196   /* This bit is copied from i386.h.  */
    197   if (optimize > 0 && TREE_CONSTANT (decl)
    198       && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))
     201  /* The default ENCODE_SECTION_INFO from i386.h */
     202  if (flag_pic)
    199203    {
    200204      rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
    201205                 ? TREE_CST_RTL (decl) : DECL_RTL (decl));
    202       SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
    203     }
    204 
     206
     207      if (GET_CODE (rtl) == MEM)
     208        {
     209          if (TARGET_DEBUG_ADDR
     210              && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
     211            {
     212              fprintf (stderr, "Encode %s, public = %d\n",
     213                       IDENTIFIER_POINTER (DECL_NAME (decl)),
     214                       TREE_PUBLIC (decl));
     215            }
     216
     217          SYMBOL_REF_FLAG (XEXP (rtl, 0))
     218            = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
     219               || ! TREE_PUBLIC (decl));
     220        }
     221    }
     222
     223  /* If declaring a function, mangle it if it's stdcall */
    205224  if (TREE_CODE (decl) == FUNCTION_DECL)
    206225    {
    207       if (lookup_attribute ("stdcall",
    208                           TYPE_ATTRIBUTES (TREE_TYPE (decl))))
     226      if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (TREE_TYPE (decl))))
    209227        XEXP (DECL_RTL (decl), 0) =
    210228          gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
    211       else if (lookup_attribute ("optlink",
    212                                  TYPE_ATTRIBUTES (TREE_TYPE (decl)))
    213                || lookup_attribute ("system",
    214                                     TYPE_ATTRIBUTES (TREE_TYPE (decl))))
    215         XEXP (DECL_RTL (decl), 0) =
    216           gen_rtx (SYMBOL_REF, Pmode, emx_remove_underscore (decl));
    217     }
    218 }
     229    }
     230}
  • trunk/src/gcc/gcc/config/i386/emx.h

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r542 r543  
    9191#define DWARF2_UNWIND_INFO 1
    9292
    93 /* The function to call after __main in the case program uses exceptions */
    94 #define NAME__EH_INIT "__ehInit"
     93/* We want the _System attribute */
     94#define TARGET_SYSTEM_DECL_ATTRIBUTES
     95/* Handle _System attribute */
     96extern tree ix86_handle_system_attribute PARAMS ((tree *, tree, tree, int, _Bool *));
     97
     98/* We want the _Optlink attribute */
     99#define TARGET_OPTLINK_DECL_ATTRIBUTES
     100/* Handle _Optlink attribute */
     101extern tree ix86_handle_optlink_attribute PARAMS ((tree *, tree, tree, int, _Bool *));
    95102
    96103/* This macros will stick a label to exception table for current file,
     
    171178
    172179/*******************************************************************
    173    The following encodings are used for label names
    174    depending on their attributes:
    175 
    176180   stdcall labels get a suffix consisting of an at-sign '@' and
    177181   the size of parameters in bytes rounded to next multiple of 4.
    178 
    179    optlink labels get a prefix of '\b' (e.g. backspace). This kind of
    180    means that the symbol name should not be prefixed by an underscore.
    181182*******************************************************************/
    182183
     
    196197  const char *_p;                                                       \
    197198  const char *_name = SYMBOL_NAME;                                      \
    198   if (*_name == '\b') _name++;                                          \
    199199  for (_p = _name; *_p && *_p != '@'; ++_p)                             \
    200200    ;                                                                   \
     
    214214#undef ASM_OUTPUT_LABELREF
    215215#define ASM_OUTPUT_LABELREF(STREAM, NAME)                               \
    216   fprintf (STREAM, "%s%s", *NAME == '\b' ? "" : USER_LABEL_PREFIX,      \
    217     *NAME == '\b' ? NAME + 1 : NAME)
    218 
    219 /* Handle _optlink attributes */
    220 extern tree ix86_handle_optlink_attribute PARAMS ((tree *, tree, tree, int, _Bool *));
     216  fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, NAME)
    221217
    222218/******************************************************************************
     
    241237    fprintf (FILE, "\tcall __mcount\n");                                \
    242238}
    243 
    244 /* Calling conventions */
    245 
    246 extern int emx_return_pops_args PARAMS ((tree, tree, int));
    247 #undef RETURN_POPS_ARGS
    248 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)                          \
    249     (emx_return_pops_args (FUNDECL, FUNTYPE, SIZE))
    250239
    251240/******************************************************************************
  • trunk/src/gcc/gcc/config/i386/i386.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r542 r543  
    12851285  { "shared",    0, 0, true,  false, false, ix86_handle_shared_attribute },
    12861286#endif
    1287 #ifdef EMX
    1288   { "system",    0, 0, false, true,  true,  ix86_handle_cdecl_attribute },
     1287#ifdef TARGET_SYSTEM_DECL_ATTRIBUTES
     1288  /* System says the function is extern "C" and is not underscored. */
     1289  { "system",    0, 0, false, true,  true,  ix86_handle_system_attribute },
     1290#endif
     1291#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     1292  /* Optlink is like regparm with a few differences */
    12891293  { "optlink",   0, 0, false, true,  true,  ix86_handle_optlink_attribute },
    12901294#endif
     
    15091513  int rtd = TARGET_RTD && (!fundecl || TREE_CODE (fundecl) != IDENTIFIER_NODE);
    15101514
    1511     /* Cdecl functions override -mrtd, and never pop the stack.  */
    1512   if (! lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {
     1515  /* Cdecl functions override -mrtd, and never pop the stack.  */
     1516  if (! lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))
     1517#ifdef TARGET_SYSTEM_DECL_ATTRIBUTES
     1518   && ! lookup_attribute ("system", TYPE_ATTRIBUTES (funtype))
     1519#endif
     1520     ) {
    15131521
    15141522    /* Stdcall functions will pop the stack if not variable args.  */
     
    16051613      if (attr)
    16061614        cum->nregs = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
    1607 #ifdef EMX
     1615#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
    16081616      if (lookup_attribute ("optlink", TYPE_ATTRIBUTES (fntype)))
    16091617        {
    16101618          cum->nregs = 3; cum->optlink = 1;
    16111619        }
    1612 #endif /* EMX */
     1620#endif
    16131621    }
    16141622  cum->maybe_vaarg = false;
     
    16211629  if (cum->nregs)
    16221630    {
     1631#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     1632      /* Count conforming arguments for optlink */
     1633      int cfarg_count = 0;
     1634#endif
     1635
    16231636      for (param = (fntype) ? TYPE_ARG_TYPES (fntype) : 0;
    16241637           param != 0; param = next_param)
    16251638        {
     1639#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     1640          if (INTEGRAL_TYPE_P (TREE_VALUE (param))
     1641           || POINTER_TYPE_P (TREE_VALUE (param)))
     1642            cfarg_count++;
     1643#endif
    16261644          next_param = TREE_CHAIN (param);
    16271645          if (next_param == 0 && TREE_VALUE (param) != void_type_node)
    16281646            {
     1647#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     1648              /* Visual Age docs says that the params preceeding the
     1649                 ellipsis still are passed in registers. */
     1650              if (cum->optlink)
     1651                cum->nregs = cfarg_count > 3 ? 3 : cfarg_count;
     1652              else
     1653#endif
    16291654              if (!TARGET_64BIT)
    16301655                cum->nregs = 0;
     
    22042229        {
    22052230          cum->words += words;
    2206 #ifdef EMX
     2231#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     2232          /* Optlink functions never pass aggregates in registers
     2233             (they are pushed on the stack, and the registers are
     2234             preserved for following parameters). Unfortunately GCC
     2235             optimizes short structures to SImode or DImode, thus
     2236             this detection works only for large structs. */
    22072237          if (cum->optlink && mode == BLKmode)
    2208             return;                     /* Skip aggregates */
    2209 #endif /* EMX */
     2238            return;
     2239#endif
    22102240          cum->nregs -= words;
    22112241          cum->regno += words;
     
    22722302
    22732303      case BLKmode:
    2274 #ifdef EMX
     2304#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
    22752305        if (cum->optlink)
    22762306          break;
    22772307        /* fall through */
    2278 #endif /* EMX */
     2308#endif
    22792309      case DImode:
    22802310      case SImode:
     
    22822312      case QImode:
    22832313        if (words <= cum->nregs)
    2284 #ifdef EMX
     2314#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
     2315          /* Optlink specs says that the parameter is passed in a register
     2316             and space on the stack is reserved for it as well (which is not
     2317             filled). Currently GCC will pass the parameter *both* in register
     2318             and stack; this is suboptimal but is compatible. */
    22852319          if (cum->optlink)
    22862320            {
     
    22932327            }
    22942328          else
    2295 #endif /* EMX */
     2329#endif
    22962330          ret = gen_rtx_REG (mode, cum->regno);
    22972331        break;
     
    23082342               words, cum->words, cum->nregs, GET_MODE_NAME (mode), named);
    23092343
    2310 #ifdef EMX
     2344#ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
    23112345      if (ret && GET_CODE (ret) == PARALLEL)
    23122346        fprintf (stderr, ", stack/reg=%%e%s",
    23132347                 reg_names[ REGNO(XEXP (XVECEXP (ret, 0, 1), 0))]);
    23142348      else
    2315 #endif /* EMX */
     2349#endif
    23162350      if (ret)
    23172351        fprintf (stderr, ", reg=%%e%s", reg_names[ REGNO (ret) ]);
  • trunk/src/gcc/gcc/config/i386/t-emx

    • Property cvs2svn:cvs-rev changed from 1.20 to 1.21
    r542 r543  
    1 # bird (#424): dropping multilibs. Old hacks - START
    2 ## EMX target have share libgcc, but the names are release specific and constrained by 8.3 limits.
    3 ## The link command depends heavily on the directory structure.
    4 #SHLIB_EXT      =
    5 #SHLIB_BASENAME = gcc$(gccdll_version)
    6 #SHLIB_MULTINAME= $(SHLIB_BASENAME)`echo @shlib_so_name@ | cut -b10`
    7 #SHLIB_DLLNAME  = $(SHLIB_MULTINAME).dll
    8 #SHLIB_LINK     = export DLLAR_CMDLINE="@shlib_objs@" && \
    9 #       kRx.exe dllar.cmd -o $$(@D)/$(SHLIB_DLLNAME) \
    10 #       -ordinal @multilib_flags@ -nocrtdll \
    11 #       -ex "__main __do_global_* _GLOBAL* _exit_dummy_ref __ctordtor* __eh* _DLL_InitTerm" \
    12 #       -d "GNU C runtime shared library version $(gcc_version)" \
    13 #       -libf "INITINSTANCE TERMGLOBAL" -lc_static -lc_import \
    14 #    && mv -f $$(@D)/$(SHLIB_MULTINAME).a $$(@D)/$(SHLIB_BASENAME).a \
    15 #       && ar rs $$(@D)/$(SHLIB_BASENAME).a libgcc/$$(@D)/__main.o libgcc/$$(@D)/emx-ctordtor.o libgcc/$$(@D)/emx-eh.o libgcc/$$(@D)/emx-dllinit.o \
    16 #    && touch $$@
    17 #SHLIB_SUBDIR  = `echo @shlib_base_name@ | sed -e "s/^libgcc_s_//" -e "s,_,/,g"`
    18 #SHLIB_INSTALL = $$(INSTALL_DATA) $(SHLIB_SUBDIR)/$(SHLIB_DLLNAME) $$(DESTDIR)$$(slibdir)/ \
    19 #    && $$(INSTALL_DATA) $(SHLIB_SUBDIR)/$(SHLIB_BASENAME).a $$(DESTDIR)$$(libsubdir)/$(SHLIB_SUBDIR)/
    20 #
    21 ## EMX Multi-threaded/Single-threaded libraries.
    22 #MULTILIB_OPTIONS    = Zmt
    23 #MULTILIB_DIRNAMES   = mt st
    24 #MULTILIB_MATCHES    = Zmt=Zmts Zmt=Zmtd
    25 #MULTILIB_EXCEPTIONS =
    26 #MULTILIB_EXTRA_OPTS =
    27 # bird (#424): dropping multilibs. Old hacks - END
     1# The command to run REXX scripts
     2# (that can invoke CMD.EXE commands! Never user kRx.exe here!)
     3REXX = $(subst \,/,$(OS2_SHELL)) /c
    284
    295# EMX target have share libgcc, but the names are release specific and constrained by 8.3 limits.
     
    3511SHLIB_LINK     = export DLLAR_CMDLINE="$$(patsubst %.o,%.obj,@shlib_objs@)" \
    3612        && emxomf @shlib_objs@ \
    37         && kRx.exe dllar.cmd -o $$(@D)/$(SHLIB_DLLNAME) \
     13        && $(REXX) dllar.cmd -o $$(@D)/$(SHLIB_DLLNAME) \
    3814        -ordinal @multilib_flags@ -nocrtdll \
    3915        -flags "-g -Zomf -v" \
     
    4622else
    4723SHLIB_LINK     = export DLLAR_CMDLINE="@shlib_objs@" && \
    48         kRx.exe dllar.cmd -o $$(@D)/$(SHLIB_DLLNAME) \
     24        $(REXX) dllar.cmd -o $$(@D)/$(SHLIB_DLLNAME) \
    4925        -ordinal @multilib_flags@ -nocrtdll \
    5026        -ex "___main ___do_global_* __GLOBAL* __exit_dummy_ref ___ctordtor* ___eh* _DLL_InitTerm" \
     
    6642
    6743# Override linker flags
    68 # bird: The -B specification doesn't work too well here...
    69 # bird: This better be removed....
    70 #LDFLAGS = -Zexe -Zcrtdll -B/emx/lib
    71 #LDFLAGS = -Zexe -Zcrtdll -B$(PATH_EMXPGCC)/lib
    7244LDFLAGS = -Zexe -Zcrtdll -Zstack 1024
    7345
  • trunk/src/gcc/gcc/configure

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r542 r543  
    30873087          s/  \\[^ ]/./g' |
    30883088    tr -d '
    3089  ' | tr -s '*' '
     3089 \r' | tr -s '\\*' '
    30903090' | fold | sed '$a\
    30913091' > conftest.dmp
     
    31613161          s/  \\[^ ]/./g' |
    31623162    tr -d '
    3163  ' | tr -s '*' '
     3163 \r' | tr -s '\\*' '
    31643164' | fold | sed '$a\
    31653165' > conftest.dmp
     
    79927992    fi
    79937993  elif test x$gcc_cv_ld != x; then
    7994     for gcc_WS in 4 8; do
    7995       cat > conftest.s <<EOF
    7996         .text
    7997 .LFB1:  .skip   64
    7998 .LFE1:
    7999 .LFB2:  .skip   64
    8000 .LFE2:
    8001 .LFB3:  .skip   64
    8002 .LFE3:
    8003         .section .eh_frame,"aw",@progbits
    8004 .Lframe1:
    8005         .4byte  .LECIE1-.LSCIE1
    8006 .LSCIE1:
    8007         .4byte  0x0
    8008         .byte   0x1
    8009         .ascii "zR\0"
    8010         .uleb128 0x1
    8011         .sleb128 -4
    8012         .byte   0x8
    8013         .uleb128 0x1
    8014         .byte   0x50
    8015         .byte   0xc
    8016         .uleb128 0x4
    8017         .uleb128 0x4
    8018         .byte   0x88
    8019         .uleb128 0x1
    8020         .balign ${gcc_WS}
    8021 .LECIE1:
    8022 .LSFDE1:
    8023         .4byte  .LEFDE1-.LASFDE1
    8024 .LASFDE1:
    8025         .4byte  .LASFDE1-.Lframe1
    8026         .${gcc_WS}byte  .LFB1
    8027         .${gcc_WS}byte  .LFE1-.LFB1
    8028         .uleb128 0x0
    8029         .balign ${gcc_WS}
    8030 .LEFDE1:
    8031 .LSFDE2:
    8032         .4byte  .LEFDE2-.LASFDE2
    8033 .LASFDE2:
    8034         .4byte  .LASFDE2-.Lframe1
    8035         .${gcc_WS}byte  .LFB2
    8036         .${gcc_WS}byte  .LFE2-.LFB2
    8037         .uleb128 0x0
    8038         .balign ${gcc_WS}
    8039 .LEFDE2:
    8040 .LSFDE3:
    8041         .4byte  .LEFDE3-.LASFDE3
    8042 .LASFDE3:
    8043         .4byte  .LASFDE3-.Lframe1
    8044         .${gcc_WS}byte  .LFB3
    8045         .${gcc_WS}byte  .LFE3-.LFB3
    8046         .uleb128 0x0
    8047         .balign ${gcc_WS}
    8048 .LEFDE3:
    8049         .4byte  0
    8050 EOF
    8051 # r=bird: Make this omission OS/2 target specific.
    8052       rm -f conftest.*
    8053     done
    80547994  fi
    80557995  echo "$ac_t""$gcc_cv_ld_eh_frame_hdr_works" 1>&6
  • trunk/src/gcc/gcc/emx-nextstage

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r542 r543  
    2020[ -z "$SHELL" ] && SHELL=sh
    2121
    22 # Find emx directory
    23 emxdir=`echo "$PATH" | sed -e "s/.*;\([#-:<-~]*emx[#-:<-~]*\);.*/\1/" -e 'y,\\\\,//,'`
    24 [ -z "$emxdir" ] && emxdir=/emx
     22# Find gcc directory
     23gccdir=`which gcc`
     24gccdir=`dirname $gccdir`
     25gccdir=`dirname $gccdir`
     26[ -z "$gccdir" ] && gccdir=/emx
     27
     28# The compilation will fail if we have toolkit in C_INCLUDE_PATH
     29unset C_INCLUDE_PATH
     30export C_INCLUDE_PATH=$gccdir/include
    2531
    2632for stage in 4 3 2 1 0; do
     
    3945      LDFLAGS="-Zexe"
    4046    else
    41       LDFLAGS="-Zexe -B/emx/lib"
     47      LDFLAGS="-Zexe -B$gccdir/lib"
    4248    fi
    4349  else
    4450    ### gcc 3.0 cannot complete stage 2 with -fomit-frame-pointer! :-( ###
    4551    CFLAGS="-s -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -falign-loops=2 -falign-jumps=2 -falign-functions=2 -malign-strings=0"
    46     LDFLAGS="-Zexe -Zcrtdll -B/emx/lib"
     52    LDFLAGS="-Zexe -Zcrtdll -B$gccdir/lib"
    4753  fi
    4854  if [ ${stage} -eq 0 ]; then
     
    6470         OLDCC="gcc -O6 -mno-stack-align-double -s" OLDCFLAGS= \
    6571         LOOSE_WARN="-W -Wall -Wwrite-strings -Wstrict-prototypes" \
    66          exec_prefix=$emxdir LANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log
     72         LANGUAGES="${LANGUAGES}" $* 2>&1 | tee $log
    6773
    68     if [ $? = 0 ] && [ -f mt/gcc*.dll ]; then
     74    if ! tail -1 $log | grep -q "Error"; then
    6975      echo -n "Compilation finished succesfully. Finish this stage? [Y/N] "
    7076      read answer
     
    7379      emxload -q
    7480      stage=`expr ${stage} + 1`
    75       make stage${stage}
     81      make SHELL=$SHELL stage${stage}
    7682          ;;
    7783      esac
  • trunk/src/gcc/gcc/function.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r542 r543  
    64976497  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), LCT_NORMAL,
    64986498                     VOIDmode, 0);
    6499 #ifdef NAME__EH_INIT
    6500   if (flag_exceptions)
    6501     emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__EH_INIT), LCT_NORMAL,
    6502                      VOIDmode, 0);
    6503 #endif
    65046499#endif
    65056500}
Note: See TracChangeset for help on using the changeset viewer.