Commit Graph

8 Commits

Author SHA1 Message Date
Ian Lance Taylor fbf2f198ce libgo: add type/const references to sysinfo.c
This patch adds explicit references to various types and constants
    defined by the header files included by sysinfo.c (used to drive the
    generation of gen-sysinfo.go as part of the libgo build via the GCC
    "-fdump-go-spec" option).
    
    The intent is to enable clients to gather the same info generated by
    "-fdump-go-spec" by instead reading the generated DWARF from a
    sysinfo.o object file compiled with "-g". Some compilers (notably
    clang) try to omit DWARF records for a given type unless there is an
    explicit use of it in the translation unit; the additional references
    are to insure that everything we want to see in the DWARF shows up.
    
    Reviewed-on: https://go-review.googlesource.com/99063

From-SVN: r259868
2018-05-02 22:32:23 +00:00
Ian Lance Taylor eb80664a39 re PR go/81324 (libgo does not build with glibc 2.18)
PR go/81324
    sysinfo.c: ignore ptrace_peeksiginfo_args from <linux/ptrace.h>
    
    With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is
    defined in both <sys/ptrace.h> and <linux/ptrace.h>. We don't actually
    care about the struct, so use a #define to avoid a redefinition error.
    
    This fixes https://gcc.gnu.org/PR81324.
    
    Reviewed-on: https://go-review.googlesource.com/49290

From-SVN: r250324
2017-07-18 22:06:31 +00:00
Ian Lance Taylor 0bcce674a7 libgo: redefine ia64 struct names around linux/ptrace.h
Avoid https://sourceware.org/bugzilla/show_bug.cgi?id=762.
    
    Patch by Andreas Schwab.
    
    Reviewed-on: https://go-review.googlesource.com/46711

From-SVN: r249662
2017-06-26 17:56:14 +00:00
Ian Lance Taylor 8d4b68a7c4 libgo, syscall: fix ptrace implementation on MIPS
On MIPS, the correct structure for PtraceRegs is 'struct pt_regs' which
    is declared in linux/ptrace.h. Previously no PtraceRegs structure was
    created on MIPS because 'struct user_regs_struct' doesn't exist there.
    
    Fallback to using pt_regs when the PtraceRegs structure is generated in
    mksysinfo.sh, then adjust syscall_linux_mipsx.go to read the program
    counter from the correct field.
    
    In addition, implement PtraceGetRegs and PtraceSetRegs on all 3 ABI
    variants.
    
    syscall_linux_mips64x.go can now be removed since the ptrace code on
    all 3 ABIs is identical.
    
    Reviewed-on: https://go-review.googlesource.com/46150

From-SVN: r249472
2017-06-21 21:42:41 +00:00
Ian Lance Taylor 5302cd0250 runtime, reflect: rewrite Go to FFI type conversion in Go
As we move toward the Go 1.7 garbage collector, it's essential that all
    allocation of values that can contain Go pointers be done using the
    correct type descriptor.  That is simplest if we do all such allocation
    in Go code.  This rewrites the code that converts from a Go type to a
    libffi CIF into Go.
    
    Reviewed-on: https://go-review.googlesource.com/33353

From-SVN: r242578
2016-11-18 00:15:38 +00:00
Ian Lance Taylor 812ba636c7 runtime: copy netpoll code from Go 1.7 runtime
Reviewed-on: https://go-review.googlesource.com/31325

From-SVN: r241307
2016-10-18 14:38:29 +00:00
Ian Lance Taylor c0401cf78c runtime: copy internal locking code from Go 1.7 runtime
Remove the old locking code written in C.
    
    Add a shell script mkrsysinfo.sh to generate the runtime_sysinfo.go
    file, so that we can get Go copies of the system time structures and
    other types.
    
    Tweak the compiler so that when compiling the runtime package the
    address operator does not cause local variables to escape.  When the gc
    compiler compiles the runtime, an escaping local variable is treated as
    an error.  We should implement that, instead of this change, when escape
    analysis is turned on.
    
    Tweak the compiler so that the generated C header does not include names
    that start with an underscore followed by a non-upper-case letter,
    except for the special cases of _defer and _panic.  Otherwise we
    translate C types to Go in runtime_sysinfo.go and then generate those Go
    types back as C types in runtime.inc, which is useless and painful for
    the C code.
    
    Change entersyscall and friends to take a dummy argument, as the gc
    versions do, to simplify calls from the shared code.
    
    Reviewed-on: https://go-review.googlesource.com/30079

From-SVN: r240657
2016-09-30 13:45:08 +00:00
Ian Lance Taylor 14cda8a1cf libgo: separate mksysinfo inputs into separate Makefile targets
This is a step toward a version of mksysinfo that generates information
    for the runtime package.  This will be used to generate the
    runtime_sysinfo.go file, which is currently directly generated by a
    Makefile target.
    
    Reviewed-on: https://go-review.googlesource.com/29683

From-SVN: r240560
2016-09-27 21:32:50 +00:00