1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:21:21 -06:00
Commit Graph

60 Commits

Author SHA1 Message Date
Russ Cox
d9c989fa25 various: avoid %ld etc
The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc.  Convert to %ux, %d, etc.

(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)

R=ken2
CC=golang-dev
https://golang.org/cl/2491041
2010-10-13 16:20:22 -04:00
Joe Poirier
e21b3a40ac build: test for _WIN32, not _MINGW32
Use OS rather than compiler specific flag the same way that
__FreeBSD__, __APPLE__, __OpenBSD__, and __linux__ are used.

_WIN32 is defined by GCC (and others) on windows for Win32
and Win64 applications. _WIN32 is set by default for several
other windows based compilers: DMC, MSVC, Intel, Watcom, LCC.

Although the change is for consistency, it allows the Go tools
to be compiled with non-Mingw GCC distributions and non-GCC
compilers that support the GCC extensions.

R=rsc, brainman, vcc
CC=golang-dev
https://golang.org/cl/2168043
2010-09-08 22:20:35 -04:00
Russ Cox
aafe474ec9 build: $GOBIN defaults to $GOROOT/bin
R=r
CC=golang-dev
https://golang.org/cl/1982049
2010-08-24 20:00:33 -04:00
Russ Cox
e473f42b2d amd64: use segment memory for thread-local storage
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.

Fixes #720.

R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
2010-08-04 17:50:22 -07:00
Rob Pike
9e481e2905 fix spelling of align
R=rsc
CC=golang-dev
https://golang.org/cl/778041
2010-03-26 09:56:57 -07:00
Russ Cox
1c7cc5bd7a cc: fix typo
R=iant
CC=golang-dev
https://golang.org/cl/720041
2010-03-24 08:59:09 -07:00
Ian Lance Taylor
9e0ae94e72 Add support for #pragma dynexport.
R=rsc
CC=golang-dev
https://golang.org/cl/661043
2010-03-23 06:46:30 -07:00
Ian Lance Taylor
f54d73b880 Rename dynld to dynimport throughout.
Cgo users will need to rerun cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/692041
2010-03-22 19:58:55 -07:00
Russ Cox
36c5c5bf40 cc: disallow ... argument unless NOSPLIT is set.
check that NOSPLIT functions don't use too much stack.
correct some missing NOSPLITs in the runtime library.

Fixes bug reported in
https://groups.google.com/group/golang-nuts/t/efff68b73941eccf

R=ken2
CC=golang-dev
https://golang.org/cl/236041
2010-03-04 15:34:25 -08:00
Giles Lean
0b4d8c19af cc: use "cpp" anywhere in path, not "/bin/cpp"
R=rsc
CC=golang-dev
https://golang.org/cl/206077
2010-02-16 11:32:41 -08:00
Ken Thompson
d4ad8e8ce3 bug fix in 6c/8c/5c mis-aligned
function arguments.

R=rsc
CC=golang-dev
https://golang.org/cl/206054
2010-02-09 17:26:04 -08:00
Dean Prichard
0e47c75f60 5a/6a/8a/5c/6c/8c: remove fixed-size arrays for -I and -D options
R=rsc
CC=golang-dev
https://golang.org/cl/198044
2010-02-05 01:40:58 -08:00
Dean Prichard
77053797e0 avoid overflow of symb buffer in 5a/6a/8a/5c/6c/8c
R=rsc
CC=golang-dev
https://golang.org/cl/194099
2010-01-28 16:11:38 -08:00
Russ Cox
7263bfc73b cc: correct handling of leading ·
R=ken2
CC=golang-dev
https://golang.org/cl/193081
2010-01-25 18:31:44 -08:00
Russ Cox
758f2bc556 eliminate the package global name space assumption in object files
5g/6g/8g: add import statements to export metadata, mapping package path to package name.
	recognize "" as the path of the package in export metadata.
	use "" as the path of the package in object symbol names.

5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this package.

5l/6l/8l: rewrite "" in symbol names as object files are read.

gotest: handle new symbol names.

gopack: handle new import lines in export metadata.

Collectively, these changes eliminate the assumption of a global
name space in the object file formats.  Higher level pieces such as
reflect and the computation of type hashes still depend on the
assumption; we're not done yet.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/186263
2010-01-22 17:06:20 -08:00
Russ Cox
a6736fa4ff cleanup toward eliminating package global name space
* switch to real dot (.) instead of center dot (·) everywhere in object files.
    before it was half and half depending on where in the name it appeared.
  * in 6c/6a/etc identifiers, · can still be used but turns into . immediately.
  * in export metadata, replace package identifiers with quoted strings
    (still package names, not paths).

R=ken2, r
CC=golang-dev
https://golang.org/cl/190076
2010-01-19 21:34:44 -08:00
Hector Chu
977e19d69f 8l: add support for PE output.
R=rsc
https://golang.org/cl/166080
2009-12-13 12:39:20 -08:00
Sergio Luis O. B. Correia
2b1133ff86 cmd/cc: change getquoted() to accept whitespaces.
getquoted() currently checks for whitespaces and returns nil
if it finds one. this prevents us from having go in a path
containing whitespaces, as the #pragma dynld directives are
processed through the said function.

this commit makes getquoted() accept whitespaces, and this is
also needed for solving issue #115.

R=rsc
https://golang.org/cl/157066
2009-11-23 16:00:26 -08:00
Russ Cox
e69f12ae1d two more if(h<0) that gcc 4.3 -O2 miscompiles
R=r
https://golang.org/cl/160044
2009-11-23 14:23:14 -08:00
Sergio Luis O. B. Correia
bae4f5085e cmd/cc: Fix -I switch to handle a path with blankspaces correctly
Currently, -I switch can't deal with a path containing spaces.
This commit simplify setinclude(), by removing the special case
of a string that had spaces. After this change, setinclude() will
merely add the given directories to the include path, if it does
not yet exist, and this approach works.

Will be needed for solving issue 115.

R=agl1, rsc, iant2, r
https://golang.org/cl/155059
2009-11-17 09:02:47 -08:00
Russ Cox
b18bee948e cc: drop redundant strcpy
Fixes #192.

R=ken2
https://golang.org/cl/155047
2009-11-15 00:00:05 -08:00
Russ Cox
139a053733 cc: eliminate two fixed-size buffers
Fixes bug 168.
Alternative to https://golang.org/cl/152143.

R=ken2
https://golang.org/cl/155042
2009-11-14 23:25:55 -08:00
Russ Cox
593ccd1d44 yet another attempt to avoid conflicts with
<stdio.h>, which we weren't even #including

R=r
https://golang.org/cl/154108
2009-11-12 23:38:48 -08:00
Russ Cox
6634e3432d cc, ld: fix more gcc 4.3 -O2 compile bugs
same as https://golang.org/cl/152088
in more files.

Fixes #83.

R=r, r1
https://golang.org/cl/152091
2009-11-12 00:22:45 -08:00
Russ Cox
c3343ef62c fix BUFSIZ redeclaration warnings
R=r
https://golang.org/cl/152085
2009-11-11 16:33:23 -08:00
Russ Cox
ae39a1d8ec cc: correct handling of allocn(0, 1, d)
Fixes #29.

R=r
https://golang.org/cl/152076
2009-11-11 14:52:21 -08:00
Russ Cox
e9ac56fb99 getc/ungetc in assemblers; BUFSIZ everywhere.
Fixes #67.

R=r
https://golang.org/cl/154068
2009-11-11 14:52:08 -08:00
Russ Cox
8c3d2f015b avoid clash with stdio's getc, ungetc.
Fixes #50.

R=r
https://golang.org/cl/154064
2009-11-11 13:08:35 -08:00
Russ Cox
18ccbc69f8 tweak documentation of commands
so that first sentence is better for cmd page.

live at http://r45:3456/cmd/

R=gri, r
http://go/go-review/1024034
2009-11-09 11:45:15 -08:00
Kai Backman
de663b2d6b with rsc: argsize rounding to 8 smashes stack data on 32bit machines.
R=rsc
http://go/go-review/1024011
2009-11-06 13:50:58 -08:00
Rob Pike
dc62c66c73 more command documentation, including nm and prof
R=rsc
http://go/go-review/1017022
2009-11-03 17:46:35 -08:00
Russ Cox
11d3805579 clean more
R=r
DELTA=40  (9 added, 3 deleted, 28 changed)
OCL=35277
CL=35305
2009-10-03 10:38:03 -07:00
Russ Cox
5124e66fca c compiler bug tickled by
void f(struct { int x[1]; } p) { }
the "int" was getting attached to f.

R=ken
OCL=35145
CL=35151
2009-09-30 10:25:22 -07:00
Russ Cox
5de6096415 allow runes >= 0x80 in symbols in #pragmas
R=ken
OCL=34975
CL=34975
2009-09-24 11:45:08 -07:00
Russ Cox
165a99038f ffi -> dynld.
move out of export data into its own section

R=r
DELTA=222  (71 added, 99 deleted, 52 changed)
OCL=33801
CL=33808
2009-08-24 17:27:55 -07:00
Russ Cox
8c253bcae5 first attempt at real FFI support.
in a .6 file, an export line

	//ffi T localfib remotefib remote.so

means the dynamic linker should initialize
localfib, always a pointer, to the address of
remotefib, either text (T) or data (D) after
loading remote.so.

the C compiler will generate an export section
when given the pragmas

	#pragma package fib
	#pragma ffi T localfib remotefib remote.so

needing #pragma package is a bit of a kludge
and hopefully could go away later.

this is just the 6 tool chain support.
other architectures will happen once 6 settles down.

code using this to do FFI is in a later CL.

R=r
DELTA=161  (141 added, 14 deleted, 6 changed)
OCL=33783
CL=33795
2009-08-24 16:15:21 -07:00
Kai Backman
7258bac6e8 fix bug in codegen when we modified move instruction instead
of text.

R=rsc
APPROVED=rsc
DELTA=3  (1 added, 2 deleted, 0 changed)
OCL=31575
CL=31575
2009-07-13 20:33:59 -07:00
Russ Cox
9e2f2fcd2e compilers were inconsistent about
whether no register argument was
REGARG == 0 or REGARG < 0.
use REGARG < 0 because arm needs 0 for R0.

R=ken
OCL=31562
CL=31566
2009-07-13 19:20:43 -07:00
Russ Cox
27432d67ec move 6c/pgen.c, 6c/pswt.c into cc
and make 5c, 8c use them.

centralizes reachability analysis
and switch generation.

now 8c doesn't have spurious warnings
in pkg/runtime.

R=ken
OCL=31266
CL=31266
2009-07-07 10:07:15 -07:00
Ken Thompson
cb15bbe748 bug in stack size used in
extending segmented stack

R=r
OCL=27319
CL=27319
2009-04-10 15:23:19 -07:00
Russ Cox
5a68303a15 throw away most of the compat.h compatibility layer
in favor of the lib9 compatibility layer.  no need for two.

now that mycreate is gone, .6 files are 0644 not 0755.

TBR=r
OCL=26679
CL=26679
2009-03-24 12:12:57 -07:00
Russ Cox
2bd101c4b1 update 8a, 8c, 8l to use new object format.
add "extern register" support to 8c.
extern register means allocate in the FS-relative segment.

make 8l generate segmented stack checks.

R=ken
OCL=26600
CL=26606
2009-03-20 16:40:00 -07:00
Russ Cox
0932b1f9b8 move pragtextflag into lexbody
R=ken
OCL=26581
CL=26587
2009-03-20 14:22:37 -07:00
Russ Cox
5e5476c2fe 6c: byte* - byte* should be int64, not int32.
R=ken
OCL=24507
CL=24507
2009-02-05 19:09:04 -08:00
Ken Thompson
e90314d024 pragma textflag
fixes latent bugs in go and defer

R=r
OCL=23613
CL=23613
2009-01-27 14:12:35 -08:00
Russ Cox
859ba57bbb make acid build with bison.
ask for bison explicitly in cc, gc to try to
avoid problems with other yaccs that
might be installed.

R=r
DELTA=29  (10 added, 2 deleted, 17 changed)
OCL=22110
CL=22113
2009-01-06 09:53:30 -08:00
Russ Cox
c14c2b231f fix 6a line number bug -
was incrementing lineno twice for
the \n after a // comment.

R=r
DELTA=3  (0 added, 2 deleted, 1 changed)
OCL=21984
CL=22021
2009-01-05 11:18:15 -08:00
Russ Cox
f8b20e4083 add cov, prof to default build; clean up compiler warnings
R=r
DELTA=8  (1 added, 0 deleted, 7 changed)
OCL=19245
CL=19245
2008-11-14 10:57:48 -08:00
Russ Cox
b676b0e125 better yacc rule in Makefile
if y.tab.c is older than y.tab.h, make
interprets doing nothing as a failure,
because y.tab.c hasn't been updated.
so update it.

R=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=15615
CL=15622
2008-09-22 10:56:54 -07:00
Russ Cox
76036192b9 make Makefiles safe for parallel make
use -j4 (4-way parallel) in make.bash.

halves time for make.bash on r45

also add libregexp, acid to default build

R=r
DELTA=90  (39 added, 37 deleted, 14 changed)
OCL=15485
CL=15487
2008-09-18 15:06:43 -07:00