Commit Graph

950 Commits

Author SHA1 Message Date
Ian Lance Taylor 111c8b4ce9 internal/syscall/unix: add randomTrap for sh/shbe
CL 84555 added support for the SuperH architecture, but didn't add the
    randomTrap definition to be used for the getrandom syscall on Linux.
    Add it now.
    
    Reviewed-on: https://go-review.googlesource.com/90535

From-SVN: r257171
2018-01-30 04:48:55 +00:00
Ian Lance Taylor f6acbd0805 libgo: update to Go1.10rc1
Reviewed-on: https://go-review.googlesource.com/90295

From-SVN: r257127
2018-01-27 23:45:46 +00:00
Ian Lance Taylor d779dffc4b libgo: update to Go1.10rc1
Reviewed-on: https://go-review.googlesource.com/90295

From-SVN: r257126
2018-01-27 23:44:29 +00:00
Ian Lance Taylor a14e122ae2 compiler: deref receiver types in mangled names
This was the original intent, as reflected in the long comment at the
    start of names.cc, but I forgot to implement it.
    
    Also, remove a leading ".0" from the final name.  That could occur for
    a method whose receiver type starts with 'u', as in that case we
    prepend a space to the mangled name, to avoid confusion with the
    Unicode mangling, and the space turns into ".0".
    
    Also, if the Unicode encoding would cause the final to start with
    "..u" or "..U", add a leading underscore.
    
    Patch gotest to not get fooled by some names.
    
    The result of these changes is that all symbols start with a letter or
    an underscore.
    
    Reviewed-on: https://go-review.googlesource.com/90015

From-SVN: r257068
2018-01-25 23:10:35 +00:00
Ian Lance Taylor a88d1f8bb2 runtime: fix lfstackUnpack on ia64
The top three region number bits must be masked out before
    right-shifting the address bits into place, otherwise they will be
    copied down into the lower always-zero address bits.
    
    Reviewed-on: https://go-review.googlesource.com/84535

From-SVN: r257061
2018-01-25 17:44:19 +00:00
Ian Lance Taylor 4880b994d6 compiler: rationalize external symbol names
Encode all external symbol names using only ASCII alphanumeric
    characters, underscore, and dot.  Use a scheme that can be reliably
    demangled to a somewhat readable version as described in the long
    comment in names.cc.
    
    A minor cleanup discovered during this was that we were treating
    function types as different if one had a NULL parameters_ field and
    another has a non-NULL parameters_ field that has no parameters.  This
    worked because we mangled them slightly differently.  We now mangle
    them the same, so we treat them as equal, as we should anyhow.
    
    Reviewed-on: https://go-review.googlesource.com/89555

	* go.go-torture/execute/names-1.go: New test.

From-SVN: r257033
2018-01-24 23:50:09 +00:00
Ian Lance Taylor 38ad6f8a44 cmd/go: buildid support for AIX archives.
Reviewed-on: https://go-review.googlesource.com/88935

From-SVN: r256971
2018-01-23 04:44:12 +00:00
Ian Lance Taylor 2a3abc862a mksysinfo: use rlimit64 if available when we use getrlimit64
This makes no difference on most systems, because <sys/resource.h>
    renames the type appropriately anyhow, but apparently it makes a
    difference on AIX.
    
    Reviewed-on: https://go-review.googlesource.com/88076

From-SVN: r256877
2018-01-19 05:09:43 +00:00
Ian Lance Taylor ddc606cef7 mksysinfo: force Passwd.Pw_[ug]id from int32 to uint32
Solaris 10 uses int32 for the Pw_uid and Pw_gid fields of Passwd,
    but most systems, including Solaris 11, use uint32.  Force uint32
    for consistency and to fix the build.
    
    Reviewed-on: https://go-review.googlesource.com/88195

From-SVN: r256875
2018-01-19 04:52:12 +00:00
Ian Lance Taylor 674dddfe2d runtime: no escape for some functions on AIX
Reviewed-on: https://go-review.googlesource.com/88236

From-SVN: r256874
2018-01-19 04:48:51 +00:00
Ian Lance Taylor 219f9bad83 cmd/go: recognize AIX objects and archives
Reviewed-on: https://go-review.googlesource.com/88275

From-SVN: r256873
2018-01-19 04:27:38 +00:00
Ian Lance Taylor 549e4febc3 runtime: add go:noescape declaration for Solaris
Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/88376

From-SVN: r256872
2018-01-19 04:09:55 +00:00
Ian Lance Taylor a9411cce01 re PR go/83787 (Many 32-bit Solaris/SPARC Go tests FAIL after Go1.10beta1 update)
PR go/83787
    compiler: pass int to makechan, call makechan64 when appropriate
    
    The update to 1.10beta1 changed makechan to take int instead of int64,
    and added a makechan64 call for large values.  Since the size is the
    last argument to makechan, the old compiler which always passed a
    64-bit int worked fine on 64-bit systems and little-endian 32-bit
    systems, but broke on big-endian 32-bit systems.  This CL fixes the
    compiler to use the appropriate types.
    
    This fixes GCC PR 83787.
    
    Reviewed-on: https://go-review.googlesource.com/88077

From-SVN: r256835
2018-01-18 04:24:48 +00:00
Ian Lance Taylor c1fa27707a archive/tar: support stat and device numbers on AIX
Reviewed-on: https://go-review.googlesource.com/87198

From-SVN: r256810
2018-01-17 18:33:50 +00:00
Ian Lance Taylor c6d6367f84 libgo: update to Go1.10beta2 release
Reviewed-on: https://go-review.googlesource.com/87897

From-SVN: r256794
2018-01-17 14:20:29 +00:00
Ian Lance Taylor ffad1c54d2 go/types: implement SizesFor for gccgo
Move the architecture-specific settings out of configure.ac into a new
    shell script goarch.sh.  Use the new script to collect the values for
    all architectures to make them available in go/types.
    
    Also fix cmd/vet to pass the right compiler when it calls SizesFor.
    
    This fixes cmd/vet for systems that are not implemented in the gc
    toolchain, such as alpha and ia64.
    
    Reviewed-on: https://go-review.googlesource.com/87635

From-SVN: r256655
2018-01-14 04:59:01 +00:00
Ian Lance Taylor fbea3c33e8 re PR go/83794 (misc/cgo/test uses gigabytes of memory)
PR go/83794
    misc/cgo/test: avoid endless loop when we can't parse notes
    
    Reviewed-on: https://go-review.googlesource.com/87416

From-SVN: r256553
2018-01-11 19:58:55 +00:00
Ian Lance Taylor 840573729e debug/dwarf: formStrp uses a 64-bit value for 64-bit DWARF
No test as the only system I know that uses 64-bit DWARF is AIX.
    
    Backport of https://golang.org/cl/84379, which will be in Go 1.11.
    Backporting now for AIX support in gccgo.
    
    Reviewed-on: https://go-review.googlesource.com/87296

From-SVN: r256474
2018-01-11 01:51:16 +00:00
Ian Lance Taylor bbb31a1d5c os, syscall: handle _st_timespec for AIX stat
Reviewed-on: https://go-review.googlesource.com/87197

From-SVN: r256450
2018-01-10 19:51:24 +00:00
Ian Lance Taylor fd0c1dd167 libgo: add platform support for SuperH
Reviewed-on: https://go-review.googlesource.com/84555

From-SVN: r256446
2018-01-10 19:19:02 +00:00
Ian Lance Taylor 7074b41bdc Add missing .a files.
Add missing .a files.  These should have been committed with the
update to go1.10beta1, but were skipped because by default Subversion
ignores all files matching *.a.

From-SVN: r256442
2018-01-10 18:02:33 +00:00
Ian Lance Taylor 389578d7a6 re PR c/82922 (Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent)
PR c/82922

    runtime, syscall: use full prototypes in C code
    
    Based on patch by Martin Sebor.
    
    Reviewed-on: https://go-review.googlesource.com/86815

From-SVN: r256437
2018-01-10 15:42:23 +00:00
Ian Lance Taylor 447fb74d97 exp: remove exp/proxy and exp/terminal packages
The exp/proxy package was removed from the master library in
    https://golang.org/cl/6461056 (August, 2012).
    
    The exp/terminal package was removed from the master library in
    https://golang.org/cl/5970044 (March, 2012).
    
    I'm not sure why they lingered in the gofrontend copy, but let's
    finally remove them now.
    
    Reviewed-on: https://go-review.googlesource.com/87138

From-SVN: r256435
2018-01-10 15:37:45 +00:00
Ian Lance Taylor d0ac0d52e9 cmd/go: check for another GCC error message
GCC always recognizes the -fsplit-stack option, but then tests whether
    it is supported by the selected target. If not, it reports
        cc1: error: ‘-fsplit-stack’ is not supported by this compiler configuration
    Check for that error message when deciding whether a compiler option works.
    
    Reviewed-on: https://go-review.googlesource.com/87137

From-SVN: r256433
2018-01-10 15:18:55 +00:00
Ian Lance Taylor c9edeca8b8 runtime: fix makemap calls in __go_construct_map
The signature of makemap changed with the update to 1.10beta1,
    but I forgot to update the call from C code.
    
    Reviewed-on: https://go-review.googlesource.com/87135

From-SVN: r256431
2018-01-10 15:04:21 +00:00
Ian Lance Taylor 692aefcd56 runtime: work around escaping closure in export_test.go
When compiling runtime, it is not allowed for local variables
    and closures to be heap allocated. In one test, there is a go
    statement with a closure. In the gc compiler, it distinguishes
    capturing variable by value vs. by address, and rewrites it to
    passing the captured values as arguments. Currently we don't
    have this, and the escape analysis decides to heap allocate the
    closure and also the captured variables, which is not allowed.
    Work around it by passing the variables explicitly.
    
    This is in preparation of turning on escape analysis for the
    runtime.
    
    Reviewed-on: https://go-review.googlesource.com/86245

From-SVN: r256419
2018-01-10 05:26:29 +00:00
Ian Lance Taylor e4876be5f5 runtime: noescape some functions/variables
This is in preparation of turning on escape analysis for the
    runtime.
    
    - In gccgo, systemstack is implemented with mcall, which is not
      go:noescape. Wrap the closure in noescape so the escape analysis
      does not think it escapes.
    
    - Mark some C functions go:noescape. They do not leak arguments.
    
    - Use noescape function to make a few local variables' addresses
      not escape. The escape analysis cannot figure out because they
      are assigned to pointer indirections.
    
    Reviewed-on: https://go-review.googlesource.com/86244

From-SVN: r256418
2018-01-10 05:15:52 +00:00
Ian Lance Taylor fe9e170268 cmd/go: add AIX support
For gccgo code avoid --whole-archive and -(.  Use -blibpath instead of
    -rpath.
    
    Reviewed-on: https://go-review.googlesource.com/86956

From-SVN: r256417
2018-01-10 05:12:39 +00:00
Ian Lance Taylor 76e723a313 libgo: add aix build tags
Reviewed-on: https://go-review.googlesource.com/86936

From-SVN: r256416
2018-01-10 04:53:55 +00:00
Ian Lance Taylor ee6019ce5d os/signal/internal/pty: build on Solaris
Patch from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/87037

From-SVN: r256399
2018-01-09 21:42:59 +00:00
Ian Lance Taylor 1a2f01efa6 libgo: update to Go1.10beta1
Update the Go library to the 1.10beta1 release.
    
    Requires a few changes to the compiler for modifications to the map
    runtime code, and to handle some nowritebarrier cases in the runtime.
    
    Reviewed-on: https://go-review.googlesource.com/86455

gotools/:
	* Makefile.am (go_cmd_vet_files): New variable.
	(go_cmd_buildid_files, go_cmd_test2json_files): New variables.
	(s-zdefaultcc): Change from constants to functions.
	(noinst_PROGRAMS): Add vet, buildid, and test2json.
	(cgo$(EXEEXT)): Link against $(LIBGOTOOL).
	(vet$(EXEEXT)): New target.
	(buildid$(EXEEXT)): New target.
	(test2json$(EXEEXT)): New target.
	(install-exec-local): Install all $(noinst_PROGRAMS).
	(uninstall-local): Uninstasll all $(noinst_PROGRAMS).
	(check-go-tool): Depend on $(noinst_PROGRAMS).  Copy down
	objabi.go.
	(check-runtime): Depend on $(noinst_PROGRAMS).
	(check-cgo-test, check-carchive-test): Likewise.
	(check-vet): New target.
	(check): Depend on check-vet.  Look at cmd_vet-testlog.
	(.PHONY): Add check-vet.
	* Makefile.in: Rebuild.

From-SVN: r256365
2018-01-09 01:23:08 +00:00
Ian Lance Taylor 319e41dc77 libgo: fix GOARCH_CACHELINESIZE on ia64
Reviewed-on: https://go-review.googlesource.com/85256

From-SVN: r256306
2018-01-06 01:17:29 +00:00
Ian Lance Taylor be528ae9aa os: pass -s to hostname on AIX
Reviewed-on: https://go-review.googlesource.com/79375

From-SVN: r255738
2017-12-16 01:49:54 +00:00
Ian Lance Taylor fe6272cc44 syscall: emulate Flock on AIX
Reviewed-on: https://go-review.googlesource.com/79095

From-SVN: r255737
2017-12-16 01:45:45 +00:00
Ian Lance Taylor 4c413747a3 libgo: remove -fplan9-extensions from CFLAGS
Remove -fplan9-extensions from the CFLAGS used for libgo (no
    longer needed since the runtime was converted from C to Go).
    
    Reviewed-on: https://go-review.googlesource.com/82177

From-SVN: r255445
2017-12-06 17:43:29 +00:00
Ian Lance Taylor 79c9f76563 runtime: export cgoCheck functions
The functions cgoCheckPointer and cgoCheckResult are called by code
    generated by cgo. That means that we need to export them using
    go:linkname, as otherwise they are local symbols. The cgo code
    currently uses weak references to only call the symbols if they are
    defined, which is why it has been working--the cgo code has not been
    doing any checks.
    
    Reviewed-on: https://go-review.googlesource.com/80295

From-SVN: r255347
2017-12-02 00:46:00 +00:00
Ian Lance Taylor 02dc624e21 cmd/go, go/internal/gccgoimporter: pass -X to ar on AIX
Reviewed-on: https://go-review.googlesource.com/72930

From-SVN: r255090
2017-11-23 00:24:21 +00:00
Ian Lance Taylor ce143aa6e3 libgo: don't use grep -q in mksigtab.sh
Solaris grep does not support the -q option.
    
    Reviewed-on: https://go-review.googlesource.com/79239

From-SVN: r255042
2017-11-22 00:27:29 +00:00
Ian Lance Taylor c9548fa4f1 libgo: fix makefile buglet
Fix a small bug in the libgo Makefile recipe that constructs the
    directory from which to pick up libgcc_s.so ; the gccgo invocation
    with -print-libgcc-file-name was missing the flags, which meant that
    for -m32 builds we'd see the 64-bit libgcc dir.
    
    Reviewed-on: https://go-review.googlesource.com/78836

From-SVN: r254984
2017-11-21 06:19:10 +00:00
Rainer Orth f021f1d3a6 Adapt Solaris 12 references
libgcc:
	* config.host (*-*-solaris2*): Adapt comment for Solaris 12
	renaming.
	* config/sol2/crtpg.c (__start_crt_compiler): Likewise.
	* configure.ac (libgcc_cv_solaris_crts): Likewise.
	* configure: Regenerate.

	gcc:
	* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since
	Solaris 11.  Update comment.
	* configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12
	renaming.
	* config/sol2.h (STARTFILE_SPEC): Likewise.
	* configure: Regenerate.

	gcc/testsuite:
	* lib/target-supports.exp (check_effective_target_pie): Adapt
	comment for Solaris 12 renaming.

	* gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if.

From-SVN: r254737
2017-11-14 18:31:01 +00:00
Ian Lance Taylor 082fc7e884 libgo: adapt Solaris 12 references
With the change in the Solaris release model (no more major releases
    like Solaris 12 but only minor ones like 11.4), the Solaris 12
    references in GCC need to be adapted.
    
    Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/77490

From-SVN: r254729
2017-11-14 14:26:04 +00:00
Ian Lance Taylor 5ac29058f0 sync/atomic, runtime/internal/atomic: don't assume reads from 0 fail
For a misaligned address force a panic rather than assuming that reading
    from the address 0 will cause one.
    
    Reviewed-on: https://go-review.googlesource.com/69850

From-SVN: r254610
2017-11-09 21:56:59 +00:00
Ian Lance Taylor ce995d1cc2 libgo: pass flags to recursive make
"make check" runs make recursively to check each package. Pass
    the flags through. So it is possible to run "make check" with
    different settings easily.
    
    Reviewed-on: https://go-review.googlesource.com/76029

From-SVN: r254475
2017-11-06 20:59:32 +00:00
Ian Lance Taylor 001cbba0ef debug/dwarf: support 64-bit DWARF in byte order check
Also fix 64-bit DWARF to read a 64-bit abbrev offset in the
    compilation unit.
    
    This is a backport of https://golang.org/cl/71171, which will be in
    the Go 1.10 release, to the gofrontend copy. Doing it now because AIX
    is pretty much the only system that uses 64-bit DWARF.
    
    Reviewed-on: https://go-review.googlesource.com/72250

From-SVN: r253955
2017-10-20 18:34:36 +00:00
Ian Lance Taylor 3ff1b2b0a9 runtime: fix issues on AIX about uintptr(_t)
Reviewed-on: https://go-review.googlesource.com/69891

From-SVN: r253664
2017-10-11 21:16:49 +00:00
Ian Lance Taylor eafa7a907b debug/elf: support 32-bit SPARC relocs
Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/67111

From-SVN: r253292
2017-09-29 14:35:58 +00:00
Ian Lance Taylor 039073944d mksysinfo: strip locale structs
We don't need them, and this fixes the build when using uClibc-ng
    1.0.26 as originally reported at
    https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01930.html
    
    Reviewed-on: https://go-review.googlesource.com/67110

From-SVN: r253291
2017-09-29 14:14:40 +00:00
Ian Lance Taylor 509b9b7ae0 net: check Getsockname error return
Reviewed-on: https://go-review.googlesource.com/64550

From-SVN: r253231
2017-09-27 14:22:36 +00:00
Ian Lance Taylor c90df0d293 debug/xcoff,cmd: add XCOFF support
Reviewed-on: https://go-review.googlesource.com/64592

From-SVN: r253105
2017-09-22 18:49:52 +00:00
Ian Lance Taylor 7399e345be libgo: fix build when using -enable-static=no
With -enable-static=no we don't build non-pic objects, but libgotool.a
    is built from non-pic objects.  Build the packages that go into
    libgotool.a in static mode in all cases.
    
    Also ensure that internal test packages are built, since nothing
    explicitly depended on them.
    
    Reviewed-on: https://go-review.googlesource.com/65050

From-SVN: r253042
2017-09-20 23:31:00 +00:00