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

doc: go1.10.html states that i386/amd64 executables fail on NetBSD amd64 #23073

Closed
krytarowski opened this Issue Dec 10, 2017 · 19 comments

Comments

Projects
None yet
3 participants
@krytarowski
Contributor

krytarowski commented Dec 10, 2017

Please answer these questions before submitting your issue. Thanks!

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

N/A

Does this issue reproduce with the latest release?

N/A

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

N/A

What did you do?

N/A

What did you expect to see?

Removed note that 32-bit applications are broken on 64-bit NetBSD kernel.

What did you see instead?

The reverse.

The breakage was a regression on HEAD.

Fix:

Module Name:    src
Committed By:   christos
Date:           Thu Dec  7 16:22:22 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
Keep fs/gs the same for the signal context; otherwise calling things
like __lwp_getprivate_fast() from a signal handler (that uses %gs) die.

Merge context building code.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/amd64/amd64/netbsd32_machdep.c

http://mail-index.netbsd.org/source-changes/2017/12/07/msg090270.html

@bradfitz bradfitz changed the title from doc/go1.10.html states that i386/amd64 executables fail on NetBSD to doc: go1.10.html states that i386/amd64 executables fail on NetBSD amd64 Dec 10, 2017

@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 10, 2017

Member

The typo was already fixed in 38083c8

So does this pass now on an amd64 NetBSD kernel:

$ cd $GOROOT/src
$ GOHOSTARCH=386 GOARCH=386 ./all.bash

?

Is there a pullup to the netbsd-8 branch pending?

Member

bradfitz commented Dec 10, 2017

The typo was already fixed in 38083c8

So does this pass now on an amd64 NetBSD kernel:

$ cd $GOROOT/src
$ GOHOSTARCH=386 GOARCH=386 ./all.bash

?

Is there a pullup to the netbsd-8 branch pending?

@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 11, 2017

Member

@krytarowski, you didn't set GOHOSTARCH=386 in that log. Another way you can tell you didn't have that set is you can see this line in your output:

Building packages and commands for host, netbsd/amd64.

So it's auto-detecting that your host architecture is amd64 and the compiler/linker are 64-bit, even if it's producing 32-bit binaries in the end.

Member

bradfitz commented Dec 11, 2017

@krytarowski, you didn't set GOHOSTARCH=386 in that log. Another way you can tell you didn't have that set is you can see this line in your output:

Building packages and commands for host, netbsd/amd64.

So it's auto-detecting that your host architecture is amd64 and the compiler/linker are 64-bit, even if it's producing 32-bit binaries in the end.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
Contributor

krytarowski commented Dec 11, 2017

@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 11, 2017

Member

Thanks. Feel free to review https://golang.org/cl/82918

Member

bradfitz commented Dec 11, 2017

Thanks. Feel free to review https://golang.org/cl/82918

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot Dec 11, 2017

Change https://golang.org/cl/82918 mentions this issue: doc: update NetBSD status

Change https://golang.org/cl/82918 mentions this issue: doc: update NetBSD status

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 11, 2017

Contributor

Only <code>GOARCH</code> <code>amd64</code> and <code>386</code> are fully verified. The <code>arm</code> port has not been verified.

Contributor

krytarowski commented Dec 11, 2017

Only <code>GOARCH</code> <code>amd64</code> and <code>386</code> are fully verified. The <code>arm</code> port has not been verified.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 11, 2017

Contributor

The arm port is known to work, but I don't know offhand the status.

Contributor

krytarowski commented Dec 11, 2017

The arm port is known to work, but I don't know offhand the status.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 11, 2017

Contributor
$ GOHOSTARCH=386 GOARCH=386 ./all.bash 

[...]

ALL TESTS PASSED
---
Installed Go for netbsd/386 in /public/go
Installed commands in /public/go/bin
*** You need to add /public/go/bin to your PATH.
$ uname -a
NetBSD chieftec 8.0_BETA NetBSD 8.0_BETA (GENERIC) #1: Mon Dec 11 01:50:05 CET 2017  root@chieftec:/public/netbsd-root-8/sys/arch/amd64/compile/GENERIC amd64
$ cd /public/src.git/                                                                                                        
$ git log -2 # two cherry-picked patches for the -8 kernel
commit 82377c2808264c8439af91c1eba3528ba4edc6e1 (HEAD -> netbsd-8)
Author: christos <christos@NetBSD.org>
Date:   Thu Dec 7 16:22:22 2017 +0000

    Keep fs/gs the same for the signal context; otherwise calling things
    like __lwp_getprivate_fast() from a signal handler (that uses %gs) die.
    
    Merge context building code.

commit ae911ba8cf4f25bf73c501b8994dff8477ced26d
Author: christos <christos@NetBSD.org>
Date:   Thu Dec 7 19:49:43 2017 +0000

    - Reset ignored or masked traps to avoid infinite loops
    - If sigpost fails don't add an SDT_PROBE
    ok (and author) chuq
Contributor

krytarowski commented Dec 11, 2017

$ GOHOSTARCH=386 GOARCH=386 ./all.bash 

[...]

ALL TESTS PASSED
---
Installed Go for netbsd/386 in /public/go
Installed commands in /public/go/bin
*** You need to add /public/go/bin to your PATH.
$ uname -a
NetBSD chieftec 8.0_BETA NetBSD 8.0_BETA (GENERIC) #1: Mon Dec 11 01:50:05 CET 2017  root@chieftec:/public/netbsd-root-8/sys/arch/amd64/compile/GENERIC amd64
$ cd /public/src.git/                                                                                                        
$ git log -2 # two cherry-picked patches for the -8 kernel
commit 82377c2808264c8439af91c1eba3528ba4edc6e1 (HEAD -> netbsd-8)
Author: christos <christos@NetBSD.org>
Date:   Thu Dec 7 16:22:22 2017 +0000

    Keep fs/gs the same for the signal context; otherwise calling things
    like __lwp_getprivate_fast() from a signal handler (that uses %gs) die.
    
    Merge context building code.

commit ae911ba8cf4f25bf73c501b8994dff8477ced26d
Author: christos <christos@NetBSD.org>
Date:   Thu Dec 7 19:49:43 2017 +0000

    - Reset ignored or masked traps to avoid infinite loops
    - If sigpost fails don't add an SDT_PROBE
    ok (and author) chuq
@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 11, 2017

Member

The arm port is known to work, but I don't know offhand the status.

If we haven't had a builder for it for years, we assume it doesn't work.

Member

bradfitz commented Dec 11, 2017

The arm port is known to work, but I don't know offhand the status.

If we haven't had a builder for it for years, we assume it doesn't work.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 11, 2017

Contributor

I will give it a try tomorrow on RPi1.

Contributor

krytarowski commented Dec 11, 2017

I will give it a try tomorrow on RPi1.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
Contributor

krytarowski commented Dec 11, 2017

@gopherbot gopherbot closed this in 0da486d Dec 11, 2017

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 11, 2017

Contributor

I've fired building go14 (with dependencies) natively on: armv6-unknown-netbsdelf*-eabihf

It will take a while.

Contributor

krytarowski commented Dec 11, 2017

I've fired building go14 (with dependencies) natively on: armv6-unknown-netbsdelf*-eabihf

It will take a while.

@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 11, 2017

Member

@krytarowski, there's no need for that. Your GOROOT_BOOTSTRAP environment variable defaults to $HOME/go1.4 but that's just a default, and it doesn't need to be Go 1.4. It can be anything greater than that, too.

So you can use a fast machine to run master's $GOROOT/src/bootstrap.bash and set GOOS=netbsd GOARM=arm and build your $GOROOT_BOOTSTRAP from the fast machine.

Member

bradfitz commented Dec 11, 2017

@krytarowski, there's no need for that. Your GOROOT_BOOTSTRAP environment variable defaults to $HOME/go1.4 but that's just a default, and it doesn't need to be Go 1.4. It can be anything greater than that, too.

So you can use a fast machine to run master's $GOROOT/src/bootstrap.bash and set GOOS=netbsd GOARM=arm and build your $GOROOT_BOOTSTRAP from the fast machine.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 12, 2017

Contributor

I don't have enough RAM, and I don't want to use swap on this device. I will ask other developers with more advanced ARM hardware for a test.

Contributor

krytarowski commented Dec 12, 2017

I don't have enough RAM, and I don't want to use swap on this device. I will ask other developers with more advanced ARM hardware for a test.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 12, 2017

Contributor

OK, upstream golang/arm is broken - it works with floating patches. Part of them are in https://github.com/oshimaya/go/commits/go1.4-netbsd

Contributor

krytarowski commented Dec 12, 2017

OK, upstream golang/arm is broken - it works with floating patches. Part of them are in https://github.com/oshimaya/go/commits/go1.4-netbsd

@bradfitz

This comment has been minimized.

Show comment
Hide comment
@bradfitz

bradfitz Dec 12, 2017

Member

Okay, then I can update the docs to say that netbsd/arm is definitely broken, unless you want to mail those patches soon.

Member

bradfitz commented Dec 12, 2017

Okay, then I can update the docs to say that netbsd/arm is definitely broken, unless you want to mail those patches soon.

@krytarowski

This comment has been minimized.

Show comment
Hide comment
@krytarowski

krytarowski Dec 12, 2017

Contributor

I cannot fix it myself in close time, as I'm burdened by amd64 work.

Contributor

krytarowski commented Dec 12, 2017

I cannot fix it myself in close time, as I'm burdened by amd64 work.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot Dec 13, 2017

Change https://golang.org/cl/83856 mentions this issue: doc/go1.10: note that netbsd/arm is definitely broken

Change https://golang.org/cl/83856 mentions this issue: doc/go1.10: note that netbsd/arm is definitely broken

gopherbot pushed a commit that referenced this issue Dec 14, 2017

doc/go1.10: note that netbsd/arm is definitely broken
Remove the ambiguity, know that we know it's actually broken,
per #23073 (comment)

Updates #23073

Change-Id: I9b904da2f4c7105a0727d2a9056aaa6895d3dadc
Reviewed-on: https://go-review.googlesource.com/83856
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment