Commit 5e188b40 authored by Russ Cox's avatar Russ Cox

build: avoid redundant bss declarations

Some compilers care, sadly.

R=iant, ken
CC=golang-dev
https://golang.org/cl/4931042
parent af18e4b9
...@@ -118,7 +118,10 @@ HOST_AR?=ar ...@@ -118,7 +118,10 @@ HOST_AR?=ar
HOST_EXTRA_CFLAGS?=-ggdb -O2 HOST_EXTRA_CFLAGS?=-ggdb -O2
HOST_EXTRA_LDFLAGS?= HOST_EXTRA_LDFLAGS?=
HOST_CFLAGS=-I"$(GOROOT)/include" $(HOST_EXTRA_CFLAGS) # The -fno-common here is not necessary, but some compilers
# on OS X seem to set it by default. Setting it here keeps the build
# working in that non-standard context.
HOST_CFLAGS=-fno-common -I"$(GOROOT)/include" $(HOST_EXTRA_CFLAGS)
HOST_LDFLAGS=$(HOST_EXTRA_LDFLAGS) HOST_LDFLAGS=$(HOST_EXTRA_LDFLAGS)
PWD=$(shell pwd) PWD=$(shell pwd)
......
...@@ -181,7 +181,7 @@ EXTERN int32 maxargsafe; ...@@ -181,7 +181,7 @@ EXTERN int32 maxargsafe;
EXTERN int mnstring; EXTERN int mnstring;
EXTERN Multab multab[20]; EXTERN Multab multab[20];
EXTERN int retok; EXTERN int retok;
EXTERN int hintabsize; extern int hintabsize;
EXTERN Node* nodrat; EXTERN Node* nodrat;
EXTERN Node* nodret; EXTERN Node* nodret;
EXTERN Node* nodsafe; EXTERN Node* nodsafe;
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include "../gc/go.h"
#include "../5l/5.out.h"
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif
#include "../gc/go.h"
#include "../5l/5.out.h"
typedef struct Addr Addr; typedef struct Addr Addr;
struct Addr struct Addr
...@@ -51,22 +51,19 @@ struct Prog ...@@ -51,22 +51,19 @@ struct Prog
#define REGALLOC_F0 (REGALLOC_RMAX+1) #define REGALLOC_F0 (REGALLOC_RMAX+1)
#define REGALLOC_FMAX (REGALLOC_F0 + FREGEXT) #define REGALLOC_FMAX (REGALLOC_F0 + FREGEXT)
EXTERN Biobuf* bout;
EXTERN int32 dynloc; EXTERN int32 dynloc;
EXTERN uchar reg[REGALLOC_FMAX+1]; EXTERN uchar reg[REGALLOC_FMAX+1];
EXTERN int32 pcloc; // instruction counter EXTERN int32 pcloc; // instruction counter
EXTERN Strlit emptystring; EXTERN Strlit emptystring;
extern char* anames[]; extern char* anames[];
EXTERN Hist* hist;
EXTERN Prog zprog; EXTERN Prog zprog;
EXTERN Node* curfn;
EXTERN Node* newproc; EXTERN Node* newproc;
EXTERN Node* deferproc; EXTERN Node* deferproc;
EXTERN Node* deferreturn; EXTERN Node* deferreturn;
EXTERN Node* panicindex; EXTERN Node* panicindex;
EXTERN Node* panicslice; EXTERN Node* panicslice;
EXTERN Node* throwreturn; EXTERN Node* throwreturn;
EXTERN long unmappedzero; extern long unmappedzero;
EXTERN int maxstksize; EXTERN int maxstksize;
/* /*
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#define EXTERN
#include "l.h" #include "l.h"
#include "../ld/lib.h" #include "../ld/lib.h"
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include "../gc/go.h"
#include "../6l/6.out.h"
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif
#include "../gc/go.h"
#include "../6l/6.out.h"
typedef struct Addr Addr; typedef struct Addr Addr;
struct Addr struct Addr
...@@ -44,22 +44,19 @@ struct Prog ...@@ -44,22 +44,19 @@ struct Prog
void* reg; // pointer to containing Reg struct void* reg; // pointer to containing Reg struct
}; };
EXTERN Biobuf* bout;
EXTERN int32 dynloc; EXTERN int32 dynloc;
EXTERN uchar reg[D_NONE]; EXTERN uchar reg[D_NONE];
EXTERN int32 pcloc; // instruction counter EXTERN int32 pcloc; // instruction counter
EXTERN Strlit emptystring; EXTERN Strlit emptystring;
extern char* anames[]; extern char* anames[];
EXTERN Hist* hist;
EXTERN Prog zprog; EXTERN Prog zprog;
EXTERN Node* curfn;
EXTERN Node* newproc; EXTERN Node* newproc;
EXTERN Node* deferproc; EXTERN Node* deferproc;
EXTERN Node* deferreturn; EXTERN Node* deferreturn;
EXTERN Node* panicindex; EXTERN Node* panicindex;
EXTERN Node* panicslice; EXTERN Node* panicslice;
EXTERN Node* throwreturn; EXTERN Node* throwreturn;
EXTERN vlong unmappedzero; extern vlong unmappedzero;
/* /*
* gen.c * gen.c
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
// THE SOFTWARE. // THE SOFTWARE.
#include "gg.h" #include "gg.h"
#undef EXTERN
#define EXTERN
#include "opt.h" #include "opt.h"
#define NREGVAR 32 /* 16 general + 16 floating */ #define NREGVAR 32 /* 16 general + 16 floating */
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include "../gc/go.h"
#include "../8l/8.out.h"
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif
#include "../gc/go.h"
#include "../8l/8.out.h"
typedef struct Addr Addr; typedef struct Addr Addr;
struct Addr struct Addr
...@@ -54,15 +54,12 @@ enum ...@@ -54,15 +54,12 @@ enum
Fpop2 = 1<<2, Fpop2 = 1<<2,
}; };
EXTERN Biobuf* bout;
EXTERN int32 dynloc; EXTERN int32 dynloc;
EXTERN uchar reg[D_NONE]; EXTERN uchar reg[D_NONE];
EXTERN int32 pcloc; // instruction counter EXTERN int32 pcloc; // instruction counter
EXTERN Strlit emptystring; EXTERN Strlit emptystring;
extern char* anames[]; extern char* anames[];
EXTERN Hist* hist;
EXTERN Prog zprog; EXTERN Prog zprog;
EXTERN Node* curfn;
EXTERN Node* newproc; EXTERN Node* newproc;
EXTERN Node* deferproc; EXTERN Node* deferproc;
EXTERN Node* deferreturn; EXTERN Node* deferreturn;
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
// THE SOFTWARE. // THE SOFTWARE.
#include "gg.h" #include "gg.h"
#undef EXTERN
#define EXTERN
#include "opt.h" #include "opt.h"
#define NREGVAR 8 #define NREGVAR 8
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#define EXTERN
#include "go.h" #include "go.h"
#include "y.tab.h" #include "y.tab.h"
#include <ar.h> #include <ar.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment