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

cmd/link: implement external linking support for ppc64/linux #8912

Open
ianlancetaylor opened this issue Oct 9, 2014 · 3 comments
Open

cmd/link: implement external linking support for ppc64/linux #8912

ianlancetaylor opened this issue Oct 9, 2014 · 3 comments
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

We need to fix the 9l linker to provide external linking support, so that
-linkmode=external works on power64.

This code is currently on the dev.power64 branch and should come into tip after the 1.4
release is out.  This means writing elfreloc1, elfsetupplt, adddynsym, adddynrela, etc.,
in cmd/9l/asm.c and doing whatever else is necessary so that (cd misc/cgo/test
&& go test -linkmode=external) passes for both big- and little- endian power64.
@ianlancetaylor
Copy link
Contributor Author

Comment 2:

Doing "whatever else is necessary" to make misc/cgo/test pass will include writing
asm_power64be.s, asm_power64le.s, and gcc_linux_power64{be,ls}.s in the runtime/cgo
package.

@gopherbot
Copy link

@minux
Copy link
Member

minux commented Nov 1, 2014

Comment 6:

Issue #9038 has been merged into this issue.

@aclements aclements self-assigned this Dec 22, 2014
aclements added a commit that referenced this issue Jan 16, 2015
This test requires external linking, but we don't yet implement
external linking on ppc64 (tracked in issue #8912).  Disable the test
on ppc64 until external linking is implemented.

This makes all.bash pass on ppc64le.

Change-Id: I741498d4d9321607e7a65792a33faf8187bd18e4
Reviewed-on: https://go-review.googlesource.com/2908
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@rsc rsc removed the arch-ppc64 label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@minux minux assigned minux and unassigned aclements May 4, 2015
@rsc rsc changed the title cmd/9l: implement external linking support for Power64 Linux cmd/link: implement external linking support for ppc64/linux Jun 8, 2015
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

The existing filter [!exec:cc] skip is not sufficient in the case when
CC is deliberately set to a file not meant to be executed while building
the non cgo variant of Go
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

The existing filter [!exec:cc] skip is not sufficient in the case when
CC is deliberately set to a file not meant to be executed while building
the non cgo variant of Go
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

The existing filter [!exec:cc] skip is not sufficient in the case when
CC is deliberately set to a file not meant to be executed while building
the non cgo variant of Go
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

CC was set to /dev/null (during build) in the scenario mentioned above

This patch replaces [!exec:cc] with [!cgo] because we care about the
availability of the 'cc' builtin and not the 'cc' executable in PATH
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

CC was set to /dev/null (during build) in the scenario mentioned above

This patch replaces [!exec:cc] with [!cgo] because we care about the
availability of the 'cc' builtin and not the 'cc' executable in PATH
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 26, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

CC was set to /dev/null (during build) in the scenario mentioned above

This patch replaces [!exec:cc] with [!cgo] because we care about the
availability of the 'cc' builtin and not the 'cc' executable in $PATH
nehaljwani added a commit to nehaljwani/go that referenced this issue Jan 27, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: golang#8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: golang#36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

CC was set to /dev/null (during build) in the scenario mentioned above

This patch replaces [!exec:cc] with [!cgo] because we care about the
availability of the 'cc' builtin and not the 'cc' executable in $PATH
gopherbot pushed a commit that referenced this issue Jan 27, 2021
With CGO disabled, the test suite tries to run the following and fail:

CGO_ENABLED=0 go test -run=TestScript/link_syso_issue33139 cmd/go
go test proxy running at GOPROXY=http://127.0.0.1:38829/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/link_syso_issue33139 (0.01s)
        script_test.go:215:
            # Test that we can use the external linker with a host syso file that is
            # embedded in a package, that is referenced by a Go assembly function.
            # See issue 33139. (0.000s)
            # External linking is not supported on linux/ppc64.
            # See: #8912 (0.000s)
            # External linking is not supported on linux/riscv64.
            # See: #36739 (0.001s)
            > [linux] [riscv64] skip
            > cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
            FAIL: testdata/script/link_syso_issue33139.txt:15:
                unexpected error starting command:
                        fork/exec /dev/null: permission denied

CC was set to /dev/null (during build) in the scenario mentioned above

This patch replaces [!exec:cc] with [!cgo] because we care about the
availability of the 'cc' builtin and not the 'cc' executable in $PATH

Change-Id: Ifbd2441f5f8e903ca3da213aba76f44c2e2eebab
GitHub-Last-Rev: 3b74378
GitHub-Pull-Request: #43912
Reviewed-on: https://go-review.googlesource.com/c/go/+/286633
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@rsc rsc unassigned minux Jun 23, 2022
rahilarious added a commit to rahilarious/gentoo that referenced this issue Mar 20, 2024
Upstream Issue: golang/go#8912

Closes: https://bugs.gentoo.org/925111
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
rahilarious added a commit to rahilarious/gentoo that referenced this issue Mar 21, 2024
Upstream Issue: golang/go#8912

Closes: https://bugs.gentoo.org/925111
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
rahilarious added a commit to rahilarious/gentoo that referenced this issue Mar 22, 2024
Upstream Issue: golang/go#8912

Closes: https://bugs.gentoo.org/925111
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
rahilarious added a commit to rahilarious/gentoo that referenced this issue Mar 22, 2024
Upstream Issue: golang/go#8912

Closes: https://bugs.gentoo.org/925111
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Mar 23, 2024
Upstream Issue: golang/go#8912

Closes: https://bugs.gentoo.org/925111
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants