Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.13
 
1.14
 
MAIN:ragge:20040612140703
 
cc.c
_>5353 char *cppadd[] = {
 5454         "-D__NetBSD__", "-D__PCC__=1", "-D__PCC_MINOR__=0",
 5555         "-D__ELF__", "-Asystem(unix)", "-Asystem(NetBSD)", "-Acpu(i386)",
<>56 -        "-Amachine(i386)", "-D__i386__", "-D__OPTIMIZE__", "-Di386",
 57 -        "-nostdinc", "-I/usr/include", NULL,
  56+        "-Amachine(i386)", "-D__i386__", "-D__OPTIMIZE__", "-Di386", NULL,
5857 };
 5958 #endif
 6059 
 6160 #define SBSIZE 10000
 6261 #define MAXINC 100
 6362 #define MAXFIL 100
 6463 #define MAXLIB 10000
<> 64+#define MAXAV  10000
6565 #define MAXOPT 100
 6666 char    *tmp0;
 6767 char    *tmp1;
     
 !
8383 char    ts[CHSPACE+50];
 8484 char    *tsa = ts;
 8585 char    *tsp = ts;
<>86 -char    *av[50];
  86+char    *av[MAXAV];
8787 char    *clist[MAXFIL];
 8888 char    *llist[MAXLIB];
 8989 char    alist[20];
     
 !
102102 int     noflflag;
 103103 int     exfail;
 104104 int     Xflag;
<> 105+int     nostartfiles, Bstatic;
  106+
105107 char    *pass0 = "/lib/ccom";
 106108 char    *passp = "/usr/libexec/cpp0";
 107109 char    *pref = "/usr/lib/crt0.o";
<> 110+char    *dynlinker = "/usr/libexec/ld.elf_so";
108111 
 109112 int
 110113 main(argc, argv)
     
 !
127130                         break;
 128131                 case 'W': /* Ignore W-flags */
 129132                 case 'f': /* Ignore -ffreestanding */
<>130 -                case 'n': /* Ignore -nostdinc */
131133                         break;
<> 134+
  135+                case 'n': /* handle -n flags */
  136+                        if (strcmp(argv[i], "-nostdinc") == 0)
  137+                                goto diuc;
  138+                        else if (strcmp(argv[i], "-nostartfiles") == 0)
  139+                                nostartfiles = 1;
  140+                        else
  141+                                goto passa;
  142+                        break;
  143+
132144                 case 'x':
 133145                         xflag++;
 134146                         i++; /* skip args */
     
 !
180192                 case 'I':
 181193                 case 'U':
 182194                 case 'C':
<>183 -                        *pv++ = argv[i];
  195+diuc:                   *pv++ = argv[i];
184196                         if (pv >= ptemp+MAXOPT)
 185197                                 {
 186198                                 error("Too many DIUC options", 0);
     
 !
195207                 case 'v':
 196208                         vflag++;
 197209                         break;
<> 210+
  211+                case 's':
  212+                        if (strcmp(argv[i], "-static") == 0)
  213+                                Bstatic = 1;
  214+                        else
  215+                                goto passa;
  216+                        break;
  217+
198218                 } else {
 199219                 passa:
 200220                         t = argv[i];
     
 !
336356                 av[j++] = "-d";
 337357                 av[j++] = "-e";
 338358                 av[j++] = "__start";
<>339 -                av[j++] = "-static";
  359+                if (Bstatic == 0) { /* Dynamic linkage */
  360+                        av[j++] = "-dynamic-linker";
  361+                        av[j++] = dynlinker;
  362+                }
340363                 if (outfile) {
 341364                         av[j++] = "-o";
 342365                         av[j++] = outfile;
 343366                 }
<>344 -                av[j++] = pref;
 345 -                av[j++] = "/usr/lib/crti.o";
 346 -                av[j++] = "/usr/lib/crtbegin.o";
 347 -                while(i<nl)
  367+                if (!nostartfiles) {
  368+                        av[j++] = pref;
  369+                        av[j++] = "/usr/lib/crti.o";
  370+                        av[j++] = "/usr/lib/crtbegin.o";
  371+                }
  372+                while(i<nl) {
348373                         av[j++] = llist[i++];
<> 374+                        if (j >= MAXAV)
  375+                                error("Too many ld options", 0);
  376+                }
349377 #if 0
 350378                 if (gflag)
 351379                         av[j++] = "-lg";
 352380 #endif
 353381                 av[j++] = "-lc";
<>354 -                av[j++] = "/usr/lib/crtend.o";
 355 -                av[j++] = "/usr/lib/crtn.o";
  382+                if (!nostartfiles) {
  383+                        av[j++] = "/usr/lib/crtend.o";
  384+                        av[j++] = "/usr/lib/crtn.o";
  385+                }
<_356386                 if(f20)
 357387                         av[j++] = "-l2";
 358388                 av[j++] = 0;
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-30 21:53 +0200