Hi, I meet that error in ubuntu too.  And here is my env:







*LLVM: 2c5590adfe09gollvm: 
f17ba8c7708356ef447525e05cd6f2770845c7d7gofrontend: 
e3bfc0889237a5bb8aa7ae30e1cff14f90a5f941libffi: 
0f2dd369cd5edcefad29b3fca4e1d08cb34f8f19libbacktrace: 
d0f5e95a87a4d3e0a1ed6c069b5dae7cbab3ed2a*

When I compile the code:
package main

import (
         "fmt"
         "golang.org/x/sys/unix"
)
 
func main() {
   fmt.Println("Hello, World!")
   fmt.Println(unix.Getpagesize())
}


It report another error:

*no required module provides package golang.org/x/sys/unix: go.mod file not 
found in current directory or any parent directory; see 'go help modules'*
在2021年3月16日星期二 UTC+8 08:09:59<tnkh...@gmail.com> 写道:

> Hi Ian,
> This problem is somewhat resolved for me now. Gollvm works perfectly in my 
> fresh installed Debian.
> Maybe Go and Gollvm has some conflicts in my previous build or Ubuntu got 
> some problem.
> Thanks a lot for your help.
>
> Khanh
>
> On Tuesday, March 16, 2021 at 7:53:34 AM UTC+8 Ian Lance Taylor wrote:
>
>> On Sat, Mar 13, 2021 at 4:51 PM Khanh TN <tnkh...@gmail.com> wrote:
>> >
>> > Hi, Ian,
>> > It does look like importing golang.org/x/sys/unix causes the problem
>> > A simple go program like
>> >
>> > package main
>> >
>> > import (
>> > "fmt"
>> > "golang.org/x/sys/unix"
>> > )
>> >
>> > func main() {
>> > fmt.Println("Hello, World!")
>> > fmt.Println(unix.Getpagesize())
>> > }
>> >
>> > does cause the same error as before. This file builds and runs fine 
>> with my normal Go but gives that error with Gollvm. If I do not include 
>> unix, Gollvm does work though.
>> > What do you suggest?
>>
>> This sounds like a bug somewhere between LLVM and gold. You should
>> probably file a bug report against gold (at
>> https://sourceware.org/bugzilla). I don't know why nobody else has
>> reported this.
>>
>> You may be able to make progress by using lld. I don't know; I've
>> never tried it myself.
>>
>> Ian
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/df9cf502-a947-4083-ad40-17546b13b7b4n%40googlegroups.com.

Reply via email to