Print this page
10051 cw(1) shouldn't have to translate -g

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      "3.0"
       40 +#define CW_VERSION      "4.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
↓ open down ↓ 157 lines elided ↑ open up ↑
 208  208   * -Wu,-save_args               -msave-args
 209  209   * -w                           pass-thru
 210  210   * -Xa                          -std=iso9899:199409 or -ansi
 211  211   * -Xt                          error
 212  212   * -Xs                          -traditional -std=c89
 213  213   * -xarch=<a>                   table
 214  214   * -xbuiltin[=<b>]              -fbuiltin (-fno-builtin otherwise)
 215  215   * -xCC                         ignore
 216  216   * -xchip=<c>                   table
 217  217   * -xcode=<c>                   table
 218      - * -xdebugformat=<format>       ignore (always use dwarf-2 for gcc)
 219  218   * -xcrossfile[=<n>]            ignore
 220  219   * -xe                          error
 221  220   * -xF                          error
 222  221   * -xhelp=<f>                   error
 223  222   * -xildoff                     ignore
 224  223   * -xildon                      ignore
 225  224   * -xinline                     ignore
 226  225   * -xlibmieee                   error
 227  226   * -xlibmil                     error
 228  227   * -xlic_lib=sunperf            error
↓ open down ↓ 496 lines elided ↑ open up ↑
 725  724                          error(arg);
 726  725                          break;
 727  726                  case 'f':
 728  727                          if ((strcmp(arg, "-fpic") == 0) ||
 729  728                              (strcmp(arg, "-fPIC") == 0)) {
 730  729                                  newae(ctx->i_ae, arg);
 731  730                                  break;
 732  731                          }
 733  732                          error(arg);
 734  733                          break;
 735      -                case 'g':
 736      -                        newae(ctx->i_ae, "-gdwarf-2");
 737      -                        break;
 738  734                  case 'E':
 739  735                          if (arglen == 1) {
 740  736                                  newae(ctx->i_ae, "-xc");
 741  737                                  newae(ctx->i_ae, arg);
 742  738                                  op = CW_O_PREPROCESS;
 743  739                                  nolibc = 1;
 744  740                                  break;
 745  741                          }
 746  742                          error(arg);
 747  743                          break;
↓ open down ↓ 7 lines elided ↑ open up ↑
 755  751                  case 'C':
 756  752                  case 'H':
 757  753                  case 'p':
 758  754                          if (arglen == 1) {
 759  755                                  newae(ctx->i_ae, arg);
 760  756                                  break;
 761  757                          }
 762  758                          error(arg);
 763  759                          break;
 764  760                  case 'A':
      761 +                case 'g':
 765  762                  case 'h':
 766  763                  case 'I':
 767  764                  case 'i':
 768  765                  case 'L':
 769  766                  case 'l':
 770  767                  case 'R':
 771  768                  case 'U':
 772  769                  case 'u':
 773  770                  case 'w':
 774  771                          newae(ctx->i_ae, arg);
↓ open down ↓ 291 lines elided ↑ open up ↑
1066 1063                                  }
1067 1064                                  if (strncmp(arg, "-xchip=", 7) == 0) {
1068 1065                                          xlate(ctx->i_ae, arg + 7, xchip_tbl);
1069 1066                                          break;
1070 1067                                  }
1071 1068                                  if (strncmp(arg, "-xcode=", 7) == 0) {
1072 1069                                          xlate(ctx->i_ae, arg + 7, xcode_tbl);
1073 1070                                          break;
1074 1071                                  }
1075 1072                                  if (strncmp(arg, "-xcrossfile", 11) == 0)
1076      -                                        break;
1077      -                                error(arg);
1078      -                                break;
1079      -                        case 'd':
1080      -                                if (strncmp(arg, "-xdebugformat=", 14) == 0)
1081 1073                                          break;
1082 1074                                  error(arg);
1083 1075                                  break;
1084 1076                          case 'F':
1085 1077                                  /*
1086 1078                                   * Compile for mapfile reordering, or unused
1087 1079                                   * section elimination, syntax can be -xF or
1088 1080                                   * more complex, like -xF=%all -- ignore.
1089 1081                                   */
1090 1082                                  if (strncmp(arg, "-xF", 3) == 0)
↓ open down ↓ 668 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX