Print this page
9868 unused cw translations should be removed

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/cw/cw.c
          +++ new/usr/src/tools/cw/cw.c
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  
  31   31  /*
  32   32   * Wrapper for the GNU C compiler to make it accept the Sun C compiler
  33   33   * arguments where possible.
  34   34   *
  35   35   * Since the translation is inexact, this is something of a work-in-progress.
  36   36   *
  37   37   */
  38   38  
  39   39  /* If you modify this file, you must increment CW_VERSION */
  40      -#define CW_VERSION      "2.0"
       40 +#define CW_VERSION      "3.0"
  41   41  
  42   42  /*
  43   43   * -#           Verbose mode
  44   44   * -###         Show compiler commands built by driver, no compilation
  45   45   * -A<name[(tokens)]>   Preprocessor predicate assertion
  46   46   * -B<[static|dynamic]> Specify dynamic or static binding
  47   47   * -C           Prevent preprocessor from removing comments
  48   48   * -c           Compile only - produce .o files, suppress linking
  49   49   * -cg92        Alias for -xtarget=ss1000
  50   50   * -D<name[=token]>     Associate name with token as if by #define
  51   51   * -d[y|n]      dynamic [-dy] or static [-dn] option to linker
  52   52   * -E           Compile source through preprocessor only, output to stdout
  53   53   * -erroff=<t>  Suppress warnings specified by tags t(%none, %all, <tag list>)
  54   54   * -errtags=<a> Display messages with tags a(no, yes)
  55   55   * -errwarn=<t> Treats warnings specified by tags t(%none, %all, <tag list>)
  56   56   *              as errors
  57   57   * -fast        Optimize using a selection of options
  58   58   * -fd          Report old-style function definitions and declarations
  59      - * -features=zla        Allow zero-length arrays
  60      - * -flags       Show this summary of compiler options
  61   59   * -fnonstd     Initialize floating-point hardware to non-standard preferences
  62   60   * -fns[=<yes|no>] Select non-standard floating point mode
  63   61   * -fprecision=<p> Set FP rounding precision mode p(single, double, extended)
  64   62   * -fround=<r>  Select the IEEE rounding mode in effect at startup
  65   63   * -fsimple[=<n>] Select floating-point optimization preferences <n>
  66   64   * -fsingle     Use single-precision arithmetic (-Xt and -Xs modes only)
  67   65   * -ftrap=<t>   Select floating-point trapping mode in effect at startup
  68   66   * -fstore      force floating pt. values to target precision on assignment
  69   67   * -G           Build a dynamic shared library
  70   68   * -g           Compile for debugging
↓ open down ↓ 6 lines elided ↑ open up ↑
  77   75   * -Kpic        Compile position independent code
  78   76   * -L<dir>      Pass to linker to add <dir> to the library search path
  79   77   * -l<name>     Link with library lib<name>.a or lib<name>.so
  80   78   * -mc          Remove duplicate strings from .comment section of output files
  81   79   * -mr          Remove all strings from .comment section of output files
  82   80   * -mr,"string" Remove all strings and append "string" to .comment section
  83   81   * -mt          Specify options needed when compiling multi-threaded code
  84   82   * -native      Find available processor, generate code accordingly
  85   83   * -nofstore    Do not force floating pt. values to target precision
  86   84   *              on assignment
  87      - * -nolib       Same as -xnolib
  88      - * -noqueue     Disable queuing of compiler license requests
  89   85   * -norunpath   Do not build in a runtime path for shared libraries
  90   86   * -O           Use default optimization level (-xO2 or -xO3. Check man page.)
  91   87   * -o <outputfile> Set name of output file to <outputfile>
  92   88   * -P           Compile source through preprocessor only, output to .i  file
  93      - * -PIC         Alias for -KPIC or -xcode=pic32
  94   89   * -p           Compile for profiling with prof
  95      - * -pic         Alias for -Kpic or -xcode=pic13
  96   90   * -Q[y|n]      Emit/don't emit identification info to output file
  97      - * -qp          Compile for profiling with prof
  98   91   * -R<dir[:dir]> Build runtime search path list into executable
  99   92   * -S           Compile and only generate assembly code (.s)
 100   93   * -s           Strip symbol table from the executable file
 101   94   * -t           Turn off duplicate symbol warnings when linking
 102   95   * -U<name>     Delete initial definition of preprocessor symbol <name>
 103   96   * -V           Report version number of each compilation phase
 104   97   * -v           Do stricter semantic checking
 105   98   * -W<c>,<arg>  Pass <arg> to specified component <c> (a,l,m,p,0,2,h,i,u)
 106   99   * -w           Suppress compiler warning messages
 107  100   * -Xa          Compile assuming ANSI C conformance, allow K & R extensions
 108  101   *              (default mode)
 109      - * -Xc          Compile assuming strict ANSI C conformance
 110  102   * -Xs          Compile assuming (pre-ANSI) K & R C style code
 111  103   * -Xt          Compile assuming K & R conformance, allow ANSI C
 112      - * -x386        Generate code for the 80386 processor
 113      - * -x486        Generate code for the 80486 processor
 114  104   * -xarch=<a>   Specify target architecture instruction set
 115  105   * -xbuiltin[=<b>] When profitable inline, or substitute intrinisic functions
 116  106   *              for system functions, b={%all,%none}
 117  107   * -xCC         Accept C++ style comments
 118      - * -xchar_byte_order=<o> Specify multi-char byte order <o> (default, high, low)
 119  108   * -xchip=<c>   Specify the target processor for use by the optimizer
 120  109   * -xcode=<c>   Generate different code for forming addresses
 121  110   * -xcrossfile[=<n>] Enable optimization and inlining across source files,
 122  111   *              n={0|1}
 123  112   * -xe          Perform only syntax/semantic checking, no code generation
 124  113   * -xF          Compile for later mapfile reordering or unused section
 125  114   *              elimination
 126  115   * -xhelp=<f>   Display on-line help information f(flags, readme, errors)
 127  116   * -xildoff     Cancel -xildon
 128  117   * -xildon      Enable use of the incremental linker, ild
 129  118   * -xinline=[<a>,...,<a>]  Attempt inlining of specified user routines,
 130  119   *              <a>={%auto,func,no%func}
 131  120   * -xlibmieee   Force IEEE 754 return values for math routines in
 132  121   *              exceptional cases
 133  122   * -xlibmil     Inline selected libm math routines for optimization
 134  123   * -xlic_lib=sunperf    Link in the Sun supplied performance libraries
 135  124   * -xlicinfo    Show license server information
 136      - * -xM          Generate makefile dependencies
 137      - * -xM1         Generate makefile dependencies, but exclude /usr/include
 138  125   * -xmaxopt=[off,1,2,3,4,5] maximum optimization level allowed on #pragma opt
 139      - * -xnolib      Do not link with default system libraries
 140      - * -xnolibmil   Cancel -xlibmil on command line
 141  126   * -xO<n>       Generate optimized code (n={1|2|3|4|5})
 142  127   * -xP          Print prototypes for function definitions
 143      - * -xpentium    Generate code for the pentium processor
 144      - * -xpg         Compile for profiling with gprof
 145  128   * -xprofile=<p> Collect data for a profile or use a profile to optimize
 146  129   *              <p>={{collect,use}[:<path>],tcov}
 147  130   * -xregs=<r>   Control register allocation
 148  131   * -xs          Allow debugging without object (.o) files
 149  132   * -xsb         Compile for use with the WorkShop source browser
 150  133   * -xsbfast     Generate only WorkShop source browser info, no compilation
 151  134   * -xsfpconst   Represent unsuffixed floating point constants as single
 152  135   *              precision
 153  136   * -xspace      Do not do optimizations that increase code size
 154  137   * -xstrconst   Place string literals into read-only data segment
 155  138   * -xtarget=<t> Specify target system for optimization
 156  139   * -xtemp=<dir> Set directory for temporary files to <dir>
 157  140   * -xtime       Report the execution time for each compilation phase
 158      - * -xtransition Emit warnings for differences between K&R C and ANSI C
 159      - * -xtrigraphs[=<yes|no>] Enable|disable trigraph translation
 160  141   * -xunroll=n   Enable unrolling loops n times where possible
 161  142   * -Y<c>,<dir>  Specify <dir> for location of component <c> (a,l,m,p,0,h,i,u)
 162  143   * -YA,<dir>    Change default directory searched for components
 163  144   * -YI,<dir>    Change default directory searched for include files
 164  145   * -YP,<dir>    Change default directory for finding libraries files
 165  146   * -YS,<dir>    Change default directory for startup object files
 166  147   */
 167  148  
 168  149  /*
 169  150   * Translation table:
↓ open down ↓ 7 lines elided ↑ open up ↑
 177  158   * -c                           pass-thru
 178  159   * -cg92                        -m32 -mcpu=v8 -mtune=supersparc (SPARC only)
 179  160   * -D<name[=token]>             pass-thru
 180  161   * -dy or -dn                   -Wl,-dy or -Wl,-dn
 181  162   * -E                           pass-thru
 182  163   * -erroff=E_EMPTY_TRANSLATION_UNIT ignore
 183  164   * -errtags=%all                -Wall
 184  165   * -errwarn=%all                -Werror else -Wno-error
 185  166   * -fast                        error
 186  167   * -fd                          error
 187      - * -features=zla                ignore
 188      - * -flags                       --help
 189  168   * -fnonstd                     error
 190  169   * -fns[=<yes|no>]              error
 191  170   * -fprecision=<p>              error
 192  171   * -fround=<r>                  error
 193  172   * -fsimple[=<n>]               error
 194  173   * -fsingle[=<n>]               error
 195  174   * -ftrap=<t>                   error
 196  175   * -fstore                      error
 197  176   * -G                           pass-thru
 198  177   * -g                           pass-thru
↓ open down ↓ 6 lines elided ↑ open up ↑
 205  184   * -Kpic                        -fpic
 206  185   * -L<dir>                      pass-thru
 207  186   * -l<name>                     pass-thru
 208  187   * -mc                          error
 209  188   * -mr                          error
 210  189   * -mr,"string"                 error
 211  190   * -mt                          -D_REENTRANT
 212  191   * -native                      error
 213  192   * -nofstore                    error
 214  193   * -nolib                       -nodefaultlibs
 215      - * -noqueue                     ignore
 216  194   * -norunpath                   ignore
 217  195   * -O                           -O1 (Check the man page to be certain)
 218  196   * -o <outputfile>              pass-thru
 219  197   * -P                           -E -o filename.i (or error)
 220      - * -PIC                         -fPIC (C++ only)
 221  198   * -p                           pass-thru
 222      - * -pic                         -fpic (C++ only)
 223  199   * -Q[y|n]                      error
 224      - * -qp                          -p
 225  200   * -R<dir[:dir]>                pass-thru
 226  201   * -S                           pass-thru
 227  202   * -s                           -Wl,-s
 228  203   * -t                           -Wl,-t
 229  204   * -U<name>                     pass-thru
 230  205   * -V                           --version
 231  206   * -v                           -Wall
 232  207   * -Wa,<arg>                    pass-thru
 233  208   * -Wp,<arg>                    pass-thru except -xc99=<a>
 234  209   * -Wl,<arg>                    pass-thru
 235  210   * -W{m,0,2,h,i,u>              error/ignore
 236      - * -Wu,-xmodel=kernel           -ffreestanding -mcmodel=kernel -mno-red-zone
 237  211   * -xmodel=kernel               -ffreestanding -mcmodel=kernel -mno-red-zone
 238  212   * -Wu,-save_args               -msave-args
 239  213   * -w                           pass-thru
 240  214   * -Xa                          -std=iso9899:199409 or -ansi
 241      - * -Xc                          -ansi -pedantic
 242  215   * -Xt                          error
 243  216   * -Xs                          -traditional -std=c89
 244      - * -x386                        -march=i386 (x86 only)
 245      - * -x486                        -march=i486 (x86 only)
 246  217   * -xarch=<a>                   table
 247  218   * -xbuiltin[=<b>]              -fbuiltin (-fno-builtin otherwise)
 248  219   * -xCC                         ignore
 249      - * -xchar_byte_order=<o>        error
 250  220   * -xchip=<c>                   table
 251  221   * -xcode=<c>                   table
 252  222   * -xdebugformat=<format>       ignore (always use dwarf-2 for gcc)
 253  223   * -xcrossfile[=<n>]            ignore
 254  224   * -xe                          error
 255  225   * -xF                          error
 256  226   * -xhelp=<f>                   error
 257  227   * -xildoff                     ignore
 258  228   * -xildon                      ignore
 259  229   * -xinline                     ignore
 260  230   * -xlibmieee                   error
 261  231   * -xlibmil                     error
 262  232   * -xlic_lib=sunperf            error
 263      - * -xM                          -M
 264      - * -xM1                         -MM
 265  233   * -xmaxopt=[...]               error
 266      - * -xnolib                      -nodefaultlibs
 267      - * -xnolibmil                   error
 268  234   * -xO<n>                       -O<n>
 269  235   * -xP                          error
 270      - * -xpentium                    -march=pentium (x86 only)
 271      - * -xpg                         error
 272  236   * -xprofile=<p>                error
 273  237   * -xregs=<r>                   table
 274  238   * -xs                          error
 275  239   * -xsb                         error
 276  240   * -xsbfast                     error
 277  241   * -xsfpconst                   error
 278  242   * -xspace                      ignore (-not -Os)
 279  243   * -xstrconst                   ignore
 280  244   * -xtarget=<t>                 table
 281  245   * -xtemp=<dir>                 error
 282  246   * -xtime                       error
 283  247   * -xtransition                 -Wtransition
 284      - * -xtrigraphs=<yes|no>         -trigraphs -notrigraphs
 285  248   * -xunroll=n                   error
 286  249   * -W0,-xdbggen=no%usedonly     -fno-eliminate-unused-debug-symbols
 287  250   *                              -fno-eliminate-unused-debug-types
 288  251   * -Y<c>,<dir>                  error
 289  252   * -YA,<dir>                    error
 290  253   * -YI,<dir>                    -nostdinc -I<dir>
 291  254   * -YP,<dir>                    error
 292  255   * -YS,<dir>                    error
 293  256   */
 294  257  
↓ open down ↓ 225 lines elided ↑ open up ↑
 520  483          }
 521  484  }
 522  485  
 523  486  /* ARGSUSED */
 524  487  static void
 525  488  Xamode(struct aelist __unused *h)
 526  489  {
 527  490  }
 528  491  
 529  492  static void
 530      -Xcmode(struct aelist *h)
 531      -{
 532      -        static int xconce;
 533      -
 534      -        if (xconce++)
 535      -                return;
 536      -
 537      -        newae(h, "-ansi");
 538      -        newae(h, "-pedantic-errors");
 539      -}
 540      -
 541      -static void
 542  493  Xsmode(struct aelist *h)
 543  494  {
 544  495          static int xsonce;
 545  496  
 546  497          if (xsonce++)
 547  498                  return;
 548  499  
 549  500          newae(h, "-traditional");
 550  501          newae(h, "-traditional-cpp");
 551  502  }
↓ open down ↓ 160 lines elided ↑ open up ↑
 712  663                                          error(arg);
 713  664                                  ctx->i_oldargc -= 2;
 714  665                                  ctx->i_oldargv += 2;
 715  666                                  continue;
 716  667                          }
 717  668                          if (strcmp(arg, "-xwe") == 0) {
 718  669                                  /* turn warnings into errors */
 719  670                                  newae(ctx->i_ae, "-Werror");
 720  671                                  continue;
 721  672                          }
 722      -                        if (strcmp(arg, "-noex") == 0) {
 723      -                                /* no exceptions */
 724      -                                newae(ctx->i_ae, "-fno-exceptions");
 725      -                                /* no run time type descriptor information */
 726      -                                newae(ctx->i_ae, "-fno-rtti");
 727      -                                continue;
 728      -                        }
 729      -                        if (strcmp(arg, "-pic") == 0) {
 730      -                                newae(ctx->i_ae, "-fpic");
 731      -                                pic = 1;
 732      -                                continue;
 733      -                        }
 734      -                        if (strcmp(arg, "-PIC") == 0) {
 735      -                                newae(ctx->i_ae, "-fPIC");
 736      -                                pic = 1;
 737      -                                continue;
 738      -                        }
 739  673                          if (strcmp(arg, "-norunpath") == 0) {
 740  674                                  /* gcc has no corresponding option */
 741  675                                  continue;
 742  676                          }
 743  677                          if (strcmp(arg, "-nolib") == 0) {
 744  678                                  /* -nodefaultlibs is on by default */
 745  679                                  nolibc = 1;
 746  680                                  continue;
 747  681                          }
 748  682  #if defined(__sparc)
↓ open down ↓ 118 lines elided ↑ open up ↑
 867  801                          if (strcmp(arg, "-errtags=yes") == 0) {
 868  802                                  warnings(ctx->i_ae);
 869  803                                  break;
 870  804                          }
 871  805                          if (strcmp(arg, "-errwarn=%all") == 0) {
 872  806                                  newae(ctx->i_ae, "-Werror");
 873  807                                  break;
 874  808                          }
 875  809                          error(arg);
 876  810                          break;
 877      -                case 'f':
 878      -                        if (strcmp(arg, "-flags") == 0) {
 879      -                                newae(ctx->i_ae, "--help");
 880      -                                break;
 881      -                        }
 882      -                        if (strncmp(arg, "-features=zla", 13) == 0) {
 883      -                                /*
 884      -                                 * Accept but ignore this -- gcc allows
 885      -                                 * zero length arrays.
 886      -                                 */
 887      -                                break;
 888      -                        }
 889      -                        error(arg);
 890      -                        break;
 891  811                  case 'G':
 892  812                          newae(ctx->i_ae, "-shared");
 893  813                          nolibc = 1;
 894  814                          break;
 895  815                  case 'k':
 896  816                          if (strcmp(arg, "-keeptmp") == 0) {
 897  817                                  newae(ctx->i_ae, "-save-temps");
 898  818                                  break;
 899  819                          }
 900  820                          error(arg);
↓ open down ↓ 56 lines elided ↑ open up ↑
 957  877                                          opt = arg + 2;
 958  878                                  }
 959  879                                  len = strlen(opt) + 7;
 960  880                                  if ((s = malloc(len)) == NULL)
 961  881                                          nomem();
 962  882                                  (void) snprintf(s, len, "-Wl,-%c%s", c, opt);
 963  883                                  newae(ctx->i_ae, s);
 964  884                                  free(s);
 965  885                          }
 966  886                          break;
 967      -                case 'n':
 968      -                        if (strcmp(arg, "-noqueue") == 0) {
 969      -                                /*
 970      -                                 * Horrid license server stuff - n/a
 971      -                                 */
 972      -                                break;
 973      -                        }
 974      -                        error(arg);
 975      -                        break;
 976  887                  case 'O':
 977  888                          if (arglen == 1) {
 978  889                                  newae(ctx->i_ae, "-O");
 979  890                                  break;
 980  891                          }
 981  892                          error(arg);
 982  893                          break;
 983  894                  case 'P':
 984  895                          /*
 985  896                           * We could do '-E -o filename.i', but that's hard,
 986  897                           * and we don't need it for the case that's triggering
 987  898                           * this addition.  We'll require the user to specify
 988  899                           * -o in the Makefile.  If they don't they'll find out
 989  900                           * in a hurry.
 990  901                           */
 991  902                          newae(ctx->i_ae, "-E");
 992  903                          op = CW_O_PREPROCESS;
 993  904                          nolibc = 1;
 994  905                          break;
 995      -                case 'q':
 996      -                        if (strcmp(arg, "-qp") == 0) {
 997      -                                newae(ctx->i_ae, "-p");
 998      -                                break;
 999      -                        }
1000      -                        error(arg);
1001      -                        break;
1002  906                  case 's':
1003  907                          if (arglen == 1) {
1004  908                                  newae(ctx->i_ae, "-Wl,-s");
1005  909                                  break;
1006  910                          }
1007  911                          error(arg);
1008  912                          break;
1009  913                  case 't':
1010  914                          if (arglen == 1) {
1011  915                                  newae(ctx->i_ae, "-Wl,-t");
↓ open down ↓ 23 lines elided ↑ open up ↑
1035  939                                   * regardless, so accept and ignore.
1036  940                                   */
1037  941                                  break;
1038  942                          }
1039  943                          if (strncmp(arg, "-Wa,", 4) == 0 ||
1040  944                              strncmp(arg, "-Wp,", 4) == 0 ||
1041  945                              strncmp(arg, "-Wl,", 4) == 0) {
1042  946                                  newae(ctx->i_ae, arg);
1043  947                                  break;
1044  948                          }
1045      -                        if (strcmp(arg, "-W0,-xc99=pragma") == 0) {
1046      -                                /* (undocumented) enables _Pragma */
1047      -                                break;
1048      -                        }
1049      -                        if (strcmp(arg, "-W0,-xc99=%none") == 0) {
1050      -                                /*
1051      -                                 * This is a polite way of saying
1052      -                                 * "no c99 constructs allowed!"
1053      -                                 * For now, just accept and ignore this.
1054      -                                 */
1055      -                                break;
1056      -                        }
1057  949                          if (strcmp(arg, "-W0,-noglobal") == 0 ||
1058  950                              strcmp(arg, "-W0,-xglobalstatic") == 0) {
1059  951                                  /*
1060  952                                   * gcc doesn't prefix local symbols
1061  953                                   * in debug mode, so this is not needed.
1062  954                                   */
1063  955                                  break;
1064  956                          }
1065  957                          if (strcmp(arg, "-W0,-Lt") == 0) {
1066  958                                  /*
↓ open down ↓ 10 lines elided ↑ open up ↑
1077  969                                  break;
1078  970                          }
1079  971                          if (strcmp(arg, "-W2,-xwrap_int") == 0) {
1080  972                                  /*
1081  973                                   * Use the legacy behaviour (pre-SS11)
1082  974                                   * for integer wrapping.
1083  975                                   * gcc does not need this.
1084  976                                   */
1085  977                                  break;
1086  978                          }
1087      -                        if (strcmp(arg, "-W2,-Rcond_elim") == 0) {
1088      -                                /*
1089      -                                 * Elimination and expansion of conditionals;
1090      -                                 * gcc has no direct equivalent.
1091      -                                 */
1092      -                                break;
1093      -                        }
1094  979                          if (strcmp(arg, "-Wd,-xsafe=unboundsym") == 0) {
1095  980                                  /*
1096  981                                   * Prevents optimizing away checks for
1097  982                                   * unbound weak symbol addresses.  gcc does
1098  983                                   * not do this, so it's not needed.
1099  984                                   */
1100  985                                  break;
1101  986                          }
1102  987                          if (strncmp(arg, "-Wc,-xcode=", 11) == 0) {
1103  988                                  xlate(ctx->i_ae, arg + 11, xcode_tbl);
↓ open down ↓ 9 lines elided ↑ open up ↑
1113  998                                  break;
1114  999                          }
1115 1000                          if (strcmp(arg, "-Wc,-Qassembler-ounrefsym=0") == 0) {
1116 1001                                  /*
1117 1002                                   * Prevents optimizing away of static variables.
1118 1003                                   * gcc does not do this, so it's not needed.
1119 1004                                   */
1120 1005                                  break;
1121 1006                          }
1122 1007  #if defined(__x86)
1123      -                        if (strcmp(arg, "-Wu,-xmodel=kernel") == 0) {
1124      -                                newae(ctx->i_ae, "-ffreestanding");
1125      -                                newae(ctx->i_ae, "-mno-red-zone");
1126      -                                model = "-mcmodel=kernel";
1127      -                                nolibc = 1;
1128      -                                break;
1129      -                        }
1130 1008                          if (strcmp(arg, "-Wu,-save_args") == 0) {
1131 1009                                  newae(ctx->i_ae, "-msave-args");
1132 1010                                  break;
1133 1011                          }
1134 1012  #endif  /* __x86 */
1135 1013                          error(arg);
1136 1014                          break;
1137 1015                  case 'X':
1138 1016                          if (strcmp(arg, "-Xa") == 0 ||
1139 1017                              strcmp(arg, "-Xt") == 0) {
1140 1018                                  Xamode(ctx->i_ae);
1141 1019                                  break;
1142 1020                          }
1143      -                        if (strcmp(arg, "-Xc") == 0) {
1144      -                                Xcmode(ctx->i_ae);
1145      -                                break;
1146      -                        }
1147 1021                          if (strcmp(arg, "-Xs") == 0) {
1148 1022                                  Xsmode(ctx->i_ae);
1149 1023                                  break;
1150 1024                          }
1151 1025                          error(arg);
1152 1026                          break;
1153 1027                  case 'x':
1154 1028                          if (arglen == 1)
1155 1029                                  error(arg);
1156 1030                          switch (arg[2]) {
1157      -#if defined(__x86)
1158      -                        case '3':
1159      -                                if (strcmp(arg, "-x386") == 0) {
1160      -                                        newae(ctx->i_ae, "-march=i386");
1161      -                                        break;
1162      -                                }
1163      -                                error(arg);
1164      -                                break;
1165      -                        case '4':
1166      -                                if (strcmp(arg, "-x486") == 0) {
1167      -                                        newae(ctx->i_ae, "-march=i486");
1168      -                                        break;
1169      -                                }
1170      -                                error(arg);
1171      -                                break;
1172      -#endif  /* __x86 */
1173 1031                          case 'a':
1174 1032                                  if (strncmp(arg, "-xarch=", 7) == 0) {
1175 1033                                          mflag |= xlate_xtb(ctx->i_ae, arg + 7);
1176 1034                                          break;
1177 1035                                  }
1178 1036                                  error(arg);
1179 1037                                  break;
1180 1038                          case 'b':
1181 1039                                  if (strncmp(arg, "-xbuiltin=", 10) == 0) {
1182 1040                                          if (strcmp(arg + 10, "%all"))
↓ open down ↓ 20 lines elided ↑ open up ↑
1203 1061                                  if (strncmp(arg, "-xchip=", 7) == 0) {
1204 1062                                          xlate(ctx->i_ae, arg + 7, xchip_tbl);
1205 1063                                          break;
1206 1064                                  }
1207 1065                                  if (strncmp(arg, "-xcode=", 7) == 0) {
1208 1066                                          xlate(ctx->i_ae, arg + 7, xcode_tbl);
1209 1067                                          if (strncmp(arg + 7, "pic", 3) == 0)
1210 1068                                                  pic = 1;
1211 1069                                          break;
1212 1070                                  }
1213      -                                if (strncmp(arg, "-xcache=", 8) == 0)
1214      -                                        break;
1215 1071                                  if (strncmp(arg, "-xcrossfile", 11) == 0)
1216 1072                                          break;
1217 1073                                  error(arg);
1218 1074                                  break;
1219 1075                          case 'd':
1220      -                                if (strcmp(arg, "-xdepend") == 0)
1221      -                                        break;
1222 1076                                  if (strncmp(arg, "-xdebugformat=", 14) == 0)
1223 1077                                          break;
1224 1078                                  error(arg);
1225 1079                                  break;
1226 1080                          case 'F':
1227 1081                                  /*
1228 1082                                   * Compile for mapfile reordering, or unused
1229 1083                                   * section elimination, syntax can be -xF or
1230 1084                                   * more complex, like -xF=%all -- ignore.
1231 1085                                   */
↓ open down ↓ 16 lines elided ↑ open up ↑
1248 1102                                  if (strcmp(arg, "-xmodel=kernel") == 0) {
1249 1103                                          newae(ctx->i_ae, "-ffreestanding");
1250 1104                                          newae(ctx->i_ae, "-mno-red-zone");
1251 1105                                          model = "-mcmodel=kernel";
1252 1106                                          nolibc = 1;
1253 1107                                          break;
1254 1108                                  }
1255 1109                                  error(arg);
1256 1110                                  break;
1257 1111  #endif  /* __x86 */
1258      -                        case 'M':
1259      -                                if (strcmp(arg, "-xM") == 0) {
1260      -                                        newae(ctx->i_ae, "-M");
1261      -                                        break;
1262      -                                }
1263      -                                if (strcmp(arg, "-xM1") == 0) {
1264      -                                        newae(ctx->i_ae, "-MM");
1265      -                                        break;
1266      -                                }
1267      -                                error(arg);
1268      -                                break;
1269      -                        case 'n':
1270      -                                if (strcmp(arg, "-xnolib") == 0) {
1271      -                                        nolibc = 1;
1272      -                                        break;
1273      -                                }
1274      -                                error(arg);
1275      -                                break;
1276 1112                          case 'O':
1277 1113                                  if (strncmp(arg, "-xO", 3) == 0) {
1278 1114                                          size_t len = strlen(arg);
1279 1115                                          char *s = NULL;
1280 1116                                          int c = *(arg + 3);
1281 1117                                          int level;
1282 1118  
1283 1119                                          if (len != 4 || !isdigit(c))
1284 1120                                                  error(arg);
1285 1121  
↓ open down ↓ 13 lines elided ↑ open up ↑
1299 1135                                                  level = 2;
1300 1136                                          }
1301 1137                                          if (asprintf(&s, "-O%d", level) == -1)
1302 1138                                                  nomem();
1303 1139                                          newae(ctx->i_ae, s);
1304 1140                                          free(s);
1305 1141                                          break;
1306 1142                                  }
1307 1143                                  error(arg);
1308 1144                                  break;
1309      -                        case 'p':
1310      -                                if (strcmp(arg, "-xpentium") == 0) {
1311      -                                        newae(ctx->i_ae, "-march=pentium");
1312      -                                        break;
1313      -                                }
1314      -                                if (strcmp(arg, "-xpg") == 0) {
1315      -                                        newae(ctx->i_ae, "-pg");
1316      -                                        break;
1317      -                                }
1318      -                                error(arg);
1319      -                                break;
1320 1145                          case 'r':
1321 1146                                  if (strncmp(arg, "-xregs=", 7) == 0) {
1322 1147                                          xlate(ctx->i_ae, arg + 7, xregs_tbl);
1323 1148                                          break;
1324 1149                                  }
1325 1150                                  error(arg);
1326 1151                                  break;
1327 1152                          case 's':
1328 1153                                  if (strcmp(arg, "-xs") == 0 ||
1329 1154                                      strcmp(arg, "-xspace") == 0 ||
1330 1155                                      strcmp(arg, "-xstrconst") == 0)
1331 1156                                          break;
1332 1157                                  error(arg);
1333 1158                                  break;
1334 1159                          case 't':
1335      -                                if (strcmp(arg, "-xtransition") == 0) {
1336      -                                        newae(ctx->i_ae, "-Wtransition");
1337      -                                        break;
1338      -                                }
1339      -                                if (strcmp(arg, "-xtrigraphs=yes") == 0) {
1340      -                                        newae(ctx->i_ae, "-trigraphs");
1341      -                                        break;
1342      -                                }
1343      -                                if (strcmp(arg, "-xtrigraphs=no") == 0) {
1344      -                                        newae(ctx->i_ae, "-notrigraphs");
1345      -                                        break;
1346      -                                }
1347 1160                                  if (strncmp(arg, "-xtarget=", 9) == 0) {
1348 1161                                          xlate(ctx->i_ae, arg + 9, xtarget_tbl);
1349 1162                                          break;
1350 1163                                  }
1351 1164                                  error(arg);
1352 1165                                  break;
1353 1166                          case 'e':
1354 1167                          case 'h':
1355 1168                          case 'l':
1356 1169                          default:
↓ open down ↓ 567 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX