Skip to content

Commit 0c54225

Browse files
committed
remove nacl
The recent linker changes broke NaCl support a month ago, and there are no known users of it. The NaCl code can always be recovered from the repository history. R=adg, r CC=golang-dev https://golang.org/cl/3671042
1 parent 85f5bb8 commit 0c54225

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+22
-13668
lines changed

doc/devel/roadmap.html

-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ <h3 id="done">Done</h3>
8989
<li>
9090
Gccgo: garbage collection.
9191
<li>
92-
Native Client (NaCl) support.
93-
<li>
9492
SWIG support.
9593
<li>
9694
Simpler semicolon rules.

doc/install.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h2 id="introduction">Introduction</h2>
6262
</p>
6363

6464
<p>
65-
The compilers can target the FreeBSD, Linux, Native Client,
65+
The compilers can target the FreeBSD, Linux,
6666
and OS X (a.k.a. Darwin) operating systems.
6767
(A port to Microsoft Windows is in progress but incomplete. See the
6868
<a href="http://code.google.com/p/go/wiki/WindowsPort">Windows Port</a>
@@ -340,7 +340,6 @@ <h2 id="environment">Environment variables</h2>
340340
Choices for <code>$GOOS</code> are <code>linux</code>,
341341
<code>freebsd</code>,
342342
<code>darwin</code> (Mac OS X 10.5 or 10.6),
343-
<code>nacl</code> (Native Client, an incomplete port),
344343
and <code>windows</code> (Windows, an incomplete port).
345344
Choices for <code>$GOARCH</code> are <code>amd64</code> (64-bit x86, the most mature port),
346345
<code>386</code> (32-bit x86), and
@@ -372,9 +371,6 @@ <h2 id="environment">Environment variables</h2>
372371
<td></td><td><code>linux</code></td> <td><code>arm</code></td> <td><i>incomplete</i></td>
373372
</tr>
374373
<tr>
375-
<td></td><td><code>nacl</code></td> <td><code>386</code></td>
376-
</tr>
377-
<tr>
378374
<td></td><td><code>windows</code></td> <td><code>386</code></td> <td><i>incomplete</i></td>
379375
</tr>
380376
</table>

src/Make.inc

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ endif
3232
ifeq ($(GOOS),darwin)
3333
else ifeq ($(GOOS),freebsd)
3434
else ifeq ($(GOOS),linux)
35-
else ifeq ($(GOOS),nacl)
3635
else ifeq ($(GOOS),tiny)
3736
else ifeq ($(GOOS),plan9)
3837
else ifeq ($(GOOS),windows)
3938
else
40-
$(error Invalid $$GOOS '$(GOOS)'; must be darwin, freebsd, linux, nacl, tiny, plan9, or windows)
39+
$(error Invalid $$GOOS '$(GOOS)'; must be darwin, freebsd, linux, plan9, tiny, or windows)
4140
endif
4241

4342
ifeq ($(GOHOSTARCH),)

src/all-nacl.bash

-48
This file was deleted.

src/cmd/5l/asm.c

-2
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,6 @@ asmb(void)
535535

536536
for(sect=segtext.sect; sect!=nil; sect=sect->next)
537537
elfshbits(sect);
538-
for(sect=segrodata.sect; sect!=nil; sect=sect->next)
539-
elfshbits(sect);
540538
for(sect=segdata.sect; sect!=nil; sect=sect->next)
541539
elfshbits(sect);
542540

src/cmd/6l/asm.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ addpltsym(Sym *s)
415415
static void
416416
addgotsym(Sym *s)
417417
{
418-
Sym *got, *rela, *indir;
418+
Sym *got, *rela;
419419

420420
if(s->got >= 0)
421421
return;
@@ -976,8 +976,6 @@ asmb(void)
976976
diag("elftextsh = %d, want %d", elftextsh, eh->shnum);
977977
for(sect=segtext.sect; sect!=nil; sect=sect->next)
978978
elfshbits(sect);
979-
for(sect=segrodata.sect; sect!=nil; sect=sect->next)
980-
elfshbits(sect);
981979
for(sect=segdata.sect; sect!=nil; sect=sect->next)
982980
elfshbits(sect);
983981

src/cmd/8g/ggen.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "opt.h"
99

1010
static Prog *pret;
11-
static Node *naclnop;
1211

1312
void
1413
compile(Node *fn)
@@ -24,7 +23,6 @@ compile(Node *fn)
2423
newproc = sysfunc("newproc");
2524
deferproc = sysfunc("deferproc");
2625
deferreturn = sysfunc("deferreturn");
27-
naclnop = sysfunc("naclnop");
2826
panicindex = sysfunc("panicindex");
2927
panicslice = sysfunc("panicslice");
3028
throwreturn = sysfunc("throwreturn");
@@ -96,16 +94,8 @@ compile(Node *fn)
9694
if(pret)
9795
patch(pret, pc);
9896
ginit();
99-
if(hasdefer) {
100-
// On Native client, insert call to no-op function
101-
// to force alignment immediately before call to deferreturn,
102-
// so that when jmpdefer subtracts 5 from the second CALL's
103-
// return address and then the return masks off the low bits,
104-
// we'll back up to the NOPs immediately after the dummy CALL.
105-
if(strcmp(getgoos(), "nacl") == 0)
106-
ginscall(naclnop, 0);
97+
if(hasdefer)
10798
ginscall(deferreturn, 0);
108-
}
10999
if(curfn->exit)
110100
genlist(curfn->exit);
111101
gclean();

src/cmd/8l/asm.c

+9-25
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,6 @@ doelf(void)
539539
elfstr[ElfStrData] = addstring(shstrtab, ".data");
540540
elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
541541
addstring(shstrtab, ".elfdata");
542-
if(HEADTYPE == 8)
543-
addstring(shstrtab, ".closure");
544542
addstring(shstrtab, ".rodata");
545543
if(!debug['s']) {
546544
elfstr[ElfStrGosymcounts] = addstring(shstrtab, ".gosymcounts");
@@ -674,8 +672,6 @@ asmb(void)
674672
sect = segtext.sect;
675673
seek(cout, sect->vaddr - segtext.vaddr + segtext.fileoff, 0);
676674
codeblk(sect->vaddr, sect->len);
677-
678-
// TODO: NaCl: pad with HLT
679675

680676
/* output read-only data in text segment */
681677
sect = segtext.sect->next;
@@ -889,7 +885,7 @@ asmb(void)
889885

890886
Elfput:
891887
/* elf 386 */
892-
if(HEADTYPE == 8 || HEADTYPE == 11)
888+
if(HEADTYPE == 11)
893889
debug['d'] = 1;
894890

895891
eh = getElfEhdr();
@@ -901,17 +897,14 @@ asmb(void)
901897
/* This null SHdr must appear before all others */
902898
sh = newElfShdr(elfstr[ElfStrEmpty]);
903899

904-
/* program header info - but not on native client */
905-
pph = nil;
906-
if(HEADTYPE != 8) {
907-
pph = newElfPhdr();
908-
pph->type = PT_PHDR;
909-
pph->flags = PF_R + PF_X;
910-
pph->off = eh->ehsize;
911-
pph->vaddr = INITTEXT - HEADR + pph->off;
912-
pph->paddr = INITTEXT - HEADR + pph->off;
913-
pph->align = INITRND;
914-
}
900+
/* program header info */
901+
pph = newElfPhdr();
902+
pph->type = PT_PHDR;
903+
pph->flags = PF_R + PF_X;
904+
pph->off = eh->ehsize;
905+
pph->vaddr = INITTEXT - HEADR + pph->off;
906+
pph->paddr = INITTEXT - HEADR + pph->off;
907+
pph->align = INITRND;
915908

916909
if(!debug['d']) {
917910
/* interpreter */
@@ -935,8 +928,6 @@ asmb(void)
935928
}
936929

937930
elfphload(&segtext);
938-
if(segrodata.len > 0)
939-
elfphload(&segrodata);
940931
elfphload(&segdata);
941932

942933
/* Dynamic linking sections */
@@ -1038,8 +1029,6 @@ asmb(void)
10381029
diag("elftextsh = %d, want %d", elftextsh, eh->shnum);
10391030
for(sect=segtext.sect; sect!=nil; sect=sect->next)
10401031
elfshbits(sect);
1041-
for(sect=segrodata.sect; sect!=nil; sect=sect->next)
1042-
elfshbits(sect);
10431032
for(sect=segdata.sect; sect!=nil; sect=sect->next)
10441033
elfshbits(sect);
10451034

@@ -1073,11 +1062,6 @@ asmb(void)
10731062
eh->ident[EI_DATA] = ELFDATA2LSB;
10741063
eh->ident[EI_VERSION] = EV_CURRENT;
10751064
switch(HEADTYPE) {
1076-
case 8:
1077-
eh->ident[EI_OSABI] = ELFOSABI_NACL;
1078-
eh->ident[EI_ABIVERSION] = 7;
1079-
eh->flags = 0x200000; // aligned mod 32
1080-
break;
10811065
case 9:
10821066
eh->ident[EI_OSABI] = 9;
10831067
break;

src/cmd/8l/l.h

-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ EXTERN int32 spsize;
321321
EXTERN Sym* symlist;
322322
EXTERN int32 symsize;
323323
EXTERN Sym* textp;
324-
EXTERN int32 textpad;
325324
EXTERN int32 textsize;
326325
EXTERN int version;
327326
EXTERN Prog zprg;

src/cmd/8l/obj.c

+3-19
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ char *thestring = "386";
5555
* -H4 -Tx -Rx is fake MS-DOS .EXE
5656
* -H6 -Tx -Rx is Apple Mach-O
5757
* -H7 -Tx -Rx is Linux ELF32
58-
* -H8 -Tx -Rx is Google Native Client
58+
* -H8 -Tx -Rx was Google Native Client
5959
* -H9 -Tx -Rx is FreeBSD ELF32
60+
* -H10 -Tx -Rx is MS Windows PE
61+
* -H11 -Tx -Rx is tiny (os image)
6062
*/
6163

6264
void
@@ -133,9 +135,6 @@ main(int argc, char *argv[])
133135
if(strcmp(goos, "darwin") == 0)
134136
HEADTYPE = 6;
135137
else
136-
if(strcmp(goos, "nacl") == 0)
137-
HEADTYPE = 8;
138-
else
139138
if(strcmp(goos, "freebsd") == 0)
140139
HEADTYPE = 9;
141140
else
@@ -248,21 +247,6 @@ main(int argc, char *argv[])
248247
if(INITRND == -1)
249248
INITRND = 4096;
250249
break;
251-
case 8: /* native client elf32 executable */
252-
elfinit();
253-
HEADR = 4096;
254-
if(INITTEXT == -1)
255-
INITTEXT = 0x20000;
256-
if(INITDAT == -1)
257-
INITDAT = 0;
258-
if(INITRND == -1)
259-
INITRND = 65536;
260-
261-
// 512 kB of address space for closures.
262-
// (Doesn't take any space in the binary file.)
263-
// Closures are 64 bytes each, so this is 8,192 closures.
264-
textpad = 512*1024;
265-
break;
266250
case 10: /* PE executable */
267251
peinit();
268252
HEADR = PEFILEHEADR;

0 commit comments

Comments
 (0)