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

🐛 build error on target "nintendoswitch" when import "fmt" #2530

Closed
ca1e opened this issue Jan 16, 2022 · 9 comments
Closed

🐛 build error on target "nintendoswitch" when import "fmt" #2530

ca1e opened this issue Jan 16, 2022 · 9 comments
Labels
bug Something isn't working nintendo-switch

Comments

@ca1e
Copy link

ca1e commented Jan 16, 2022

package main
import "fmt"
func main() {
	fmt.Println("Hello,world")
}

$tinygo build -target nintendoswitch -o dummy

ld.lld: error: undefined symbol: os.runtime_args
>>> referenced by scheduler_any.go:19
ld.lld: error: undefined symbol: errno
>>> referenced by syscall_libc.go:0
@ca1e
Copy link
Author

ca1e commented Jan 16, 2022

go version: 1.17.6
tinygo version: 0.21.0

@ca1e
Copy link
Author

ca1e commented Jan 16, 2022

tinygo: version 0.22.0-dev-751ac85, here is another errors:

# os
~\tinygo\src\os\types_unix.go:20:18: Stat_t not declared by package syscall
~\tinygo\src\os\stat_linux.go:46:32: Timespec not declared by package syscall
~\tinygo\src\os\file_anyos.go:185:16: S_ISUID not declared by package syscall
~\tinygo\src\os\file_anyos.go:188:16: S_ISGID not declared by package syscall
~\tinygo\src\os\file_anyos.go:191:16: S_ISVTX not declared by package syscall
~\tinygo\src\os\stat_linux.go:19:31: S_IFMT not declared by package syscall
~\tinygo\src\os\stat_linux.go:20:15: S_IFBLK not declared by package syscall
~\tinygo\src\os\stat_linux.go:22:15: S_IFCHR not declared by package syscall
~\tinygo\src\os\stat_linux.go:24:15: S_IFDIR not declared by package syscall
~\tinygo\src\os\stat_linux.go:26:15: S_IFIFO not declared by package syscall
~\tinygo\src\os\stat_linux.go:28:15: S_IFLNK not declared by package syscall
~\tinygo\src\os\stat_linux.go:30:15: S_IFREG not declared by package syscall
~\tinygo\src\os\stat_linux.go:32:15: S_IFSOCK not declared by package syscall
~\tinygo\src\os\stat_linux.go:35:25: S_ISGID not declared by package syscall
~\tinygo\src\os\stat_linux.go:38:25: S_ISUID not declared by package syscall
~\tinygo\src\os\stat_linux.go:41:25: S_ISVTX not declared by package syscall
~\tinygo\src\os\stat_linux.go:52:43: Stat_t not declared by package syscall
~\tinygo\src\os\stat_unix.go:22:37: Stat not declared by package syscall
~\tinygo\src\os\stat_unix.go:35:37: Lstat not declared by package syscall

@ca1e ca1e changed the title 🐛 undefined symbol: os.runtime_args & errno on target "nintendoswitch" when import "fmt" 🐛 build error on target "nintendoswitch" when import "fmt" Jan 16, 2022
@dkegel-fastly
Copy link
Contributor

What was the last release of tinygo that worked in (if any)?

@ca1e
Copy link
Author

ca1e commented Jan 18, 2022

What was the last release of tinygo that worked in (if any)?

seems fine with tinygo version 0.17.0 windows/amd64 (using go version go1.16.13 and LLVM version 11.0.0)

tinygo 0.18..0 shows error: undefined symbol: errno

@deadprogram deadprogram added bug Something isn't working nintendo-switch labels Jan 19, 2022
@dkegel-fastly
Copy link
Contributor

fwiw, can be reproduced with

cd tests/tinygotest
tinygo test -c -target=nintendoswitch

dkegel-fastly added a commit to dkegel-fastly/tinygo that referenced this issue Jan 20, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (tinygo-org#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (tinygo-org#2530)
@dkegel-fastly
Copy link
Contributor

#2565 includes a regression test for this, but doesn't run it yet from Makefile, as it is still failing.

deadprogram pushed a commit that referenced this issue Jan 21, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (#2530)
bgould pushed a commit to bgould/tinygo that referenced this issue Feb 7, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (tinygo-org#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (tinygo-org#2530)
deadprogram pushed a commit that referenced this issue Apr 7, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (#2530)
deadprogram pushed a commit that referenced this issue Apr 11, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (#2530)
ardnew pushed a commit to ardnew/tinygo that referenced this issue Jun 21, 2022
…smoke test.

Test currently enabled on pybadge (chosen at random)

TODO:
- enable test on arduino; currently fails with "interp: ptrtoint integer size..." (tinygo-org#2389)
- enable test on nintendoswitch; currently fails with many missing definitions (tinygo-org#2530)
@ultra-azu
Copy link

I could fix the errno issue in 0.18.0 by changing a line in runtime_nintendo_switch.go from go:extern to go:export. However, I think it's unrelated to the undefined syscall symbols in the current release.

@deadprogram
Copy link
Member

Please see #4648 for a fix.

@deadprogram
Copy link
Member

Tagging to close this issue on next release.

@deadprogram deadprogram added the next-release Will be part of next release label Dec 4, 2024
@deadprogram deadprogram removed the next-release Will be part of next release label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nintendo-switch
Projects
None yet
Development

No branches or pull requests

4 participants