clang: error: linker command failed with exit code 1 When building Go

25,134 views
Skip to first unread message

Jo Chasinga

unread,
Oct 10, 2014, 3:41:17 PM10/10/14
to golan...@googlegroups.com
After pulling the source code and trying to build the distribution

$ hg clone -u release https://code.google.com/p/go
$ cd $GOPATH
/src && ./all.bash

I got 
# Building C bootstrap tool.
cmd
/dist
ld
: can't open output file for writing 'cmd/dist/dist.ld_Jw7EPh', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1

Now there's obviously something going on with the C-thingy. But I'm really inexperienced in C and would appreciate the help from here. Do. (I just updated to Xcode 5 so maybe that's where the problem is)

Jo Chasinga

unread,
Oct 10, 2014, 3:50:49 PM10/10/14
to golan...@googlegroups.com
I just figured it out myself. Using sudo fixed the problem!

andrey mirtchovski

unread,
Oct 10, 2014, 3:54:22 PM10/10/14
to Jo Chasinga, golang-nuts
there should not be a need to use sudo if everything is in your home directory.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Roger Pack

unread,
Oct 10, 2014, 4:07:03 PM10/10/14
to golan...@googlegroups.com
Wonder if it's related to something like  https://github.com/kripken/emscripten/issues/1939

john...@gmail.com

unread,
Oct 10, 2014, 10:53:05 PM10/10/14
to golan...@googlegroups.com
I am getting the same exact thing.  

* OSX 10.10
* Golang 1.3.3 ( http://golang.org/dl/

Dave Cheney

unread,
Oct 12, 2014, 3:42:32 AM10/12/14
to golan...@googlegroups.com, john...@gmail.com
Remembering that OS X 10.10 is not yet released, please consider raising a bug about this.

andrey mirtchovski

unread,
Oct 12, 2014, 3:17:36 PM10/12/14
to john...@gmail.com, golang-nuts
can both of you seeing this issue provide a little bit more
information, including which developer preview you're on and the
versions of xcode you're using?

I upgraded to the latest downloadable golden master (about box says
only "Version 10.10") from the apple site and see the following with
xcode 6.0.1:

$ uname -a
Darwin ... 14.0.0 Darwin Kernel Version 14.0.0: Tue Sep 23 23:01:41
PDT 2014; root:xnu-2782.1.97~6/RELEASE_X86_64 x86_64
$ hg summary
parent: 20235:f44017549ff9 go1.3.3 release
go1.3.3
branch: release-branch.go1.3
commit: (clean)
update: (current)
$ xcodebuild -version
Xcode 6.0.1
Build version 6A317
$ time ./all.bash
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
liblink
[...]
ALL TESTS PASSED

---
Installed Go for darwin/amd64 in /Users/aam/go-release
Installed commands in /Users/aam/go-release/bin
*** You need to add /Users/aam/go-release/bin to your PATH.

real 3m17.863s
user 4m31.574s
sys 1m10.010s
$ ~/go-release/bin/go version
go version go1.3.3 darwin/amd64
$


the only error I see is a missing pkg-config in the shootout tests:

./timing.sh: line 165: pkg-config: command not found

I'll try with xcode 6.1 next.

zlcn...@gmail.com

unread,
Feb 9, 2015, 11:08:49 PM2/9/15
to golan...@googlegroups.com
try use sudo build

在 2014年10月11日星期六 UTC+8上午3:41:17,Jo Chasinga写道:

anurag....@gmail.com

unread,
Mar 1, 2016, 8:08:23 AM3/1/16
to golang-nuts

malenche...@gmail.com

unread,
Jan 11, 2017, 8:24:44 AM1/11/17
to golang-nuts

clang: warning: argument unused during compilation: '-pthread'

ld: warning: directory not found for option '-L/opt/boost/lib'

ld: warning: directory not found for option '-L/opt/local/lib/db48'

ld: library not found for -lssl

clang: error: linker command failed with exit code 1 (use -v to see invocation)



this error I'm getting please help

 

On Friday, October 10, 2014 at 12:41:17 PM UTC-7, Panisuan Chasinga wrote:

Ian Lance Taylor

unread,
Jan 11, 2017, 10:25:35 AM1/11/17
to malenche...@gmail.com, golang-nuts
On Wed, Jan 11, 2017 at 3:39 AM, <malenche...@gmail.com> wrote:
>
> clang: warning: argument unused during compilation: '-pthread'
>
> ld: warning: directory not found for option '-L/opt/boost/lib'
>
> ld: warning: directory not found for option '-L/opt/local/lib/db48'
>
> ld: library not found for -lssl
>
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
>
>
> this error I'm getting please help

When asking for help, you have to tell us 1) exactly what you did; 2)
exactly what happened; 3) what you expected to happen instead; 4)
details about your system and installation, such as the version of Go
you are using.

In this case I suspect that you need to install a libssl library, somehow.

Ian
Reply all
Reply to author
Forward
0 new messages