1. 19 Oct, 2015 1 commit
  2. 05 Oct, 2015 1 commit
  3. 30 Jul, 2015 1 commit
    • Ian Lance Taylor's avatar
      cmd/cgo: discard trailing zero-sized fields in a non-empty C struct · 7904946e
      Ian Lance Taylor authored
      In order to fix issue #9401 the compiler was changed to add a padding
      byte to any non-empty Go struct that ends in a zero-sized field.  That
      causes the Go version of such a C struct to have a different size than
      the C struct, which can considerable confusion.  Change cgo so that it
      discards any such zero-sized fields, so that the Go and C structs are
      the same size.
      
      This is a change from previous releases, in that it used to be
      possible to refer to a zero-sized trailing field (by taking its
      address), and with this change it no longer is.  That is unfortunate,
      but something has to change.  It seems better to visibly break
      programs that do this rather than to silently break programs that rely
      on the struct sizes being the same.
      
      Update #9401.
      Fixes #11925.
      
      Change-Id: I3fba3f02f11265b3c41d68616f79dedb05b81225
      Reviewed-on: https://go-review.googlesource.com/12864
      
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      7904946e
  4. 11 Jul, 2015 1 commit
    • Brad Fitzpatrick's avatar
      all: link to https instead of http · 2ae77376
      Brad Fitzpatrick authored
      The one in misc/makerelease/makerelease.go is particularly bad and
      probably warrants rotating our keys.
      
      I didn't update old weekly notes, and reverted some changes involving
      test code for now, since we're late in the Go 1.5 freeze. Otherwise,
      the rest are all auto-generated changes, and all manually reviewed.
      
      Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d
      Reviewed-on: https://go-review.googlesource.com/12048
      
      Reviewed-by: default avatarRob Pike <r@golang.org>
      2ae77376
  5. 26 Jun, 2015 1 commit
  6. 18 Apr, 2015 1 commit
  7. 18 Mar, 2015 1 commit
  8. 29 Jan, 2015 1 commit
  9. 12 Jan, 2015 1 commit
  10. 08 Jan, 2015 1 commit
  11. 07 Jan, 2015 1 commit
  12. 30 Oct, 2014 1 commit
  13. 21 Oct, 2014 1 commit
    • Dave Cheney's avatar
      undo CL 156430044 / 5d69cad4faaf · 4073be88
      Dave Cheney authored
      Partial undo, changes to ldelf.c retained.
      
      Some platforms are still not working even with the integrated assembler disabled, will have to find another solution.
      
      ««« original CL description
      cmd/cgo: disable clang's integrated assembler
      
      Fixes #8348.
      
      Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used).
      
      This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim.
      
      This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/156430044
      »»»
      
      LGTM=minux
      R=iant, minux
      CC=golang-codereviews
      https://golang.org/cl/162880044
      4073be88
  14. 20 Oct, 2014 1 commit
    • Dave Cheney's avatar
      cmd/cgo: disable clang's integrated assembler · cf9558c8
      Dave Cheney authored
      Fixes #8348.
      
      Clang's internal assembler (introduced by default in clang 3.4) understands the .arch directive, but doesn't change the default value of -march. This causes the build to fail when we use BLX (armv5 and above) when clang is compiled for the default armv4t architecture (which appears to be the default on all the distros I've used).
      
      This is probably a clang bug, so work around it for the time being by disabling the integrated assembler when compiling the cgo assembly shim.
      
      This CL also includes a small change to ldelf.c which was required as clang 3.4 and above generate more weird symtab entries.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/156430044
      cf9558c8
  15. 14 Aug, 2014 1 commit
  16. 13 Aug, 2014 1 commit
    • Matthew Dempsky's avatar
      cmd/cgo, debug/dwarf: fix translation of zero-size arrays · 078a9cbc
      Matthew Dempsky authored
      In cgo, now that recursive calls to typeConv.Type() always work,
      we can more robustly calculate the array sizes based on the size
      of our element type.
      
      Also, in debug/dwarf, the decision to call zeroType is made
      based on a type's usage	within a particular struct, but dwarf.Type
      values are cached in typeCache, so the modification might affect
      uses of the type in other structs.  Current compilers don't appear
      to share DWARF type entries for "[]foo" and "[0]foo", but they also
      don't consistently share type entries in other cases.  Arguably
      modifying the types is an improvement in some cases, but varying
      translated types according to compiler whims seems like a bad idea.
      
      Lastly, also in debug/dwarf, zeroType only needs to rewrite the
      top-level dimension, and only if the rest of the array size is
      non-zero.
      
      Fixes #8428.
      
      LGTM=iant
      R=iant
      CC=golang-codereviews
      https://golang.org/cl/127980043
      078a9cbc
  17. 12 Aug, 2014 2 commits
  18. 11 Aug, 2014 1 commit
    • Matthew Dempsky's avatar
      cmd/cgo: iterate over names in deterministic order · 03e6a88e
      Matthew Dempsky authored
      This makes GCC behavior (and cgo build failures) deterministic.
      
      Fixes #8487.
      
      Ran this shell command on linux/amd64 (Ubuntu 12.04) before and
      after this change:
      
          for x in `seq 100`; do
            go tool cgo -debug-gcc=true issue8441.go 2>&1 | md5sum
          done | sort | uniq -c
      
      Before:
          67 2cdcb8c7c4e290f7d9009abc581b83dd  -
          10 9a55390df94f7cec6d810f3e20590789  -
          10 acfad22140d43d9b9517bbc5dfc3c0df  -
          13 c337f8fee2304b3a8e3158a4362d8698  -
      
      After:
          100 785c316cbcbcd50896695050e2fa23c1  -
      
      LGTM=minux, iant
      R=golang-codereviews, bradfitz, minux, iant
      CC=golang-codereviews
      https://golang.org/cl/126990043
      03e6a88e
  19. 06 Aug, 2014 4 commits
    • Matthew Dempsky's avatar
      cmd/cgo: consistently map void* to *byte under -{c,go}defs · 2b9f3fce
      Matthew Dempsky authored
      Fixes #8478.
      
      LGTM=iant
      R=iant
      CC=golang-codereviews
      https://golang.org/cl/122150043
      2b9f3fce
    • Matthew Dempsky's avatar
      cmd/cgo: fix recursive type mapping · 0da4b2db
      Matthew Dempsky authored
      Instead of immediately completing pointer type mappings, add them to
      a queue to allow them to be completed later.  This fixes issues	caused
      by Type() returning arbitrary in-progress type mappings.
      
      Fixes #8368.
      Fixes #8441.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/122850043
      0da4b2db
    • Matthew Dempsky's avatar
      cmd/cgo: fix handling of defs_linux.go · f7a8adbd
      Matthew Dempsky authored
      Instead of including <sys/types.h> to get size_t, instead include
      the ISO C standard <stddef.h> header, which defines fewer additional
      types at risk of colliding with the user code.  In particular, this
      prevents collisions between <sys/types.h>'s userspace definitions with
      the kernel definitions needed by defs_linux.go.
      
      Also, -cdefs mode uses #pragma pack, so we can keep misaligned fields.
      
      Fixes #8477.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/120610043
      f7a8adbd
    • Ian Lance Taylor's avatar
      cmd/cgo: for -godefs, promote first field of anonymous union · f2f17c0f
      Ian Lance Taylor authored
      Update #6677
      
      When a struct contains an anonymous union, use the type and
      name of the first field in the union.
      
      This should make the glibc <sys/resource.h> file work; in that
      file struct rusage has fields like
      
      __extension__ union
      {
              long int ru_maxrss;
              __syscall_slong_t __ru_maxrss_word;
      };
      
      in which the field that matters is ru_maxrss and
      __ru_maxrss_word just exists to advance to the next field on
      systems where the kernel uses long long fields but userspace
      expects long fields.
      
      LGTM=mikioh.mikioh
      R=golang-codereviews, mikioh.mikioh
      CC=golang-codereviews
      https://golang.org/cl/106260044
      f2f17c0f
  20. 05 Jun, 2014 1 commit
  21. 02 Jun, 2014 1 commit
  22. 28 May, 2014 1 commit
    • Russ Cox's avatar
      cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable · 0782ee3a
      Russ Cox authored
      For incomplete struct S, C.T and C.struct_S were interchangeable in Go 1.2
      and earlier, because all incomplete types were interchangeable
      (even C.struct_S1 and C.struct_S2).
      
      CL 76450043, which fixed issue 7409, made different incomplete types
      different from Go's point of view, so that they were no longer completely
      interchangeable.
      
      However, imprecision about C.T and C.struct_S - really the same
      underlying C type - is the one behavior enabled by the bug that
      is most likely to be depended on by existing cgo code.
      Explicitly allow it, to keep that code working.
      
      Fixes #7786.
      
      LGTM=iant, r
      R=golang-codereviews, iant, r
      CC=golang-codereviews
      https://golang.org/cl/98580046
      0782ee3a
  23. 13 May, 2014 1 commit
  24. 27 Mar, 2014 1 commit
  25. 07 Nov, 2013 1 commit
    • Russ Cox's avatar
      cmd/cgo: fix handling of array of pointers when using clang · 6be1cb8c
      Russ Cox authored
      Clang does not record the "size" field for pointer types,
      so we must insert the size ourselves. We were already
      doing this, but only for the case of pointer types.
      For an array of pointer types, the setting of the size for
      the nested pointer type was happening after the computation
      of the size of the array type, meaning that the array type
      was always computed as 0 bytes. Delay the size computation.
      
      This bug happens on all Clang systems, not just FreeBSD.
      Our test checked that cgo wrote something, not that it was correct.
      FreeBSD's default clang rejects array[0] as a C struct field,
      so it noticed the incorrect sizes. But the sizes were incorrect
      everywhere.
      
      Update testcdefs to check the output has the right semantics.
      
      Fixes #6292.
      
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/22840043
      6be1cb8c
  26. 30 Oct, 2013 1 commit
  27. 29 Oct, 2013 1 commit
    • Russ Cox's avatar
      cmd/cgo: stop using -fno-eliminate-unused-debug-types · adda3348
      Russ Cox authored
      This flag was added in January 2010, in CL 181102, to fix issue 497.
      (Numbers were just shorter back then.) The fix was for OS X machines
      and the llvm-gcc frontend.
      
      In July 2011 we had to change the way we get enum values, because
      there were no flags available to force Xcode's llvm-gcc to include the
      enum names and values in DWARF debug output.
      
      We now use clang, not llvm-gcc, on OS X machines.
      Earlier versions of clang printed a warning about not knowing the flag.
      Newer versions of clang now make that an error.
      
      That is:
       - The flag was added for OS X machines.
       - The flag is no longer necessary on OS X machines.
       - The flag now breaks some OS X machines.
      
      Remove it.
      
      I have run the original program from issue 497 successfully
      without the flag on both OS X and Linux machines.
      
      Fixes #6678.
      
      R=golang-dev, minux.ma
      CC=golang-dev
      https://golang.org/cl/18850043
      adda3348
  28. 22 Oct, 2013 1 commit
  29. 18 Oct, 2013 2 commits
    • Russ Cox's avatar
      cmd/cgo: fix line number in an error message · dbe2eacf
      Russ Cox authored
      Fixes #6563.
      
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/14870046
      dbe2eacf
    • Russ Cox's avatar
      cmd/cgo: stop using compiler error message text to analyze C names · 06ad3b2d
      Russ Cox authored
      The old approach to determining whether "name" was a type, constant,
      or expression was to compile the C program
      
              name;
      
      and scan the errors and warnings generated by the compiler.
      This requires looking for specific substrings in the errors and warnings,
      which ties the implementation to specific compiler versions.
      As compilers change their errors or drop warnings, cgo breaks.
      This happens slowly but it does happen.
      Clang in particular (now required on OS X) has a significant churn rate.
      
      The new approach compiles a slightly more complex program
      that is either valid C or not valid C depending on what kind of
      thing "name" is. It uses only the presence or absence of an error
      message on a particular line, not the error text itself. The program is:
      
              // error if and only if name is undeclared
              void f1(void) { typeof(name) *x; }
      
              // error if and only if name is not a type
              void f2(void) { name *x; }
      
              // error if and only if name is not an integer constant
              void f3(void) { enum { x = (name)*1 }; }
      
      I had not been planning to do this until Go 1.3, because it is a
      non-trivial change, but it fixes a real Xcode 5 problem in Go 1.2,
      and the new code is easier to understand than the old code.
      It should be significantly more robust.
      
      Fixes #6596.
      Fixes #6612.
      
      R=golang-dev, r, james, iant
      CC=golang-dev
      https://golang.org/cl/15070043
      06ad3b2d
  30. 16 Oct, 2013 1 commit
  31. 15 Oct, 2013 3 commits
  32. 11 Sep, 2013 1 commit
  33. 04 Sep, 2013 1 commit