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

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

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

Comments

@krytarowski
Copy link
Contributor

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 doc/go1.10.html states that i386/amd64 executables fail on NetBSD doc: go1.10.html states that i386/amd64 executables fail on NetBSD amd64 Dec 10, 2017
@bradfitz
Copy link
Contributor

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?

@krytarowski
Copy link
Contributor Author

@bradfitz
Copy link
Contributor

@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
Copy link
Contributor Author

http://netbsd.org/~kamil/golang/golang-i386-on-amd64-2017-12-11-hosti386.txt

NetBSD-8 will receive the needed patches.

@bradfitz
Copy link
Contributor

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

@gopherbot
Copy link

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

@krytarowski
Copy link
Contributor Author

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

@krytarowski
Copy link
Contributor Author

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

@krytarowski
Copy link
Contributor Author

$ 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
Copy link
Contributor

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
Copy link
Contributor Author

I will give it a try tomorrow on RPi1.

@krytarowski
Copy link
Contributor Author

https://releng.netbsd.org/cgi-bin/req-8.cgi tickets 443 and 444

@krytarowski
Copy link
Contributor Author

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

It will take a while.

@bradfitz
Copy link
Contributor

@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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

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

@krytarowski
Copy link
Contributor Author

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

@gopherbot
Copy link

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
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>
@golang golang locked and limited conversation to collaborators Dec 13, 2018
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

3 participants