Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile: error: shifting a negative signed value. #17183

Closed
meowssir opened this issue Sep 21, 2016 · 6 comments
Closed

compile: error: shifting a negative signed value. #17183

meowssir opened this issue Sep 21, 2016 · 6 comments

Comments

@meowssir
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

x

What operating system and processor architecture are you using (go env)?

$ uname -a
Darwin Byrons-MacBook-Pro-3.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.4
BuildVersion: 15E65

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOROOT="/usr/local/Cellar/go/1.7.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ml/2nr7wt652n9ddq8yhtxfjzw40000gp/T/go-build066728938=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

Attempted to build Go 1.4 from source for a certain debugger tool. Following Installing Go from source guide.
$ git clone https://go.googlesource.com/go
$ cd go
$ git checkout go1.4
$ cd src
$ ./all.bash

What did you expect to see?

A successful build.

What did you see instead?

# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
/Users/byrongrogan/git/go/src/cmd/6c/txt.c:995:28: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
/Users/byrongrogan/git/go/src/cmd/6c/txt.c:1045:28: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
go tool dist: FAILED: clang -Wall -Wstrict-prototypes -Wextra -Wunused -Wno-sign-compare -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment -Wno-missing-field-initializers -Werror -fno-common -ggdb -pipe -Wuninitialized -O2 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -mmacosx-version-min=10.6 -c -m64 -I /Users/byrongrogan/git/go/include -I /Users/byrongrogan/git/go/src/cmd/6c -o /Users/byrongrogan/git/go/pkg/obj/cmd/6c/txt.o /Users/byrongrogan/git/go/src/cmd/6c/txt.c
@meowssir meowssir changed the title Failed installation. error: shifting a negative signed value. compile: error: shifting a negative signed value. Sep 21, 2016
@ianlancetaylor
Copy link
Member

Use git checkout go1.4.3, or use a binary download of Go 1.4.

@davecheney
Copy link
Contributor

Did you just install xcode8?

Edit cmd/dist and remove the -Werror flag wherever you find it. That'll get
you unblocked.

I've heard that there will be a 1.4.4 to fix the Sierra crash issue, but
there is no ETA so I'd apply this workaround.

On Thu, 22 Sep 2016, 05:41 Byron Grogan [email protected] wrote:

Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?

x
What operating system and processor architecture are you using (go env)?

$ uname -a
Darwin Byrons-MacBook-Pro-3.local 15.4.0 Darwin Kernel Version 15.4.0: Fri
Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.4
BuildVersion: 15E65

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOROOT="/usr/local/Cellar/go/1.7.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ml/2nr7wt652n9ddq8yhtxfjzw40000gp/T/go-build066728938=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

Attempted to build Go 1.4 from source for a certain debugger tool.
Following Installing Go from source
https://golang.org/doc/install/source guide.
$ git clone https://go.googlesource.com/go
$ cd go
$ git checkout go1.4
$ cd src
$ ./all.bash
What did you expect to see?

A successful build.
What did you see instead?

Building C bootstrap tool.

cmd/dist

Building compilers and Go bootstrap tool for host, darwin/amd64.

lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
/Users/byrongrogan/git/go/src/cmd/6c/txt.c:995:28: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
/Users/byrongrogan/git/go/src/cmd/6c/txt.c:1045:28: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
go tool dist: FAILED: clang -Wall -Wstrict-prototypes -Wextra -Wunused -Wno-sign-compare -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment -Wno-missing-field-initializers -Werror -fno-common -ggdb -pipe -Wuninitialized -O2 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -mmacosx-version-min=10.6 -c -m64 -I /Users/byrongrogan/git/go/include -I /Users/byrongrogan/git/go/src/cmd/6c -o /Users/byrongrogan/git/go/pkg/obj/cmd/6c/txt.o /Users/byrongrogan/git/go/src/cmd/6c/txt.c


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#17183, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAcAzPDvaPyeQ0WAJkJOSVJo5_Bw5fmks5qsYhQgaJpZM4KDMsy
.

@minux
Copy link
Member

minux commented Sep 22, 2016 via email

@jmhodges
Copy link
Contributor

Could we get release-branch.go1.4 updated to go1.4.3 then? I've just been using it like I do every release branch.

@jmhodges
Copy link
Contributor

Hm, on what seems to be the latest go1.4.3, I'm not able to get this to compile with clang 8.0.0.

See https://gist.github.com/jmhodges/411d8eadb01457c909d629229e6ff69a

@ianlancetaylor
Copy link
Member

I think you are running into #16352.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants