Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 594492 - >=dev-lang/go-1.7 fails to build on OS X 10.1{1,2}.x
Summary: >=dev-lang/go-1.7 fails to build on OS X 10.1{1,2}.x
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 OS X
: Normal normal with 1 vote (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-20 09:12 UTC by Stuart Shelton
Modified: 2020-03-10 07:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Log #1 - Build failure for >=dev-lang/go-1.8 (1.8_9999.log,10.57 KB, text/plain)
2017-02-22 15:40 UTC, Stuart Shelton
Details
Log #2 - Build output for dev-lang/go-1.7 (1.7.log,6.31 KB, text/plain)
2017-02-22 15:41 UTC, Stuart Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2016-09-20 09:12:42 UTC
Building the latest go (dev-lang/go-1.7.0 built correctly) fails with:

# crypto/x509
crypto/x509/root_cgo_darwin.go: In function 'FetchPEMRoots':
crypto/x509/root_cgo_darwin.go:97: error: 'for' loop initial declaration used outside C99 mode
crypto/x509/root_cgo_darwin.go:106: error: 'for' loop initial declaration used outside C99 mode
crypto/x509/root_cgo_darwin.go:114: error: 'SecCertificateCopyNormalizedSubjectContent' is unavailable (declared at /System/Library/Frameworks/Security.framework/Headers/SecCertificate.h:471)
crypto/x509/root_cgo_darwin.go:119: error: 'SecCertificateCopyNormalizedIssuerContent' is unavailable (declared at /System/Library/Frameworks/Security.framework/Headers/SecCertificate.h:453)

... editing lines 97 & 106 of the aforementioned file to move the variable declaration outside of the loop statement fixes the C99 errors, but the 'unavailable' frameworks are still an issue.

(I notice this is also independently reported at https://trac.macports.org/ticket/52036)

Build log:

$ emerge -v dev-lang/go

These are the packages that would be merged, in order:

Calculating dependencies                            ... done!
[ebuild     U  ] dev-lang/go-1.7.1:0/1.7.1::gentoo_prefix [1.7:0/1.7::gentoo_prefix] USE="-gccgo" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB


>>> Verifying ebuild manifests
>>> Running pre-merge checks for dev-lang/go-1.7.1

>>> Emerging (1 of 1) dev-lang/go-1.7.1::gentoo_prefix
 * go-darwin-amd64-bootstrap.tbz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                   [ ok ]
 * go1.7.1.src.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking go-darwin-amd64-bootstrap.tbz to /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work
>>> Unpacking go1.7.1.src.tar.gz to /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work
>>> Source unpacked in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work
>>> Preparing source in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go ...
>>> Source prepared.
>>> Configuring source in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go ...
>>> Source configured.
>>> Compiling source in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go ...
 * GOROOT_BOOTSTRAP is /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go-darwin-amd64-bootstrap
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go-darwin-amd64-bootstrap.
bootstrap/internal/bio
bootstrap/asm/internal/flags
bootstrap/internal/sys
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/internal/obj
bootstrap/internal/obj/arm
bootstrap/internal/obj/mips
bootstrap/internal/obj/s390x
bootstrap/internal/obj/arm64
bootstrap/internal/obj/ppc64
bootstrap/internal/obj/x86
bootstrap/asm/internal/lex
bootstrap/link/internal/ld
bootstrap/compile/internal/ssa
bootstrap/asm/internal/arch
bootstrap/asm/internal/asm
bootstrap/asm
bootstrap/link/internal/arm
bootstrap/link/internal/amd64
bootstrap/link/internal/arm64
bootstrap/link/internal/mips64
bootstrap/link/internal/ppc64
bootstrap/link/internal/s390x
bootstrap/link/internal/x86
bootstrap/link
bootstrap/compile/internal/gc
bootstrap/compile/internal/arm64
bootstrap/compile/internal/arm
bootstrap/compile/internal/amd64
bootstrap/compile/internal/mips64
bootstrap/compile/internal/ppc64
bootstrap/compile/internal/s390x
bootstrap/compile/internal/x86
bootstrap/compile

##### Building go_bootstrap for host, darwin/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
unicode/utf8
errors
internal/race
sync/atomic
sort
unicode
unicode/utf16
encoding
math
internal/syscall/windows/sysdll
sync
container/heap
io
syscall
internal/singleflight
hash
strings
bytes
hash/adler32
strconv
bufio
path
regexp/syntax
crypto
encoding/base64
reflect
internal/syscall/windows/registry
internal/syscall/windows
time
crypto/sha1
regexp
os
os/signal
path/filepath
io/ioutil
fmt
encoding/binary
log
go/token
debug/dwarf
text/template/parse
compress/flate
encoding/json
net/url
flag
context
os/exec
go/scanner
go/ast
compress/zlib
text/template
debug/elf
debug/macho
go/parser
go/doc
go/build
cmd/go

##### Building packages and commands for darwin/amd64.
runtime/internal/sys
runtime/internal/atomic
runtime
internal/race
errors
sync/atomic
unicode/utf8
unicode
math
sort
container/list
container/ring
internal/nettrace
crypto/subtle
encoding
unicode/utf16
image/color
internal/syscall/windows/sysdll
runtime/race
sync
cmd/compile/internal/test
cmd/vet/internal/whitelist
container/heap
image/color/palette
io
syscall
internal/singleflight
hash
crypto/cipher
runtime/trace
hash/adler32
hash/crc32
crypto/hmac
hash/crc64
hash/fnv
bytes
strings
bufio
text/tabwriter
vendor/golang_org/x/net/lex/httplex
path
html
strconv
math/rand
math/cmplx
compress/bzip2
time
reflect
crypto
regexp/syntax
crypto/rc4
crypto/aes
encoding/base64
encoding/base32
encoding/ascii85
image
crypto/sha512
crypto/md5
crypto/sha1
crypto/sha256
encoding/pem
os
image/internal/imageutil
image/draw
image/jpeg
regexp
path/filepath
vendor/golang_org/x/net/route
runtime/debug
os/signal
io/ioutil
cmd/internal/pprof/svg
encoding/binary
fmt
cmd/internal/sys
crypto/des
index/suffixarray
flag
log
debug/dwarf
compress/flate
debug/gosym
debug/plan9obj
cmd/vendor/golang.org/x/arch/arm/armasm
cmd/vendor/golang.org/x/arch/x86/x86asm
archive/tar
compress/lzw
context
math/big
encoding/hex
go/token
os/exec
database/sql/driver
encoding/csv
go/scanner
database/sql
encoding/gob
encoding/json
cmd/internal/obj
go/ast
encoding/xml
vendor/golang_org/x/net/http2/hpack
compress/zlib
archive/zip
compress/gzip
mime
mime/quotedprintable
net/http/internal
debug/elf
debug/macho
debug/pe
net/url
text/template/parse
text/scanner
cmd/internal/goobj
image/gif
image/png
runtime/pprof
internal/trace
net/internal/socktest
testing/iotest
testing/quick
testing
go/parser
go/printer
crypto/dsa
crypto/elliptic
encoding/asn1
crypto/rand
go/constant
cmd/internal/objfile
cmd/internal/obj/arm
cmd/internal/obj/arm64
crypto/rsa
cmd/internal/obj/mips
text/template
internal/testenv
crypto/x509/pkix
cmd/internal/obj/ppc64
cmd/internal/obj/s390x
cmd/internal/obj/x86
cmd/addr2line
cmd/asm/internal/flags
crypto/ecdsa
cmd/asm/internal/lex
cmd/internal/bio
go/types
cmd/compile/internal/big
cmd/cgo
go/format
cmd/internal/gcprog
cmd/dist
cmd/fix
cmd/gofmt
cmd/internal/pprof/profile
go/doc
html/template
cmd/compile/internal/ssa
go/build
cmd/internal/pprof/tempfile
cmd/link/internal/ld
cmd/nm
cmd/internal/pprof/plugin
cmd/internal/pprof/symbolz
cmd/internal/pprof/symbolizer
cmd/objdump
cmd/pack
cmd/vet/internal/cfg
cmd/internal/pprof/report
cmd/yacc
cmd/cover
cmd/doc
cmd/internal/pprof/commands
cmd/internal/pprof/driver
cmd/asm/internal/arch
runtime/cgo
go/internal/gccgoimporter
cmd/api
go/internal/gcimporter
cmd/asm/internal/asm
go/importer
cmd/asm
cmd/vet
cmd/link/internal/arm64
cmd/link/internal/arm
cmd/link/internal/amd64
cmd/link/internal/mips64
cmd/link/internal/ppc64
cmd/link/internal/s390x
cmd/link/internal/x86
os/user
net
cmd/link
cmd/compile/internal/gc
crypto/x509
net/textproto
net/http/httptrace
log/syslog
mime/multipart
net/mail
# crypto/x509
crypto/x509/root_cgo_darwin.go: In function 'FetchPEMRoots':
crypto/x509/root_cgo_darwin.go:97: error: 'for' loop initial declaration used outside C99 mode
crypto/x509/root_cgo_darwin.go:106: error: 'for' loop initial declaration used outside C99 mode
crypto/x509/root_cgo_darwin.go:114: error: 'SecCertificateCopyNormalizedSubjectContent' is unavailable (declared at /System/Library/Frameworks/Security.framework/Headers/SecCertificate.h:471)
crypto/x509/root_cgo_darwin.go:119: error: 'SecCertificateCopyNormalizedIssuerContent' is unavailable (declared at /System/Library/Frameworks/Security.framework/Headers/SecCertificate.h:453)
cmd/compile/internal/amd64
cmd/compile/internal/arm64
cmd/compile/internal/arm
cmd/compile/internal/mips64
cmd/compile/internal/ppc64
cmd/compile/internal/s390x
cmd/compile/internal/x86
cmd/compile
 * ERROR: dev-lang/go-1.7.1::gentoo_prefix failed (compile phase):
 *   build failed
 * 
 * Call stack:
 *     ebuild.sh, line 133:  Called __call-ebuildshell 'src_compile'
 *     ebuild.sh, line 542:  Called src_compile
 *   environment, line 1110:  Called die
 * The specific snippet of code:
 *       ./make.bash || die "build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/go-1.7.1::gentoo_prefix'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/go-1.7.1::gentoo_prefix'`.
 * The complete build log is located at '/Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/temp/build.log.gz'.
 * The ebuild environment file is located at '/Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/temp/environment'.
 * Working directory: '/Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go/src'
 * S: '/Volumes/Scratch/tmp/portage/dev-lang/go-1.7.1/work/go'

FYI, this error occurs with the platform compilers and the Gentoo Prefix' gcc-4.2.1 and clang compilers.

$ emerge --info
Portage 2.2.28-prefix (python 2.7.11-final-0, prefix/darwin/macos/10.11/x64, gcc-4.2.1, unavailable, 15.6.0 x86_64)
=================================================================
System uname: Darwin-15.6.0-x86_64-i386-64bit
Timestamp of repository gentoo_prefix: Tue, 20 Sep 2016 08:26:49 +0000
sh bash 4.3_p42-r1
app-shells/bash:      4.3_p42-r1::gentoo_prefix
dev-lang/perl:        5.24.0-r1::gentoo_prefix
dev-lang/python:      2.7.11-r2::gentoo_prefix
dev-util/cmake:       3.6.2::gentoo_prefix
dev-util/pkgconfig:   0.29.1::gentoo_prefix
sys-devel/autoconf:   2.69::gentoo_prefix
sys-devel/automake:   1.14.1::gentoo_prefix, 1.15::gentoo_prefix
sys-devel/gcc-config: 1.8-r1::gentoo_prefix
sys-devel/libtool:    2.4.6-r1::gentoo_prefix
sys-devel/make:       4.2.1::gentoo_prefix
Comment 1 Stuart Shelton 2016-11-08 17:17:15 UTC
(Initial comment referred to dev-lang/go-1.7.1)


The 'go' ebuilds pull in an (architecture/OS-specific) unversioned 'bootstrap' package.  I'm not sure whether this has been changed, if there's a problem with LLVM, or if this is a breakage due to macOS 10.12, but I cannot upgrade go or even rebuild the version currently installed.  It strikes me that the bootstrap tarballs need to be versioned along with the ebuild built against them...


Attempting to build dev-lang/go-1.7.3:

Using the system/Xcode compilers, the result is:

>>> Compiling source in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.3/work/go ...
 * GOROOT_BOOTSTRAP is /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.3/work/go-darwin-amd64-bootstrap
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.3/work/go-darwin-amd64-bootstrap.
bootstrap/internal/sys
bootstrap/internal/bio
bootstrap/asm/internal/flags
bootstrap/internal/gcprog
bootstrap/compile/internal/big
bootstrap/internal/obj
# bootstrap/internal/obj
runtime: newstack sp=0xc82004df40 stack=[0xc385421e88d8, 0xc82004dfe0]
        morebuf={pc:0x190b1 sp:0xc82004df50 lr:0x0}
        sched={pc:0x1c750 sp:0xc82004df48 lr:0x0 ctxt:0x0}
runtime: gp=0xc8204bc480, gp->status=0x4
 runtime: split stack overflow: 0xc82004df40 < 0xc385421e88d8
fatal error: runtime: split stack overflow

runtime stack:
runtime.throw(0x44bfe0, 0x1d)
        /tmp/go-darwin-amd64-bootstrap/src/runtime/panic.go:527 +0x90
runtime.newstack()
        /tmp/go-darwin-amd64-bootstrap/src/runtime/stack1.go:752 +0x89f
runtime.morestack()
        /tmp/go-darwin-amd64-bootstrap/src/runtime/asm_amd64.s:330 +0x7f

goroutine 20 [stack growth]:
runtime.gcDrain(0xc820042720, 0x7d0)
        /tmp/go-darwin-amd64-bootstrap/src/runtime/mgcmark.go:718 fp=0xc82004df50 sp=0xc82004df48
runtime.gcBgMarkWorker(0xc820041500)
        /tmp/go-darwin-amd64-bootstrap/src/runtime/mgc.go:1320 +0x281 fp=0xc82004dfb8 sp=0xc82004df50
runtime.goexit()
        /tmp/go-darwin-amd64-bootstrap/src/runtime/asm_amd64.s:1721 +0x1 fp=0xc82004dfc0 sp=0xc82004dfb8
created by runtime.gcBgMarkStartWorkers
        /tmp/go-darwin-amd64-bootstrap/src/runtime/mgc.go:1239 +0x93

goroutine 1 [runnable]:
cmd/compile/internal/gc.mergetemp(0xc8211e39e0)
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/gc/popt.go:587 +0x185
cmd/compile/internal/gc.regopt(0xc8211e39e0)
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/gc/reg.go:1037 +0x4f
cmd/compile/internal/gc.compile(0xc8207fcfc0)
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/gc/pgen.go:508 +0xe82
cmd/compile/internal/gc.funccompile(0xc8207fcfc0)
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/gc/dcl.go:1484 +0x1c9
cmd/compile/internal/gc.Main()
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/gc/lex.go:473 +0x1f08
cmd/compile/internal/amd64.Main()
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/internal/amd64/galign.go:127 +0x58d
main.main()
        /tmp/go-darwin-amd64-bootstrap/src/cmd/compile/main.go:26 +0x189

... at which point the process hangs.


If I use Gentoo Prefix LLVM, the output is:

>>> Compiling source in /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.3/work/go ...
 * GOROOT_BOOTSTRAP is /Volumes/Scratch/tmp/portage/dev-lang/go-1.7.3/work/go-darwin-amd64-bootstrap
##### Building Go bootstrap tool.
cmd/dist


... at which point the process hangs, spinning on CPU.  dtrussing the process shows only two operations being performed by the './cmd/dist/dist bootstrap -a -v' process:

gettimeofday(0xC820063EC0, 0x0, 0x0)             = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xC820063EF0)                 = 0 0
Comment 2 yuex 2016-12-31 22:16:50 UTC
The version of the bootstrap distribution used in go-1.7.4.ebuild for darwin is 1.5.3. There is a VERSION file in it. It seems it's a little bit outdated. Update it to a newer binary distribution for MacOS should work.

Anyway, I tried to bootstrap go-1.7.4 using go-1.7.4 binary. It worked.

Maybe there should be bindist USE flag for dev-lang/go since google has already pre-compiled go for various platforms.
Comment 3 William Hubbs gentoo-dev 2017-02-22 14:51:43 UTC
I have been advised on irc that this issue is resolved in go 1.8. Please
re-open if it isn't. Thanks much.
Comment 4 Stuart Shelton 2017-02-22 15:40:39 UTC
Created attachment 464722 [details]
Log #1 - Build failure for >=dev-lang/go-1.8
Comment 5 Stuart Shelton 2017-02-22 15:41:12 UTC
Created attachment 464724 [details]
Log #2 - Build output for dev-lang/go-1.7
Comment 6 Stuart Shelton 2017-02-22 15:42:47 UTC
For me, go-1.8 & go-9999 are both failing with:

[See log #1]

... which may be due to the clang '--gdwarf2' error, or this may be circumstantial.

Attempting to build go-1.7, the process hangs with:

[See log #2]

... which eventually eats up all of the host's memory if not interrupted.

What OS release/compiler combination was used by people for whom this worked?
Comment 7 Vladimir Smirnov (RETIRED) gentoo-dev 2017-02-22 16:42:21 UTC
Can you please post 'emerge --info' output? And also with which flags clang and llvm was built on your system? ('emerge -pv --nodeps clang llvm' output). I also have OSX Prefix but I can't reproduce your problem.
Comment 8 Fabian Groffen gentoo-dev 2017-02-22 16:43:05 UTC
1.8 compiles/installs for me.

macOS Sierra
% clang --version
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Library/Gentoo-Sierra/usr/bin
% go version
go version go1.8 darwin/amd64

I remember seeing the spontaneous die on my laptop though, but there I use a Capitan prefix on top of Sierra, which I suspect as a possible cause.
Comment 9 Stuart Shelton 2017-02-22 21:03:58 UTC
(In reply to Vladimir Smirnov from comment #7)
> Can you please post 'emerge --info' output? And also with which flags clang
> and llvm was built on your system? ('emerge -pv --nodeps clang llvm'
> output). I also have OSX Prefix but I can't reproduce your problem.

It's notable that when building with the platform default compiler ('Apple LLVM version 8.0.0 (clang-800.0.42.1)') rather than the Prefix one ('clang version 3.9.1 (tags/RELEASE_391/final)'), I get the same failure in the same place.

If there is anything weird about the *FLAGS, compilers, or other development packages, it's not affected the 312 other packages currently installed!


$ emerge -pv --nodeps clang llvm

These are the packages that would be merged, in order:

[ebuild   R    ] sys-devel/clang-3.9.1-r100:0/3.9.1::gentoo_prefix  USE="python static-analyzer -debug -multitarget" LLVM_TARGETS="AMDGPU (X86) -AArch64 -ARM -BPF -Hexagon -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -XCore" 0 KiB
[ebuild   R    ] sys-devel/llvm-3.9.1-r1:0/3.9.1:: gentoo_prefix  USE="(clang) default-libcxx libedit libffi ncurses python static-analyzer xml -debug -default-compiler-rt -doc -gold (-lldb) -multitarget -ocaml -sanitize {-test}" LLVM_TARGETS="AMDGPU (X86) -AArch64 -ARM -BPF -Hexagon -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -XCore" PYTHON_TARGETS="python2_7" 0 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB

$ emerge --info
Portage 2.3.2-prefix (python 2.7.12-final-0, prefix/darwin/macos/10.12/x64, gcc-4.2.1, unavailable, 16.4.0 x86_64)
=================================================================
System uname: Darwin-16.4.0-x86_64-i386-64bit
Timestamp of repository gentoo_prefix: Tue, 21 Feb 2017 19:26:59 +0000
sh bash 4.3_p48-r1
app-shells/bash:      4.3_p48-r1::srcshelton
dev-lang/perl:        5.24.1::srcshelton
dev-lang/python:      2.7.12::srcshelton
dev-util/cmake:       3.7.2::gentoo_prefix
dev-util/pkgconfig:   0.29.1::gentoo_prefix
sys-devel/autoconf:   2.69::gentoo_prefix
sys-devel/automake:   1.14.1::gentoo_prefix, 1.15::gentoo_prefix
sys-devel/gcc-config: 1.8-r1::gentoo_prefix
sys-devel/libtool:    2.4.6-r1::gentoo_prefix
sys-devel/make:       4.2.1::gentoo_prefix
Repositories:

gentoo_prefix
    location: /opt/gentoo/var/db/repo/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix
    priority: -1000
    aliases: gentoo

srcshelton
    location: /opt/gentoo/var/db/repo/srcshelton
    sync-type: git
    sync-uri: https://github.com/srcshelton/gentoo-ebuilds.git
    masters: gentoo_prefix

ACCEPT_KEYWORDS="amd64 amd64-linux x64-macos ~x64-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin16"
CC="/opt/gentoo/usr/bin/clang"
CFLAGS="-arch x86_64 -march=core-avx-i -fcolor-diagnostics -O3 -pipe -fno-builtin -Wno-implicit-function-declaration -mmacosx-version-min=10.12"
CHOST="x86_64-apple-darwin16"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/ssl/certs /etc/terminfo /opt/gentoo/etc/ssl/certs"
CXX="/opt/gentoo/usr/bin/clang++"
CXXFLAGS=" -arch x86_64 -march=core-avx-i -fcolor-diagnostics -O3 -pipe -fno-builtin -Wno-implicit-function-declaration -mmacosx-version-min=10.12"
DISTDIR="/opt/gentoo/var/cache/portage/dist"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs buildpkg candy case-insensitive-fs clean-logs collision-protect compress-build-logs compressdebug config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch parallel-install preserve-libs protect-owned sfperms split-elog split-log splitdebug strict stricter unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans unprivileged userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LC_ALL="C"
LDFLAGS="-Wl,-dead_strip_dylibs -L/opt/gentoo/usr/lib -L/usr/lib"
MAKEOPTS="-j7"
PKGDIR="/opt/gentoo/var/cache/portage/pkg/clang"
PORTAGE_CONFIGROOT="/opt/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/Volumes/Scratch/tmp"
USE="aqua berkdb bzip2 clang coreaudio cracklib crypt cvs cxx expat gdbm git gmp http2 iconv icu idn ipv6 jemalloc libcxx libedit lto lzma lzo mercurial modules mpfr ncurses nls objc objc++ openmp pcre perl pgo prefix prefix-guest python python2 readline sqlite ssl subversion threads unicode vim-syntax x64-macos xml zlib" ABI_X86="64" CPU_FLAGS_X86="mmx sse sse2 ssse3" ELIBC="Darwin" KERNEL="Darwin" LINGUAS="en en_GB" LLVM_TARGETS="X86 AMDGPU" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="radeon"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 10 Fabian Groffen gentoo-dev 2017-02-23 09:53:33 UTC
I think you could try to drop the -mmacosx-version-min=10.12, or with default cflags.
Comment 11 John Gibson 2017-03-01 16:48:58 UTC
(In reply to yuex from comment #2)
> The version of the bootstrap distribution used in go-1.7.4.ebuild for darwin
> is 1.5.3. There is a VERSION file in it. It seems it's a little bit
> outdated. Update it to a newer binary distribution for MacOS should work.
> 
> Anyway, I tried to bootstrap go-1.7.4 using go-1.7.4 binary. It worked.
> 
> Maybe there should be bindist USE flag for dev-lang/go since google has
> already pre-compiled go for various platforms.

I ran into the same issue when installing go-1.7.5 on Sierra. I was able to bootstrap 1.7.5 by using the 1.7.5 binary.

Looking back at my old prefix on El Capitan I installed dev-lang/go-1.5.3 by bootstrapping with 1.4.3. Note that the bootstrap in that case was a separate package named dev-lang/go-bootstrap. It seems that they've removed the separate bootstrapping package for the 1.7 series.

John
Comment 12 Stuart Shelton 2017-03-06 12:30:21 UTC
Tried again with only CFLAGS='-pipe' CXXFLAGS='-pipe' - and got the same failure as attached above (log #1).


(In reply to Fabian Groffen from comment #10)
> I think you could try to drop the -mmacosx-version-min=10.12, or with
> default cflags.
Comment 13 William Hubbs gentoo-dev 2017-04-19 17:57:29 UTC
Ping, any updates on this? how are things with go-1.8.1?
Comment 14 Fabian Groffen gentoo-dev 2017-04-19 19:09:14 UTC
I could install 1.8.1, would like to know if it still fails for Stuart
Comment 15 Stuart Shelton 2017-04-22 19:48:53 UTC
'fraid so :(

> ##### Building packages and commands for darwin/amd64.
>
> ...
>
> # runtime/cgo
> clang-3.9: error: unsupported option '--gdwarf2'
> cmd/compile/internal/gc
> cmd/compile/internal/arm
> cmd/compile/internal/amd64
> cmd/compile/internal/mips
> cmd/compile/internal/arm64
> cmd/compile/internal/mips64
> cmd/compile/internal/ppc64
> cmd/compile/internal/s390x
> cmd/compile/internal/x86
> cmd/compile
>  * ERROR: dev-lang/go-1.8.1::gentoo_prefix failed (compile phase):
>  *   build failed

... as before.

If this is working for everyone else, I wonder what it's tripping over on this system... ?
Comment 16 Fabian Groffen gentoo-dev 2017-04-23 08:23:37 UTC
Indeed, but now it seems to complain about --gdwarf option or something?  I would only expect that on ELF-targets, not Darwin (Mach-O).

I just checked and it doesn't do this for me, so perhaps it misdetects your system for some reason.
Comment 17 Stuart Shelton 2017-04-24 12:25:26 UTC
Hmm - that's a long-running issue rather than a new one, it's pretty much always done that for me.  A while ago I did have a bit of a dig to find out where it was coming from, but wasn't able to resolve anything.

If I'm the only one seeing this, though, then that's new information - I'll have another look to see what causes it to be included.


(In reply to Fabian Groffen from comment #16)
> Indeed, but now it seems to complain about --gdwarf option or something?  I
> would only expect that on ELF-targets, not Darwin (Mach-O).
> 
> I just checked and it doesn't do this for me, so perhaps it misdetects your
> system for some reason.
Comment 18 Yana Luna-Terra 2017-05-13 21:39:14 UTC
go 1.8.1 merges for me.

Portage 2.3.5-prefix (python 3.5.2-final-0, prefix/darwin/macos/10.12/x64, clang-3.9.1, unavailable, 16.5.0 x86_64)
=================================================================
System uname: Darwin-16.5.0-x86_64-i386-64bit
Timestamp of repository gentoo_prefix: Fri, 12 May 2017 17:26:51 +0000
sh bash 4.3_p48
app-shells/bash:      4.3_p48::gentoo_prefix
dev-java/java-config: 2.2.0-r3::gentoo_prefix
dev-lang/perl:        5.24.1-r1::gentoo_prefix
dev-lang/python:      2.7.12::gentoo_prefix, 3.5.2::gentoo_prefix
dev-util/cmake:       3.8.1::gentoo_prefix
dev-util/pkgconfig:   0.29.1::gentoo_prefix
sys-devel/autoconf:   2.69-r3::gentoo_prefix
sys-devel/automake:   1.14.1-r1::gentoo_prefix, 1.15-r2::gentoo_prefix
sys-devel/libtool:    2.4.6-r4::gentoo_prefix
sys-devel/make:       4.2.1-r1::gentoo_prefix
Repositories:

gentoo_prefix
    location: /Users/yegortimoshenko/Documents/Gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix
    priority: -1000

yegortimoshenko
    location: /Users/yegortimoshenko/Documents/Projects/overlay
    masters: gentoo_prefix
    priority: 0

ACCEPT_KEYWORDS="~x64-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin16"
CC="x86_64-apple-darwin16-clang"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-apple-darwin16"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXX="x86_64-apple-darwin16-clang++"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/Users/yegortimoshenko/Documents/Gentoo/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-dead_strip_dylibs"
MAKEOPTS="-j3"
PKGDIR="/Users/yegortimoshenko/Documents/Gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/yegortimoshenko/Documents/Gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/Users/yegortimoshenko/Documents/Gentoo/var/tmp"
USE="aqua coreaudio cracklib cxx ipv6 modules ncurses objc objc++ prefix prefix-guest readline ssl unicode x64-macos zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 19 William Hubbs gentoo-dev 2020-02-02 20:33:29 UTC
Can we get an update on this bug?
I think the version of MacOS listed is now pretty old, and I know the
versions of go listed have been out of support for some time.
Comment 20 Fabian Groffen gentoo-dev 2020-02-03 07:08:31 UTC
FWIW, I've got go-1.13.1 installed on 10.13.6.  Doesn't mean much for OP though, as back then we already confirmed that what worked for me didn't work for him.  I think we ran out of ideas for how to fix the issue.
Comment 21 William Hubbs gentoo-dev 2020-03-09 21:06:15 UTC
Feel free to obsolete this bug then if you would like to.