Skip to content

tinygo-test fails with undefined symbols #3057

@QuLogic

Description

@QuLogic

With Go 1.18, I am getting the following error when running make tinygo-test:

ld.lld: error: undefined symbol: getpagesize
>>> referenced by os_linux.go:122 (/builddir/build/BUILDROOT/tinygo-0.25.0-1.fc36.x86_64/usr/lib64/tinygo/src/runtime/os_linux.go:122)
>>>               /tmp/tinygo863360999/main.o:(os_test.TestGetpagesize)
error: failed to link /tmp/tinygo863360999/main: exit status 1

With Go 1.19, I additionally get the following error on any test that uses crypto:

ld.lld: error: undefined symbol: crypto/internal/boring/sig.StandardCrypto
>>> referenced by notboring.go:25 (/usr/lib/golang/src/crypto/internal/boring/notboring.go:25)
>>>               /builddir/build/BUILD/tinygo-0.25.0/tinygo.OFH7PV/tinygo/thinlto/llvmcache-51407FBE491F17C7777BEE75E99D1816E029D4F3:(crypto/internal/boring.Unreachable)
error: failed to link /tmp/tinygo3462869915/main: exit status 1

This started with tinygo 0.24.0. It seemed to be related to CGo, so I tried reverting #2774, but that did not help. I also tried force disabling ThinLTO, but that did not help either. So I'm running low on ideas. I am running with external LLVM (14.0.5 against Go 1.19, and 14.0.0 against Go 1.18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcgoCGo and libc related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions