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 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

@AlexRouSg AlexRouSg commented Jun 2, 2021

#17014 looks like clang isn't supported on windows

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 2, 2021

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

Loading

@siebenmann
Copy link

@siebenmann 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)'.

Loading

@AmeyaVS
Copy link

@AmeyaVS AmeyaVS commented Jun 2, 2021

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

Loading

@gopherbot gopherbot closed this in ff9f5fb Jun 2, 2021
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 2, 2021

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants