[Bug 202624] [PATCH] lang/go14: correct clang detection

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 24 15:09:36 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202624

            Bug ID: 202624
           Summary: [PATCH] lang/go14: correct clang detection
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: jlaffaye at FreeBSD.org
          Reporter: sascha at root-login.org
          Assignee: jlaffaye at FreeBSD.org
          Keywords: patch
             Flags: maintainer-feedback?(jlaffaye at FreeBSD.org)

Created attachment 160308
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=160308&action=edit
go14 patch

Building go14 on a FreeBSD 10.2 systme yields some -pthread warnings:


os/user/lookup_unix.go:58:31: warning: unknown attribute '__gcc_struct__'
ignored [-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
os/user/lookup_unix.go:73:31: warning: unknown attribute '__gcc_struct__'
ignored [-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
os/user/lookup_unix.go:92:31: warning: unknown attribute '__gcc_struct__'
ignored [-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
os/user/lookup_unix.go:106:31: warning: unknown attribute '__gcc_struct__'
ignored [-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
4 warnings generated.
# os/user
cc: warning: argument unused during compilation: '-pthread'
# net
net/cgo_unix.go:53:31: warning: unknown attribute '__gcc_struct__' ignored
[-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
net/cgo_unix.go:66:31: warning: unknown attribute '__gcc_struct__' ignored
[-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
net/cgo_unix.go:75:31: warning: unknown attribute '__gcc_struct__' ignored
[-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
net/cgo_unix.go:86:31: warning: unknown attribute '__gcc_struct__' ignored
[-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
net/cgo_unix.go:103:31: warning: unknown attribute '__gcc_struct__' ignored
[-Wattributes]
        } __attribute__((__packed__, __gcc_struct__)) *a = v;
                                     ^
5 warnings generated.

It seems that go14 does not detect, that our cc is actually clang.
The attached patch explicitly sets CC to clang so the go toolchain knows about
it. This fixes the above warnings.
It also replaces "type -t" in the shell script wiht "command -v" to remove
these artifacts:

# Building C bootstrap tool.
cmd/dist
-t: not found
gcc: not found
-t: not found


lang/go seems to also suffer from not detecting our clang although it has code
to detect it. So the CC patch should be applied there, too. Should i open an
extra PR for that?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list