1
0
mirror of https://github.com/golang/go synced 2024-11-24 22:57:57 -07:00

build: avoid redundant bss declarations

Some compilers care, sadly.

R=iant, ken
CC=golang-dev
https://golang.org/cl/4931042
This commit is contained in:
Russ Cox 2011-08-23 22:39:14 -04:00
parent af18e4b9b0
commit 5e188b40f2
9 changed files with 18 additions and 30 deletions

View File

@ -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)

View File

@ -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;

View File

@ -5,13 +5,13 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#ifndef EXTERN
#define EXTERN extern
#endif
#include "../gc/go.h" #include "../gc/go.h"
#include "../5l/5.out.h" #include "../5l/5.out.h"
#ifndef EXTERN
#define EXTERN extern
#endif
typedef struct Addr Addr; typedef struct Addr Addr;
struct Addr struct Addr
@ -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;
/* /*

View File

@ -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"

View File

@ -5,13 +5,13 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#ifndef EXTERN
#define EXTERN extern
#endif
#include "../gc/go.h" #include "../gc/go.h"
#include "../6l/6.out.h" #include "../6l/6.out.h"
#ifndef EXTERN
#define EXTERN extern
#endif
typedef struct Addr Addr; typedef struct Addr Addr;
struct Addr struct Addr
@ -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

View File

@ -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 */

View File

@ -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
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;

View File

@ -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

View File

@ -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>