Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2015 15:09:35 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 202624] [PATCH] lang/go14: correct clang detection
Message-ID:  <bug-202624-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: sascha@root-login.org
          Assignee: jlaffaye@FreeBSD.org
          Keywords: patch
             Flags: maintainer-feedback?(jlaffaye@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202624-13>