Changeset 94


Ignore:
Timestamp:
May 5, 2003, 8:48:59 PM (22 years ago)
Author:
zap
Message:

This is the start of work on making EMX C runtime EMX-independent ;-)
The first signs of a GNU Make-based build system.
Fixed a lot of .s files to comply with new GAS syntax.
Added a lot of submakefiles for every sub-library.
Replaced EM's getopt.h with the one from libiberty (which supports
getopt_long). The old getopt.h has moved to include/emx, so if
some tool needs it (and you don't want to fix it to use the new getopt),
replace #include <getopt.h> with #include <emx/getopt.h>. Did so in
most EMX tools.

Location:
trunk/src/emx
Files:
40 added
58 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/a_out.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    132132/* Copied from aout64.h of BFD */
    133133#define N_WEAKU 0x0d            /* Weak undefined symbol.  */
     134#define N_WEAKA 0x0e            /* Weak absolute symbol.  */
     135#define N_WEAKT 0x0f            /* Weak text symbol.  */
     136#define N_WEAKD 0x10            /* Weak data symbol.  */
     137#define N_WEAKB 0x11            /* Weak bss symbol.  */
    134138/* emx */
    135139#define N_IMP1  0x68            /* Import definition symbol */
  • trunk/src/emx/include/emx/asm386.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    33#include <sys/errno.h>
    44
    5 #define _xam fxam; fstsww %ax; andb $0x45, %ah
     5#define _xam fxam; fstsw %ax; andb $0x45, %ah
    66
    77#define j_nan cmpb $0x01, %ah; je
  • trunk/src/emx/include/getopt.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    1 /* getopt (emx+gcc) */
     1/* Declarations for getopt.
     2   Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
     3
     4   NOTE: The canonical source of this file is maintained with the GNU C Library.
     5   Bugs can be reported to bug-glibc@gnu.org.
     6
     7   This program is free software; you can redistribute it and/or modify it
     8   under the terms of the GNU General Public License as published by the
     9   Free Software Foundation; either version 2, or (at your option) any
     10   later version.
     11
     12   This program is distributed in the hope that it will be useful,
     13   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15   GNU General Public License for more details.
     16
     17   You should have received a copy of the GNU General Public License
     18   along with this program; if not, write to the Free Software
     19   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
     20   USA.  */
    221
    322#ifndef _GETOPT_H
    4 #define _GETOPT_H
     23#define _GETOPT_H 1
    524
    6 #if defined (__cplusplus)
     25#ifdef  __cplusplus
    726extern "C" {
    827#endif
    928
    10 extern char *optarg;       /* argument of current option                    */
    11 extern int optind;         /* index of next argument; default=0: initialize */
    12 extern int opterr;         /* 0=disable error messages; default=1: enable   */
    13 extern int optopt;         /* option character which caused the error       */
    14 extern char *optswchar;    /* characters introducing options; default="-"   */
     29/* For communication from `getopt' to the caller.
     30   When `getopt' finds an option that takes an argument,
     31   the argument value is returned here.
     32   Also, when `ordering' is RETURN_IN_ORDER,
     33   each non-option ARGV-element is returned here.  */
    1534
    16 extern enum _optmode
     35extern char *optarg;
     36
     37/* Index in ARGV of the next element to be scanned.
     38   This is used for communication to and from the caller
     39   and for communication between successive calls to `getopt'.
     40
     41   On entry to `getopt', zero means this is the first call; initialize.
     42
     43   When `getopt' returns -1, this is the index of the first of the
     44   non-option elements that the caller should itself scan.
     45
     46   Otherwise, `optind' communicates from one call to the next
     47   how much of ARGV has been scanned so far.  */
     48
     49extern int optind;
     50
     51/* Callers store zero here to inhibit the error message `getopt' prints
     52   for unrecognized options.  */
     53
     54extern int opterr;
     55
     56/* Set to an option character which was unrecognized.  */
     57
     58extern int optopt;
     59
     60/* Describe the long-named options requested by the application.
     61   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
     62   of `struct option' terminated by an element containing a name which is
     63   zero.
     64
     65   The field `has_arg' is:
     66   no_argument          (or 0) if the option does not take an argument,
     67   required_argument    (or 1) if the option requires an argument,
     68   optional_argument    (or 2) if the option takes an optional argument.
     69
     70   If the field `flag' is not NULL, it points to a variable that is set
     71   to the value given in the field `val' when the option is found, but
     72   left unchanged if the option is not found.
     73
     74   To have a long-named option do something other than set an `int' to
     75   a compiled-in constant, such as set a value from `optarg', set the
     76   option's `flag' field to zero and its `val' field to a nonzero
     77   value (the equivalent single-letter option character, if there is
     78   one).  For long options that have a zero `flag' field, `getopt'
     79   returns the contents of the `val' field.  */
     80
     81struct option
    1782{
    18   GETOPT_UNIX,             /* options at start of argument list (default)   */
    19   GETOPT_ANY,              /* move non-options to the end                   */
    20   GETOPT_KEEP              /* return options in order                       */
    21 } optmode;
     83#if defined (__STDC__) && __STDC__
     84  const char *name;
     85#else
     86  char *name;
     87#endif
     88  /* has_arg can't be an enum because some compilers complain about
     89     type mismatches in all the code that assumes it is an int.  */
     90  int has_arg;
     91  int *flag;
     92  int val;
     93};
    2294
     95/* Names for the values of the `has_arg' field of `struct option'.  */
    2396
    24 /* Note: The 2nd argument is not const as GETOPT_ANY reorders the
    25    array pointed to. */
     97#define no_argument             0
     98#define required_argument       1
     99#define optional_argument       2
    26100
    27 int getopt (int, char **, __const__ char *);
     101#if defined (__STDC__) && __STDC__
     102#ifdef __GNU_LIBRARY__
     103/* Many other libraries have conflicting prototypes for getopt, with
     104   differences in the consts, in stdlib.h.  To avoid compilation
     105   errors, only prototype getopt for the GNU C library.  */
     106extern int getopt (int argc, char *const *argv, const char *shortopts);
     107#else /* not __GNU_LIBRARY__ */
     108extern int getopt ();
     109#endif /* __GNU_LIBRARY__ */
     110extern int getopt_long (int argc, char *const *argv, const char *shortopts,
     111                        const struct option *longopts, int *longind);
     112extern int getopt_long_only (int argc, char *const *argv,
     113                             const char *shortopts,
     114                             const struct option *longopts, int *longind);
    28115
    29 #if defined (__cplusplus)
     116/* Internal only.  Users should not call this directly.  */
     117extern int _getopt_internal (int argc, char *const *argv,
     118                             const char *shortopts,
     119                             const struct option *longopts, int *longind,
     120                             int long_only);
     121#else /* not __STDC__ */
     122extern int getopt ();
     123extern int getopt_long ();
     124extern int getopt_long_only ();
     125
     126extern int _getopt_internal ();
     127#endif /* __STDC__ */
     128
     129#ifdef  __cplusplus
    30130}
    31131#endif
    32132
    33 #endif /* not _GETOPT_H */
     133#endif /* getopt.h */
  • trunk/src/emx/include/os2.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    88#endif
    99
     10#ifndef _Cdecl
    1011#define _Cdecl
     12#endif
     13#ifndef _Far16
    1114#define _Far16
     15#endif
     16#ifndef _Optlink
    1217#define _Optlink
     18#endif
     19#ifndef _Pascal
    1320#define _Pascal
     21#endif
     22#ifndef _Seg16
    1423#define _Seg16
     24#endif
     25#ifndef _System
    1526#define _System
     27#endif
    1628
    1729#if defined (USE_OS2_TOOLKIT_HEADERS)
  • trunk/src/emx/src/emxbind/emxbind.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r93 r94  
    2525#include <stdlib.h>
    2626#include <string.h>
    27 #include <getopt.h>
     27#include <emx/getopt.h>
    2828#include <sys/moddef.h>
    2929#include "defs.h"
  • trunk/src/emx/src/emxexp/emxexp.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r93 r94  
    2424#include <stdarg.h>
    2525#include <string.h>
    26 #include <getopt.h>
     26#include <emx/getopt.h>
    2727#include <errno.h>
    2828#include <ar.h>
  • trunk/src/emx/src/emximp/emximp.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2525#include <string.h>
    2626#include <ctype.h>
    27 #include <getopt.h>
     27#include <emx/getopt.h>
    2828#include <process.h>
    2929#include <ar.h>
  • trunk/src/emx/src/emxload/emxload.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2626#include <limits.h>
    2727#include <time.h>
     28#include <alloca.h>
    2829#include <sys/emxload.h>
    2930#include <emx/emxload.h>
  • trunk/src/emx/src/emxomf/emxomf.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r93 r94  
    2828#include <ctype.h>
    2929#include <getopt.h>
     30#include <alloca.h>
    3031#include <sys/param.h>
    3132#include <sys/emxload.h>
  • trunk/src/emx/src/emxomf/emxomfld.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r93 r94  
    2222#include <stdio.h>
    2323#include <stdlib.h>
     24#include <alloca.h>
     25#include <errno.h>
    2426#include <string.h>
    2527#include <process.h>
     
    2830#include <sys/types.h>
    2931#include <sys/stat.h>
    30 #include <emx/getopt.h>
    31 #include <errno.h>
    3232#include <sys/utime.h>
    3333#include <sys/moddef.h>
     34#include <emx/getopt.h>
    3435#include <alloca.h>
    3536#include "defs.h"
  • trunk/src/emx/src/emxstack/emxstack.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2424#include <stdarg.h>
    2525#include <string.h>
    26 #include <getopt.h>
     26#include <emx/getopt.h>
    2727#include <sys/dirtree.h>
    2828#include "defs.h"
  • trunk/src/emx/src/emxtsf/emxtsf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2323#include <stdlib.h>
    2424#include <string.h>
    25 #include <getopt.h>
     25#include <emx/getopt.h>
    2626#include <sys/moddef.h>
    2727
  • trunk/src/emx/src/ld/ld.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2828#include <io.h>
    2929#include <process.h>        /* for running emxbind */
     30#include <errno.h>
    3031#endif /* __EMX__ */
    3132#include <sys/types.h>
     
    8182
    8283#endif /* EMX */
     84
     85/* We need .data of every module aligned to at least 16 bound
     86   in order to support the alignments required by SSE */
     87#define SECTION_ALIGN           16
     88#define SECTION_ALIGN_MASK      (SECTION_ALIGN-1)
    8389
    8490#ifndef N_SET_MAGIC
     
    521527#endif                          /* This is output from LD.  */
    522528
     529/* Check if a symbol is weak */
     530#define WEAK_SYMBOL(t) (((t) >= N_WEAKU) && ((t) <= N_WEAKB))
     531
    523532/* If a this type of symbol is encountered, its name is a warning
    524533   message to print each time the symbol referenced by the next symbol
     
    612621      char trace;
    613622#ifdef EMX /* WEAKU */
    614       /* Nonzero if undefined weak */
     623      /* One of N_WEAKX values */
    615624      char weak;
    616625#endif /* EMX */
     
    11001109
    11011110int parse ();
     1111void do_warnings ();
    11021112void initialize_text_start ();
    11031113void initialize_data_start ();
     
    17001710          register struct file_entry *subentry = entry->subfiles;
    17011711          for (; subentry; subentry = subentry->chain)
    1702             if (return_val = (*function) (subentry, arg))
     1712            if ((return_val = (*function) (subentry, arg)))
    17031713              return return_val;
    17041714        }
    17051715      else
    1706         if (return_val = (*function) (entry, arg))
     1716        if ((return_val = (*function) (entry, arg)))
    17071717          return return_val;
    17081718    }
     
    17531763     register struct file_entry *entry;
    17541764{
    1755   register int desc;
     1765  register int desc = -1;
    17561766
    17571767  if (entry->superfile)
     
    17711781          register char *string
    17721782            = concat (search_dirs[i], "/", entry->filename);
    1773 #ifdef __EMX__
     1783#ifdef EMX /* host */
    17741784          desc = open (string, O_RDONLY|O_BINARY, 0);
    1775 #else /* !__EMX__ */
     1785
     1786          if (desc < 0)
     1787          {
     1788           char *tmp = _getext (entry->filename);
     1789           if (tmp && (tolower(tmp[1]) == 'a') && (tmp[2] == 0))
     1790           {
     1791            /* Try libxxx */
     1792            free (string);
     1793            string = concat (search_dirs[i], "/lib", entry->filename);
     1794            desc = open (string, O_RDONLY|O_BINARY, 0);
     1795           }
     1796          }
     1797#else /* !EMX */
    17761798          desc = open (string, O_RDONLY, 0);
    1777 #endif /* !__EMX__ */
     1799#endif /* !EMX */
    17781800          if (desc > 0)
    17791801            {
     
    18001822
    18011823  perror_file (entry);
    1802   /* NOTREACHED */
     1824  return -1;
    18031825}
    18041826
     
    19251947     struct file_entry *entry;
    19261948{
    1927   register int len;
    19281949  struct exec hdr;
    19291950  struct stat st;
     
    19922013  entry->strs_offset = N_STROFF(hdr);
    19932014  lseek(desc, entry->starting_offset + entry->strs_offset, 0);
    1994   if (read(desc, (char *) &entry->strs_size, sizeof (unsigned long int))
     2015  if (entry->syms_size &&
     2016      read(desc, (char *) &entry->strs_size, sizeof (unsigned long int))
    19952017      != sizeof (unsigned long int))
    19962018    fatal_with_file ("failure reading string table size of ", entry);
     
    20302052#ifdef LC_SYMSEG
    20312053  struct symseg_command *symseg_command;
    2032 #endif;
     2054#endif
    20332055  int ordinal;
    20342056  int symtab_seen, symseg_seen;
     
    21862208     int desc;
    21872209{
    2188   int str_size;
    2189 
    21902210  if (!entry->header_read_flag)
    21912211    read_header (desc, entry);
     
    22112231     int desc;
    22122232{
    2213   int buffer;
    2214 
    22152233  if (!entry->header_read_flag)
    22162234    read_header (desc, entry);
     
    23302348            }
    23312349        }
     2350#ifdef __EMX__
     2351      else if (WEAK_SYMBOL (p->n_type))
     2352        {
     2353          /* Enter the symbol into the symbol hash table only if it
     2354             has not already been defined */
     2355          symbol *s = getsym_soft (p->n_un.n_strx + entry->strings);
     2356          if (!s || !s->defined)
     2357            enter_global_ref (p, p->n_un.n_strx + entry->strings, entry);
     2358        }
     2359#endif
    23322360      else if (p->n_type & N_EXT)
    23332361        enter_global_ref (p, p->n_un.n_strx + entry->strings, entry);
     
    23672395  register symbol *sp = getsym (name);
    23682396  register int type = nlist_p->n_type;
     2397  const int realtype = type;
    23692398  int oldref = sp->referenced;
    23702399  int olddef = sp->defined;
     
    23742403
    23752404  sp->referenced = 1;
    2376 #ifdef EMX /* WEAKU */
    2377   if (type == N_WEAKU)
    2378     {
    2379       /* Note: This doesn't work with DOLLAR_KLUDGE */
    2380       /* Don't increment undefined_global_sym_count */
    2381       sp->weak = 1;
    2382     }
    2383   else
     2405
     2406#ifdef EMX /* WEAK symbol support */
     2407  if (WEAK_SYMBOL (type))
     2408    {
     2409      sp->weak = type;
     2410      /* Switch symbol type so that it can be processed like regular symbols */
     2411      type = nlist_p->n_type =
     2412        (type == N_WEAKU) ? N_UNDF | N_EXT :
     2413        (type == N_WEAKA) ? N_ABS | N_EXT :
     2414        (type == N_WEAKT) ? N_TEXT | N_EXT :
     2415        (type == N_WEAKD) ? N_DATA | N_EXT :
     2416        /*(type == N_WEAKB)*/ N_BSS | N_EXT;
     2417    }
    23842418#endif /* EMX */
     2419
    23852420  if (type != (N_UNDF | N_EXT) || nlist_p->n_value)
    23862421    {
     
    23882423        sp->defined = type;
    23892424
    2390 #ifdef EMX /* WEAKU */
    2391       if (oldref && !olddef && sp->weak)
    2392         sp->weak = 0;           /* Keep undefined_global_sym_count */
    2393       else
    2394 #endif /* EMX */
    23952425      if (oldref && !olddef)
    23962426        /* It used to be undefined and we're defining it.  */
     
    24092439          common_defined_global_count--;
    24102440          sp->max_common_size = 0;
     2441
     2442          fprintf (stderr, "%s: symbol `%s' defined more than once in ",
     2443            progname, name);
     2444          print_file_name (entry, stderr);
     2445          fprintf (stderr, "\n");
     2446          exit (1);
    24112447        }
    24122448      else if (olddef && sp->max_common_size && type == (N_UNDF | N_EXT)
     
    24782514    {
    24792515      register char *reftype;
    2480       switch (type & ~N_EXT)
     2516      switch (realtype & ~N_EXT)
    24812517        {
    24822518        case N_UNDF:
     
    25442580#endif
    25452581
    2546 #ifdef EMX /* import */
     2582#ifdef EMX /* import & WEAK */
    25472583        case N_IMP1:
    25482584          reftype = "imported";
    25492585          break;
    2550 #endif /* EMX */
    2551 #ifdef EMX /* WEAKU */
    25522586        case N_WEAKU & ~N_EXT:
    25532587          reftype = "weak";
     2588          break;
     2589        case N_WEAKT & ~N_EXT:
     2590          reftype = "weak text";
     2591          break;
     2592        case N_WEAKD & ~N_EXT:
     2593          reftype = "weak data";
    25542594          break;
    25552595#endif /* EMX */
     
    27642804            if (sp && ((sp->referenced && !sp->defined)
    27652805                       || (sp->defined && sp->max_common_size))
    2766 #ifdef EMX /* WEAKU */
    2767                 && !sp->weak
    2768 #endif /* EMX */
    27692806               )
    27702807              {
     
    28402877/* Handle a subentry for a file with no __.SYMDEF. */
    28412878
    2842 process_subentry (desc, subentry, entry, prev_addr)
     2879void process_subentry (desc, subentry, entry, prev_addr)
    28432880     int desc;
    28442881     register struct file_entry *subentry;
     
    29172954      /* If the symbol has an interesting definition, we could
    29182955         potentially want it.  */
    2919       if (type & N_EXT
     2956      if (((type & N_EXT)
     2957#ifdef __EMX__
     2958           || WEAK_SYMBOL (type)
     2959#endif
     2960          )
    29202961          && (type != (N_UNDF | N_EXT) || p->n_value
    2921 
    29222962#ifdef DOLLAR_KLUDGE
    29232963               || name[1] == '$'
    29242964#endif
    29252965              )
    2926 #ifdef EMX /* WEAKU */
    2927           && type != N_WEAKU
    2928 #endif /* EMX */
    29292966          && !SET_ELEMENT_P (type)
    29302967          && !set_element_prefixed_p (name))
     
    29592996                 pipe() from the library.  But the bug fix kingdon made was wrong.  */
    29602997              || (sp->defined && sp->max_common_size
    2961 #ifdef EMX /* fix bugs, WEAKU */
    2962                   && type != (N_INDR | N_EXT) && type != N_WEAKU
     2998#ifdef EMX
     2999                  && type != (N_INDR | N_EXT)
    29633000#endif /* EMX */
    29643001              ))
     
    30143051{
    30153052  register int i;
    3016   int setv_fill_count;
     3053  int setv_fill_count = 0;
    30173054
    30183055  if (trace_files)
     
    30553092  /* Make sure bss starts out aligned as much as anyone can want.  */
    30563093  {
    3057     int new_data_size = (data_size + sizeof(double) - 1) & ~(sizeof(double)-1);
     3094    int new_data_size = (data_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;
    30583095
    30593096    data_pad += new_data_size - data_size;
     
    30903127  /* Make sure bss starts out aligned as much as anyone can want.  */
    30913128  {
    3092     int new_data_size = (data_size + sizeof(double) - 1) & ~(sizeof(double)-1);
     3129    int new_data_size = (data_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;
    30933130
    30943131    data_pad += new_data_size - data_size;
     
    31213158          int defs = 0, com = sp->max_common_size;
    31223159          struct nlist *first_definition;
    3123 #ifdef EMX /* WEAKU */
    3124           if (sp->weak && !sp->defined && output_style != OUTPUT_RELOCATABLE)
    3125             {
    3126               sp->defined = N_ABS;
    3127               sp->weak = 0;
    3128               sp->value = 0;
    3129             }
    3130 #endif /* EMX */
    31313160          for (p = sp->refs; p; p = next)
    31323161            {
     
    31563185                  set_vectors[setv_fill_count++] = p->n_value;
    31573186                }
    3158 #ifdef EMX /* import, WEAKU */
     3187#ifdef EMX /* import */
    31593188              else if ((type & N_EXT) && type != (N_UNDF | N_EXT)
    3160                        && type != (N_IMP1 | N_EXT) && type != N_WEAKU)
     3189                       && type != (N_IMP1 | N_EXT))
    31613190#else /* !EMX */
    31623191              else if ((type & N_EXT) && type != (N_UNDF | N_EXT))
     
    32063235                  bss_size += com;
    32073236                  if (write_map)
    3208                     printf ("Allocating common %s: %x at %x\n",
     3237                    printf ("Allocating common %s: %x at %lx\n",
    32093238                            sp->name, com, sp->value);
    32103239                }
     
    32513280              set_vectors[setv_fill_count++] = 0;
    32523281            }
     3282#ifdef EMX /* Unresolved weak symbols should be zero */
     3283          if (!sp->defined && WEAK_SYMBOL (sp->weak))
     3284            {
     3285              sp->defined = N_ABS;
     3286              sp->value = 0;
     3287              undefined_global_sym_count--;
     3288            }
     3289#endif /* EMX */
    32533290          if (sp->defined)
    32543291            defined_global_sym_count++;
    3255 #ifdef EMX /* WEAKU */
    3256           else if (sp->weak)
    3257             undefined_global_sym_count++;
    3258 #endif /* EMX */
    32593292        }
    32603293    }
     
    32623295  /* Make sure end of bss is aligned as much as anyone can want.  */
    32633296
    3264   bss_size = (bss_size + sizeof(double) - 1) & ~(sizeof(double)-1);
     3297  bss_size = (bss_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;
    32653298
    32663299  /* Give values to _end and friends.  */
     
    33283361  text_size += entry->text_size;
    33293362  entry->data_start_address = data_size;
    3330   data_size += entry->data_size;
     3363  data_size += (entry->data_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;
    33313364  entry->bss_start_address = bss_size;
    3332   bss_size += entry->bss_size;
     3365  bss_size += (entry->bss_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;
    33333366
    33343367  text_reloc_size += entry->text_reloc_size;
     
    34003433  fprintf (outfile, "\nFiles:\n\n");
    34013434
    3402   each_file (describe_file_sections, outfile);
     3435  each_file (describe_file_sections, (int)outfile);
    34033436
    34043437  fprintf (outfile, "\nGlobal symbols:\n\n");
     
    34123445            fprintf (outfile, "  %s: common, length 0x%x\n", sp->name, sp->max_common_size);
    34133446          if (sp->defined)
    3414             fprintf (outfile, "  %s: 0x%x\n", sp->name, sp->value);
     3447            fprintf (outfile, "  %s: 0x%lx\n", sp->name, sp->value);
    34153448          else if (sp->referenced)
    34163449            fprintf (outfile, "  %s: undefined\n", sp->name);
     
    34183451    }
    34193452
    3420   each_file (list_file_locals, outfile);
     3453  each_file (list_file_locals, (int)outfile);
    34213454}
    34223455
     
    34293462  print_file_name (entry, outfile);
    34303463  if (entry->just_syms_flag)
    3431     fprintf (outfile, " symbols only\n", 0);
     3464    fprintf (outfile, " symbols only\n");
    34323465  else
    3433     fprintf (outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n",
     3466    fprintf (outfile, " text %x(%lx), data %x(%lx), bss %x(%lx) hex\n",
    34343467             entry->text_start_address, entry->text_size,
    34353468             entry->data_start_address, entry->data_size,
     
    34563489    /* If this is a definition,
    34573490       update it if necessary by this file's start address.  */
    3458     if (!(p->n_type & (N_STAB | N_EXT)))
    3459       fprintf (outfile, "  %s: 0x%x\n",
     3491    if (!(p->n_type & (N_STAB | N_EXT)) &&
     3492        !SET_ELEMENT_P (p->n_type))
     3493      fprintf (outfile, "  %s: 0x%lx\n",
    34603494               entry->strings + p->n_un.n_strx, p->n_value);
     3495    else if (SET_ELEMENT_P (p->n_type))
     3496      fprintf (outfile, "  [set element] %s: 0x%lx\n",
     3497               ((symbol *)p->n_un.n_name)->name, p->n_value);
    34613498
    34623499  entry->strings = 0;           /* All done with them.  */
     
    36883725   we scan the nlists themselves.  */
    36893726
     3727void
    36903728do_relocation_warnings (entry, data_segment, outfile, nlist_bitvector)
    36913729     struct file_entry *entry;
     
    38303868  struct line_debug_entry *text_scan, *data_scan;
    38313869  int i;
    3832   char *errfmt, *file_name;
    3833   int line_number;
     3870  char *errfmt, *file_name = NULL;
     3871  int line_number = -1;
    38343872  int dont_allow_symbol_name;
    38353873
     
    38673905      s = entry->symbols + i;
    38683906
    3869       if (!(s->n_type & N_EXT))
     3907      if (WEAK_SYMBOL (s->n_type) || !(s->n_type & N_EXT))
    38703908        continue;
    38713909
     
    39644002
    39654003
     4004void
    39664005do_warnings (outfile)
    39674006     FILE *outfile;
     
    39774016    return;
    39784017
    3979   each_file (do_file_warnings, outfile);
     4018  each_file (do_file_warnings, (int)outfile);
    39804019
    39814020  if (list_unresolved_refs || list_multiple_defs)
     
    40024041initialize_a_out_text_start ()
    40034042{
    4004   int magic;
     4043  int magic = 0;
    40054044
    40064045  switch (output_style)
     
    48114850    {
    48124851      ext = _getext (output_filename);
    4813       if (ext != NULL)
    4814         fatal ("The output file name must not have a suffix if -Zexe is used",
    4815                NULL);
    4816       touch_filename = output_filename;
    4817       exe_filename = concat (output_filename, ".exe", "");
     4852      if ((ext != NULL) && (stricmp (ext, ".exe") == 0))
     4853      {
     4854        exe_filename = output_filename;
     4855        exe_flag = 0;
     4856      } else
     4857      {
     4858        touch_filename = output_filename;
     4859        exe_filename = concat (output_filename, ".exe", "");
     4860      }
    48184861    }
    48194862  else
     
    49995042      if (touch_filename != NULL)
    50005043        {
    5001           i = open (touch_filename,
    5002                     O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
    5003           if (i < 0)
     5044          char execname[512];
     5045          _execname((char *)&execname, sizeof(execname));
     5046          strcpy(_getname((char *)&execname), "ldstub.bin");
     5047          /* Copy stub into file */
     5048          if (DosCopy((char *)&execname, touch_filename, 4))
     5049          {
     5050            errno = EACCES;
     5051            perror_name (execname);
     5052          }
     5053          /* Now touch it */
     5054          if (utime(touch_filename, NULL))
    50045055            perror_name (touch_filename);
    5005           close (i);
    50065056        }
    50075057    }
     
    52805330
    52815331  mywrite (bytes, 1, entry->data_size, outdesc);
     5332  padfile ((SECTION_ALIGN - entry->data_size) & SECTION_ALIGN_MASK, outdesc);
    52825333}
    52835334
     
    54005451
    54015452      /* Unshifted mask for relocation */
    5402       mask = 1 << RELOC_TARGET_BITSIZE(p) - 1;
     5453      mask = (1 << RELOC_TARGET_BITSIZE(p)) - 1;
    54035454      mask |= mask - 1;
    54045455      relocation &= mask;
     
    56675718#endif
    56685719
    5669           symtype = symptr->defined & ~N_EXT;
    5670 
     5720#ifdef EMX
     5721          if (symtype = symptr->defined != (N_IMP1 | N_EXT))
     5722#endif
     5723            symtype = symptr->defined & ~N_EXT;
     5724 
     5725#ifdef EMX /* relocatable */
     5726          if ((force_common_definition || reloc_flag)
     5727           && (symtype != (N_IMP1 | N_EXT)))
     5728#endif /* EMX */
    56715729          if (force_common_definition
    5672 #ifdef EMX /* relocatable */
    5673               || (reloc_flag && symtype != N_IMP1)
    5674 #endif /* EMX */
    56755730              || symtype == N_DATA || symtype == N_TEXT || symtype == N_ABS)
    56765731            {
     
    58285883  /* Write the local symbols defined by the various files.  */
    58295884
    5830   each_file (write_file_syms, &syms_written);
     5885  each_file (write_file_syms, (int)&syms_written);
    58315886  file_close ();
    58325887
     
    58935948                nl.n_value = sp->max_common_size;
    58945949              }
    5895 #ifdef EMX /* WEAKU */
     5950#ifdef EMX /* WEAK */
    58965951            else if (!sp->defined && sp->weak)
    58975952              {
    5898                 nl.n_type = N_WEAKU;
     5953                nl.n_type = sp->weak;
    58995954                nl.n_value = 0;
    59005955              }
     
    59205975              {
    59215976                struct nlist xtra_ref;
    5922                 xtra_ref.n_type == N_EXT | N_UNDF;
     5977                xtra_ref.n_type = N_EXT | N_UNDF;
    59235978                xtra_ref.n_un.n_strx
    59245979                  = assign_string_table_index (((symbol *) sp->value)->name);
     
    60476102                                /* globally.  */
    60486103        write = output_style == OUTPUT_RELOCATABLE;
     6104      else if (WEAK_SYMBOL (type))
     6105        ;
    60496106      else if (!(type & (N_STAB | N_EXT)))
    60506107        /* ordinary local symbol */
  • trunk/src/emx/src/ld/stab.def

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
  • trunk/src/emx/src/ld/stab.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
  • trunk/src/emx/src/ld/symseg.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
  • trunk/src/emx/src/lib/app/stdio.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    22
    33#include <stdio.h>
     4#include <stdlib.h>
    45#include <sys/builtin.h>        /* For <sys/fmutex.h> */
    56#include <sys/fmutex.h>         /* For <sys/rmutex.h> */
  • trunk/src/emx/src/lib/conv/bidivbb.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    11/* bidivbb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */
    22
     3#include <alloca.h>
    34#include <assert.h>
    45#include <sys/builtin.h>
  • trunk/src/emx/src/lib/conv/bipow5.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    22
    33#include <stdlib.h>
     4#include <alloca.h>
    45#include <emx/bigint.h>
    56#include "bipow5.tab"
  • trunk/src/emx/src/lib/conv/dtoa.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    11/* dtoa.c (emx+gcc) -- Copyright (c) 1996-1999 by Eberhard Mattes */
    22
     3#include <stdlib.h>
    34#include <math.h>
    45#include <float.h>
  • trunk/src/emx/src/lib/io/access.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    33#include <string.h>
    44#include <io.h>
     5#include <alloca.h>
    56#include <errno.h>
    67#include <emx/io.h>
  • trunk/src/emx/src/lib/io/eaget.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    77#include <io.h>
    88#include <errno.h>
     9#include <alloca.h>
    910#include <sys/ea.h>
    1011#include "ea.h"
  • trunk/src/emx/src/lib/io/eaput.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    66#include <string.h>
    77#include <io.h>
     8#include <alloca.h>
    89#include <errno.h>
    910#include <sys/ea.h>
  • trunk/src/emx/src/lib/io/fcntl.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    55#include <io.h>
    66#include <fcntl.h>
     7#include <alloca.h>
    78#include <errno.h>
    89#include <limits.h>
  • trunk/src/emx/src/lib/io/readv.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    55#include <unistd.h>
    66#include <io.h>
     7#include <alloca.h>
    78#include <errno.h>
    89#include <sys/types.h>
  • trunk/src/emx/src/lib/io/select.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    44#include <memory.h>
    55#include <io.h>
     6#include <alloca.h>
    67#include <sys/types.h>
    78#include <sys/time.h>
  • trunk/src/emx/src/lib/io/sscanf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    44#include <stdarg.h>
    55#include <limits.h>
     6#include <string.h>
    67#include <emx/io.h>
    78
  • trunk/src/emx/src/lib/io/stat.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    55#include <time.h>
    66#include <io.h>
     7#include <alloca.h>
    78#include <errno.h>
    89#include <sys/types.h>
  • trunk/src/emx/src/lib/io/vscanf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    77#include <stdlib.h>
    88#include <stdarg.h>
     9#include <string.h>
    910#include <emx/io.h>
    1011
  • trunk/src/emx/src/lib/io/writev.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    55#include <unistd.h>
    66#include <io.h>
     7#include <alloca.h>
    78#include <errno.h>
    89#include <sys/types.h>
  • trunk/src/emx/src/lib/math/386/ceil.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        PROFILE_NOFRAME
    2222        subl    $4, %esp
    23         fstcww  cw1
     23        fstcw   cw1
    2424        movw    cw1, %ax
    2525        andw    $0xf3ff, %ax
    2626        orw     $0x0800, %ax            /* round up towards +inf */
    2727        movw    %ax, cw2
    28         fldcww  cw2
     28        fldcw   cw2
    2929        FLD     x                       /* x */
    3030        frndint
    31         fldcww  cw1
     31        fldcw   cw1
    3232        addl    $4, %esp
    3333        EPILOGUE(FUNC)
  • trunk/src/emx/src/lib/math/386/clear.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    1414        PROFILE_NOFRAME
    1515        xor     %eax, %eax              /* Clear upper 16 bits */
    16         fstsww  %ax
     16        fstsw   %ax
    1717        fclex
    1818        EPILOGUE(_clear87)
  • trunk/src/emx/src/lib/math/386/control.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2020        PROFILE_NOFRAME
    2121        pushl   %ecx                    /* Dummy (for control word) */
    22         fstcww  cw_old                  /* Store control word into memory */
     22        fstcw   cw_old                  /* Store control word into memory */
    2323        movl    mask, %ecx              /* Get mask */
    2424        jecxz   1f                      /* Do not set cw => done */
     
    3030        orl     %edx, %eax              /* Insert new bits */
    3131        movw    %ax, cw_new             /* Put new cw into memory */
    32         fldcww  cw_new                  /* Load control word */
     32        fldcw   cw_new                  /* Load control word */
    33331:      popl    %eax                    /* Return old cw in lower 16 bits */
    3434        movzwl  %ax, %eax               /* Clear upper 16 bits */
  • trunk/src/emx/src/lib/math/386/cos.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2020        FLD     x                       /* x */
    2121        fcos                            /* cos(x) */
    22         fstsww  %ax
     22        fstsw   %ax
    2323        testb   $0x04, %ah                             
    2424        jnz     Llarge                  /* C2 != 0 ? */
  • trunk/src/emx/src/lib/math/386/cosh.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2626        fldl2e                          /* log2 (e) */
    2727        fmulp                           /* y := x * log2 (e) */
    28         fstcww  cw1
     28        fstcw   cw1
    2929        movw    cw1, %ax
    3030        andw    $0xf3ff, %ax
    3131        orw     $0x0400, %ax            /* round down towards -inf */
    3232        movw    %ax, cw2
    33         fldcww  cw2     
     33        fldcw   cw2     
    3434        fld     %st                     /* y, y */
    3535        frndint                         /* int (y), y */
    36         fldcww  cw1
     36        fldcw   cw1
    3737        fxch    %st(1)                  /* y, int (y) */
    3838        fsub    %st(1), %st             /* frac (y), int (y) */
  • trunk/src/emx/src/lib/math/386/exp.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2323        FLD     x                       /* x */
    2424        fxam
    25         fstsww %ax
     25        fstsw  %ax
    2626        andb    $0x47, %ah
    2727        cmpb    $5, %ah
     
    3131        fldl2e                          /* log2 (e) */
    3232        fmulp                           /* y := x * log2 (e) */
    33         fstcww  cw1
     33        fstcw   cw1
    3434        movw    cw1, %ax
    3535        andw    $0xf3ff, %ax
    3636        orw     $0x0400, %ax            /* round down towards -inf */
    3737        movw    %ax, cw2
    38         fldcww  cw2     
     38        fldcw   cw2     
    3939        fld     %st                     /* y, y */
    4040        frndint                         /* int (y), y */
    41         fldcww  cw1
     41        fldcw   cw1
    4242        fxch    %st(1)                  /* y, int (y) */
    4343        fsub    %st(1), %st             /* frac (y), int (y) */
  • trunk/src/emx/src/lib/math/386/floor.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        PROFILE_NOFRAME
    2222        subl    $4, %esp
    23         fstcww  cw1
     23        fstcw   cw1
    2424        movw    cw1, %ax
    2525        andw    $0xf3ff, %ax
    2626        orw     $0x0400, %ax            /* round down towards -inf */
    2727        movw    %ax, cw2
    28         fldcww  cw2
     28        fldcw   cw2
    2929        FLD     x                       /* x */
    3030        frndint
    31         fldcww  cw1
     31        fldcw   cw1
    3232        addl    $4, %esp
    3333        EPILOGUE(FUNC)
  • trunk/src/emx/src/lib/math/386/fmod.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2626        FLD     y                       /* y */
    2727        ftst
    28         fstsww  %ax
     28        fstsw   %ax
    2929        andw    $0x4100, %ax
    3030        xorb    $0x40, %ah
     
    3232        FLD     x                       /* x */
    33331:      fprem
    34         fstsww  %ax
     34        fstsw   %ax
    3535        andb    $0x04, %ah
    3636        jnz     1b                      /* C2 != 0 ? */
  • trunk/src/emx/src/lib/math/386/fpclass.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        fldt    x
    2222        fxam
    23         fstsww  %ax
     23        fstsw   %ax
    2424        fstp    %st(0)
    2525        movb    %ah, %al
  • trunk/src/emx/src/lib/math/386/frexp.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2828        FLD     x                       /* x */
    2929        ftst
    30         fstsww  %ax
     30        fstsw   %ax
    3131        andw    $0x4100, %ax
    3232        xorb    $0x40, %ah
  • trunk/src/emx/src/lib/math/386/fxam.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2020        FLD     x                       /* x */
    2121        fxam
    22         fstsww  %ax
     22        fstsw   %ax
    2323        fstp    %st(0)
    2424        movl    %eax, %edx
  • trunk/src/emx/src/lib/math/386/isfin.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        fldt    x
    2222        fxam
    23         fstsww  %ax
     23        fstsw   %ax
    2424        fstp    %st(0)
    2525        movb    %ah, %al
  • trunk/src/emx/src/lib/math/386/isnan.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        fldt    x
    2222        fxam
    23         fstsww  %ax
     23        fstsw   %ax
    2424        fstp    %st(0)
    2525        movb    %ah, %al
  • trunk/src/emx/src/lib/math/386/isnorm.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        fldt    x
    2222        fxam
    23         fstsww  %ax
     23        fstsw   %ax
    2424        fstp    %st(0)
    2525        movb    %ah, %al
  • trunk/src/emx/src/lib/math/386/log.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    1919        FLD     x                       /* x */
    2020        fxam
    21         fstsww %ax
     21        fstsw  %ax
    2222        andb    $0x47, %ah
    2323        cmpb    $5, %ah
  • trunk/src/emx/src/lib/math/386/log10.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    1919        FLD     x                       /* x */
    2020        fxam
    21         fstsww %ax
     21        fstsw  %ax
    2222        andb    $0x47, %ah
    2323        cmpb    $5, %ah
  • trunk/src/emx/src/lib/math/386/modf.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2626        PROFILE_NOFRAME
    2727        subl    $4, %esp
    28         fstcww  cw1
     28        fstcw   cw1
    2929        movw    cw1, %ax
    3030        orw     $0x0c00, %ax            /* chop mode */
    3131        movw    %ax, cw2
    3232        movl    intptr, %eax
    33         fldcww  cw2
     33        fldcw   cw2
    3434        FLD     x                       /* x */
    3535        fld     %st
     
    4141        fstl    (%eax)
    4242#endif
    43         fldcww  cw1
     43        fldcw   cw1
    4444        fsubrp
    4545        addl    $4, %esp
  • trunk/src/emx/src/lib/math/386/nextaft.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2323        fldt    y(0)
    2424        fucompp
    25         fstsww  %ax
     25        fstsw   %ax
    2626        testb   $0x04, %ah
    2727        jnz     Lunordered              /* Unordered (at least one NaN) */
     
    166166        flds    y
    167167        fucompp
    168         fstsww  %ax
     168        fstsw   %ax
    169169        testb   $0x04, %ah
    170170        jnz     Lunordered              /* Unordered (at least one NaN) */
     
    243243        fldl    y(0)
    244244        fucompp
    245         fstsww  %ax
     245        fstsw   %ax
    246246        testb   $0x04, %ah
    247247        jnz     Lunordered              /* Unordered (at least one NaN) */
  • trunk/src/emx/src/lib/math/386/pow.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    3131        subl    $4, %esp
    3232        pushf                           /* Save flags */
    33         fstcww  cw_user
     33        fstcw   cw_user
    3434        movw    cw_user, %ax
    3535        orw     $0x0c00, %ax            /* Chop by truncating toward 0 */
     
    3737        FLD     y
    3838        fxam
    39         fstsww %ax
     39        fstsw  %ax
    4040        movb    %ah, %al
    4141        andb    $0x47, %al
     
    5555        FLD     x
    5656        fxam
    57         fstsww  %ax
     57        fstsw   %ax
    5858        movb    %ah, %al
    5959        andb    $0x47, %al
     
    8080        FLD     x
    8181        fcomps  Lone
    82         fnstsww %ax
     82        fnstsw  %ax
    8383        sahf
    8484        ja      Ldone
     
    210210        fabs
    211211        fcoms   Lone
    212         fnstsww %ax
     212        fnstsw  %ax
    213213        fstp    %st(0)
    214214        sahf
     
    227227        fabs
    228228        fcoms   Lone
    229         fnstsww %ax
     229        fnstsw  %ax
    230230        fstp    %st(0)                  /* Pop x */
    231231        sahf
     
    252252Lis_odd_int:
    253253        fld     %st                     /* st(0)=x, st(1)=x */
    254         fldcww  cw_chop
     254        fldcw   cw_chop
    255255        frndint                         /* st(0)=int(x), st(1)=x */
    256         fldcww  cw_user
     256        fldcw   cw_user
    257257        fcom    %st(1)
    258         fnstsww %ax
     258        fnstsw  %ax
    259259        sahf
    260260        jnz     Lnot_int                /* x not an integer */
    261261        fmuls   Lhalf                   /* st(0)=x/2, st(1)=x */
    262         fldcww  cw_chop
     262        fldcw   cw_chop
    263263        frndint
    264         fldcww  cw_user
     264        fldcw   cw_user
    265265        fmuls   Ltwo                    /* st(0)=2*(x/2), st(1)=x */
    266266        fcomp   %st(1)
    267         fnstsww %ax
     267        fnstsw  %ax
    268268        sahf
    269269        jnz     Lodd
     
    290290        j_inf   Lpower_overflow
    291291        fld     %st
    292         fldcww  cw_chop
     292        fldcw   cw_chop
    293293        frndint
    294         fldcww  cw_user
     294        fldcw   cw_user
    295295        fsubr   %st, %st(1)
    296296        fxch    %st(1)
     
    307307        fabs
    308308        fcomps  Lone
    309         fnstsww %ax
     309        fnstsw  %ax
    310310        sahf
    311311        ja      Lpower_ret
  • trunk/src/emx/src/lib/math/386/rint.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        PROFILE_NOFRAME
    2222        subl    $4, %esp
    23         fstcww  cw1
     23        fstcw   cw1
    2424        movw    cw1, %ax
    2525        andw    $0xf3ff, %ax            /* round to nearest or even */
    2626        movw    %ax, cw2
    27         fldcww  cw2
     27        fldcw   cw2
    2828        FLD     x                       /* x */
    2929        frndint
    30         fldcww  cw1
     30        fldcw   cw1
    3131        addl    $4, %esp
    3232        EPILOGUE(FUNC)
  • trunk/src/emx/src/lib/math/386/sin.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2020        FLD     x                       /* x */
    2121        fsin                            /* sin(x) */
    22         fstsww  %ax
     22        fstsw   %ax
    2323        testb   $0x04, %ah                             
    2424        jnz     Llarge                  /* C2 != 0 ? */
  • trunk/src/emx/src/lib/math/386/sinh.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2626        fldl2e                          /* log2 (e) */
    2727        fmulp                           /* y := x * log2 (e) */
    28         fstcww  cw1
     28        fstcw   cw1
    2929        movw    cw1, %ax
    3030        andw    $0xf3ff, %ax
    3131        orw     $0x0400, %ax            /* round down towards -inf */
    3232        movw    %ax, cw2
    33         fldcww  cw2     
     33        fldcw   cw2     
    3434        fld     %st                     /* y, y */
    3535        frndint                         /* int (y), y */
    36         fldcww  cw1
     36        fldcw   cw1
    3737        fxch    %st(1)                  /* y, int (y) */
    3838        fsub    %st(1), %st             /* frac (y), int (y) */
  • trunk/src/emx/src/lib/math/386/status.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    1414        PROFILE_NOFRAME
    1515        xor     %eax, %eax              /* Clear upper 16 bits */
    16         fstsww  %ax
     16        fstsw   %ax
    1717        EPILOGUE(_status87)
  • trunk/src/emx/src/lib/math/386/tan.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        fptan
    2222
    23 /* Note: fptan is followed by fstsww, avoiding a bug in the 486. */
     23/* Note: fptan is followed by fstsw , avoiding a bug in the 486. */
    2424
    25         fstsww  %ax
     25        fstsw   %ax
    2626        testb   $0x04, %ah
    2727        jnz     Llarge                  /* C2 != 0 ? */
  • trunk/src/emx/src/lib/math/386/tanh.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2727        fldl2e                          /* log2 (e) */
    2828        fmulp                           /* y := 2x * log2 (e) */
    29         fstcww  cw1
     29        fstcw   cw1
    3030        movw    cw1, %ax
    3131        andw    $0xf3ff, %ax
    3232        orw     $0x0400, %ax            /* round down towards -inf */
    3333        movw    %ax, cw2
    34         fldcww  cw2     
     34        fldcw   cw2     
    3535        fld     %st                     /* y, y */
    3636        frndint                         /* int (y), y */
    37         fldcww  cw1
     37        fldcw   cw1
    3838        fxch    %st(1)                  /* y, int (y) */
    3939        fsub    %st(1), %st             /* frac (y), int (y) */
  • trunk/src/emx/src/lib/math/386/trunc.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    2121        PROFILE_NOFRAME
    2222        subl    $4, %esp
    23         fstcww  cw1
     23        fstcw   cw1
    2424        movw    cw1, %ax
    2525        andw    $0xf3ff, %ax
    2626        orw     $0x0c00, %ax            /* chop by truncating toward 0 */
    2727        movw    %ax, cw2
    28         fldcww  cw2
     28        fldcw   cw2
    2929        FLD     x                       /* x */
    3030        frndint
    31         fldcww  cw1
     31        fldcw   cw1
    3232        addl    $4, %esp
    3333        EPILOGUE(FUNC)
  • trunk/src/emx/src/lib/misc/getopt.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    44#include <stdlib.h>
    55#include <string.h>
    6 #include <getopt.h>
     6#include <emx/getopt.h>
    77
    88char *_optarg          = NULL;
  • trunk/src/emx/src/regexp/regexp.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r93 r94  
    298298        register char *br;
    299299        register char *ender;
    300         register int parno;
     300        register int parno = 0;
    301301        int flags;
    302302
     
    914914                case WORDA:
    915915                        /* Must be looking at a letter, digit, or _ */
    916                         if ((!isalnum(*reginput)) && *reginput != '_')
     916                        if ((!isalnum(*(unsigned char *)reginput)) && *reginput != '_')
    917917                                return(0);
    918918                        /* Prev must be BOL or nonword */
    919919                        if (reginput > regbol &&
    920                             (isalnum(reginput[-1]) || reginput[-1] == '_'))
     920                            (isalnum(((unsigned char *)reginput)[-1]) || reginput[-1] == '_'))
    921921                                return(0);
    922922                        break;
    923923                case WORDZ:
    924924                        /* Must be looking at non letter, digit, or _ */
    925                         if (isalnum(*reginput) || *reginput == '_')
     925                        if (isalnum(*(unsigned char *)reginput) || *reginput == '_')
    926926                                return(0);
    927927                        /* We don't care what the previous char was */
Note: See TracChangeset for help on using the changeset viewer.