LGTM On all versions? Even 10.6? Did clang work then, having all the flags we ...
11 years, 7 months ago
(2013-08-02 16:12:28 UTC)
#2
LGTM
On all versions? Even 10.6? Did clang work then, having all the flags we
need?
On Aug 2, 2013 9:08 AM, <rsc@golang.org> wrote:
> Reviewers: golang-dev1,
>
> Message:
> Hello golang-dev@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> build: on OS X use clang instead of gcc
>
> Fixes issue 5822.
> Will no doubt cause other problems, but Apple has forced our hand.
>
> Please review this at
https://codereview.appspot.**com/12350044/<https://codereview.appspot.com/123...
>
> Affected files:
> M src/cmd/dist/build.c
> M src/cmd/go/build.go
>
>
> Index: src/cmd/dist/build.c
> ==============================**==============================**=======
> --- a/src/cmd/dist/build.c
> +++ b/src/cmd/dist/build.c
> @@ -617,8 +617,17 @@
> // set up gcc command line on first run.
> if(gccargs.len == 0) {
> xgetenv(&b, "CC");
> - if(b.len == 0)
> - bprintf(&b, "gcc");
> + if(b.len == 0) {
> + // Use clang on OS X, because gcc is deprecated
> there.
> + // Xcode for OS X 10.9 Mavericks will ship a fake
> "gcc" binary that
> + // actually runs clang. We prepare different
> command
> + // lines for the two binaries, so it matters what
> we call it.
> + // See golang.org/issue/5822.
> + if(streq(gohostos, "darwin")
> + bprintf(&b, "clang");
> + else
> + bprintf(&b, "gcc");
> + }
> clang = contains(bstr(&b), "clang");
> splitfields(&gccargs, bstr(&b));
> for(i=0; i<nelem(proto_gccargs); i++)
> Index: src/cmd/go/build.go
> ==============================**==============================**=======
> --- a/src/cmd/go/build.go
> +++ b/src/cmd/go/build.go
> @@ -1771,6 +1771,19 @@
> return b.run(p.Dir, p.ImportPath, nil, cmd, "-o", out, obj, flags)
> }
>
> +var defaultCC = "gcc"
> +
> +func init() {
> + // Use clang on OS X, because gcc is deprecated there.
> + // Xcode for OS X 10.9 Mavericks will ship a fake "gcc" binary that
> + // actually runs clang. We prepare different command
> + // lines for the two binaries, so it matters what we call it.
> + // See golang.org/issue/5822.
> + if runtime.GOOS == "darwin" {
> + defaultCC = "clang"
> + }
> +}
> +
> // gccCmd returns a gcc command line prefix
> func (b *builder) gccCmd(objdir string) []string {
> return b.ccompilerCmd("CC", "gcc", objdir)
>
>
> --
>
> ---You received this message because you are subscribed to the Google
> Groups "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-dev+unsubscribe@**googlegroups.com<golang-dev%2Bunsubscribe@googlegrou...
> .
> For more options, visit
https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/o...
> .
>
>
>
Go for it. I have a 10.6 machine at home still which I can test ...
11 years, 7 months ago
(2013-08-02 17:33:40 UTC)
#4
Go for it. I have a 10.6 machine at home still which I can test later.
On Fri, Aug 2, 2013 at 10:23 AM, Russ Cox <rsc@golang.org> wrote:
> I have no idea what the version story is. We may need to be more precise
> about that. For now I want to see what breaks.
>
>
>
I get errors when running this on 10.6: # crypto/x509 /var/folders/a0/a0ATNr3xHliked0p+c3lIU+++TI/-Tmp-/go-build255322058/crypto/x509/_obj/_cgo_gotypes.go:14: syntax error: unexpected type, ...
11 years, 7 months ago
(2013-08-02 17:59:30 UTC)
#7
I get errors when running this on 10.6:
# crypto/x509
/var/folders/a0/a0ATNr3xHliked0p+c3lIU+++TI/-Tmp-/go-build255322058/crypto/x509/_obj/_cgo_gotypes.go:14:
syntax error: unexpected type, expecting name
/var/folders/a0/a0ATNr3xHliked0p+c3lIU+++TI/-Tmp-/go-build255322058/crypto/x509/_obj/_cgo_gotypes.go:26:
syntax error: unexpected .
:7[/var/folders/a0/a0ATNr3xHliked0p+c3lIU+++TI/-Tmp-/go-build255322058/crypto/x509/_obj/_cgo_gotypes.go:34]:
syntax error: unexpected type, expecting name
:8[/var/folders/a0/a0ATNr3xHliked0p+c3lIU+++TI/-Tmp-/go-build255322058/crypto/x509/_obj/_cgo_gotypes.go:35]:
syntax error: unexpected type, expecting name
On Fri, Aug 2, 2013 at 10:46 AM, Russ Cox <rsc@golang.org> wrote:
> PTAL
>
> Added logic to cmd/cgo and disabled the cgo -godefs test.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
Breaks on 10.8 too: % clang --version Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM ...
11 years, 7 months ago
(2013-08-02 19:13:20 UTC)
#13
Breaks on 10.8 too:
% clang --version
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
% ./make.bash
# Building C bootstrap tool.
cmd/dist
cmd/dist/build.c:642:6: error: variable 'clang' is uninitialized when
used here [-Werror,-Wuninitialized]
if(clang) {
^~~~~
cmd/dist/build.c:592:39: note: initialize the variable 'clang' to
silence this warning
bool islib, ispkg, isgo, stale, clang;
^
= 0
1 error generated.
On Fri, Aug 2, 2013 at 3:59 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote:
> Breaks on Linux:
>
> # Building C bootstrap tool.
> cmd/dist
> cmd/dist/build.c: In function 'install':
> cmd/dist/build.c:642:5: error: 'clang' may be used uninitialized in this
> function [-Werror=uninitialized]
> cc1: all warnings being treated as errors
> Build complete, duration 1.367061013s. Result: error: exit status 1
>
>
>
> On Fri, Aug 2, 2013 at 11:58 AM, <rsc@golang.org> wrote:
>>
>> *** Submitted as
>> https://code.google.com/p/go/source/detail?r=ede1d772501b ***
>>
>> build: on OS X 10.8 and later, use clang instead of gcc
>>
>>
>> Fixes issue 5822.
>> Will no doubt cause other problems, but Apple has forced our hand.
>>
>> R=golang-dev, bradfitz, khr
>> CC=golang-dev
>> https://codereview.appspot.com/12350044
>>
>>
>> https://codereview.appspot.com/12350044/
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
Francisco Souza
Issue 12350044: code review 12350044: build: on OS X use clang instead of gcc
(Closed)
Created 11 years, 7 months ago by rsc
Modified 11 years, 7 months ago
Reviewers: fss
Base URL:
Comments: 0