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: TestCGOLTO/clang failure on Windows #46517

Closed
egonelbre opened this issue Jun 2, 2021 · 5 comments
Closed

cmd/link: TestCGOLTO/clang failure on Windows #46517

egonelbre opened this issue Jun 2, 2021 · 5 comments

Comments

@egonelbre
Copy link
Contributor

egonelbre commented Jun 2, 2021

Building Go at dc8f87b on Windows fails with:

--- FAIL: TestCGOLTO (0.00s)
    --- FAIL: TestCGOLTO/clang-1 (24.17s)
        cgo_test.go:116: go build
        cgo_test.go:118: # runtime/cgo
            Z:\Temp\go-build575393325\b041\_cgo_main.o : fatal error LNK1107: invalid or corrupt file: cannot read at 0xA14
            clang: error: linker command failed with exit code 1107 (use -v to see invocation)
        cgo_test.go:121: go build failed: exit status 2
        cgo_test.go:136: failed
    --- FAIL: TestCGOLTO/clang-0 (24.19s)
        cgo_test.go:116: go build
        cgo_test.go:118: # runtime/cgo
            Z:\Temp\go-build2185699927\b003\_cgo_main.o : fatal error LNK1107: invalid or corrupt file: cannot read at 0xA14
            clang: error: linker command failed with exit code 1107 (use -v to see invocation)
        cgo_test.go:121: go build failed: exit status 2
        cgo_test.go:136: failed

Clang version:

clang version 11.0.0                        
Target: x86_64-pc-windows-msvc              
Thread model: posix                         
InstalledDir: C:\Program Files\LLVM\bin     
@AlexRouSg
Copy link
Contributor

#17014 looks like clang isn't supported on windows

@gopherbot
Copy link

Change https://golang.org/cl/324169 mentions this issue: cmd/link: recognize clang linker error in testCGOLTO

@siebenmann
Copy link

siebenmann commented Jun 2, 2021

I'm also seeing this failure on Fedora 33:

[...]
ok      cmd/internal/test2json  0.175s
--- FAIL: TestCGOLTO (0.00s)
    --- FAIL: TestCGOLTO/clang-0 (5.73s)
        cgo_test.go:116: go build
        cgo_test.go:118: # runtime/cgo
            /tmpfs/cks-gobuild/go-build3547053564/b003/_cgo_main.o: file not recognized: file format not recognized
            clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
        cgo_test.go:121: go build failed: exit status 2
        cgo_test.go:136: failed
    --- FAIL: TestCGOLTO/clang-1 (7.26s)
        cgo_test.go:116: go build
        cgo_test.go:118: # runtime/cgo
            /tmpfs/cks-gobuild/go-build1490463800/b038/_cgo_main.o: file not recognized: file format not recognized
            clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
        cgo_test.go:121: go build failed: exit status 2
        cgo_test.go:136: failed
FAIL
FAIL    cmd/link        16.097s
ok      cmd/link/internal/benchmark     0.025s
[...]

Fedora 33 has clang version '11.0.0 (Fedora 11.0.0-3.fc33)'.

@AmeyaVS
Copy link

AmeyaVS commented Jun 2, 2021

I am also, observing this failure in Ubuntu 20.04 LTS, with clang-10 from the repository.

@ianlancetaylor
Copy link
Contributor

@siebenmann Thanks. Should be fixed now (by https://golang.org/cl/324169).

@golang golang locked and limited conversation to collaborators Jun 2, 2022
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