Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Cannot compile to wasm: @thread_local is not supported for this target platform

Open StanislavNikolov opened this issue 2 years ago • 1 comments

Context

This program does not build

package main
main :: proc() { }

when the target is either wasi_wasm32, js_wasm32 or freestanding_wasm32. Build command:

$ odin build test.odin -target:wasi_wasm32                                                                                                                                           1 ↵
/Users/stjo/Odin/core/runtime/core_builtin.odin(8:15) @(thread_local) is not supported for this target platform

odin report output:

	Odin: dev-2022-03:84cee5d
	OS:   macOS 12.0.4 Monterey
	CPU:  ARM64
	RAM:  16384 MiB

Removing @thread_local from core/runtime/core_builtin.odin line 8 fixes the issue:

// @thread_local global_default_temp_allocator_data: Default_Temp_Allocator
global_default_temp_allocator_data: Default_Temp_Allocator

Now test.wasm file is produced. wasmtime fails to run it, but I believe this is a separate issue altogether.

Expected Behavior

.wasm file should be produced.

Current Behavior

Compiler bails out with

/Users/stjo/Odin/core/runtime/core_builtin.odin(8:15) @(thread_local) is not supported for this target platform

StanislavNikolov avatar Mar 21 '22 11:03 StanislavNikolov

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]