Build cross-compiler and cross-compile standard libraries

Is there anyone willing to share with me the magic incantation needed to cross-compile the standard library?

Following Installing Go from source - The Go Programming Language, I’ve been able to build a compiler just fine. The problem however is that no matter which bash script I use from the src folder, libraries do not appear in pkg/$GOOS_$GOARCH.

I can see that go build -x std builds the archives just fine in a temporary working directory but deletes the result at the end. The same happens with go install std, files are built and deleted at the end.

What gives?

In case anyone else is having the same problem, the Go 1.20 release notes provide an answer:

The go tool no longer relies on pre-compiled standard library package archives in the $GOROOT/pkg directory, and they are no longer shipped with the distribution, resulting in smaller downloads. Instead, packages in the standard library are built as needed and cached in the build cache, like other packages.

I guess Installing Go from source - The Go Programming Language hasn’t been updated to reflect or mention this change.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.