diff --git a/builder/testdata/binary-size.txt b/builder/testdata/binary-size.txt index cfdd88aaea..44e14f4bcc 100644 --- a/builder/testdata/binary-size.txt +++ b/builder/testdata/binary-size.txt @@ -1,12 +1,12 @@ target package opt code rodata data bss hifive1b examples/echo z 4558 402 0 2276 -microbit examples/serial z 3001 439 8 2272 +microbit examples/serial z 2999 441 8 2272 wioterminal examples/pininterrupt z 7848 1688 136 7280 pico examples/serial z 7721 1071 112 5616 -pico examples/serial 2 16362 862 108 5616 +pico examples/serial 2 16330 862 108 5616 pico2 examples/serial z 6514 1174 112 5608 -pico2 examples/serial 2 15975 977 108 5608 -esp32c3-generic examples/serial z 4918 530 0 8648 +pico2 examples/serial 2 15943 977 108 5608 +esp32c3-generic examples/serial z 4914 530 0 8648 esp32c3-generic examples/serial 2 7742 362 8 8656 cortex-m-qemu ./testdata/size-slice z 3087 793 4 4168 cortex-m-qemu ./testdata/size-slice 2 7331 341 4 4168 @@ -14,7 +14,7 @@ cortex-m-qemu ./testdata/size-defer z 3782 818 4 4176 cortex-m-qemu ./testdata/size-contains z 3093 763 4 4200 pico2 ./testdata/size-contains z 6672 1160 112 5632 pico2 ./testdata/size-os z 6199 1209 128 5592 -pico2 ./testdata/size-os 2 15290 1014 128 5592 +pico2 ./testdata/size-os 2 15258 1014 128 5592 cortex-m-qemu ./testdata/size-corpus z 9891 1301 80 4188 cortex-m-qemu ./testdata/size-corpus 2 17466 862 72 4188 riscv-qemu ./testdata/size-corpus z 17508 1028 88 16660 diff --git a/src/runtime/synctest.go b/src/runtime/synctest.go index 37a950af7c..b84b0583e7 100644 --- a/src/runtime/synctest.go +++ b/src/runtime/synctest.go @@ -10,7 +10,7 @@ const synctestBaseTime = 946684800000000000 var synctestEnabled task.Uint32 func synctestIsEnabled() bool { - return synctestEnabled.Load() != 0 + return synctestSupported && synctestEnabled.Load() != 0 } type synctestBubble struct { @@ -398,6 +398,9 @@ func synctestBlock(t *task.Task) { //go:linkname synctest_run internal/synctest.Run func synctest_run(f func()) { + if !synctestSupported { + panic("synctest is not supported on bare metal") + } synctestEnabled.Store(1) root := task.Current() if root.SynctestBubble != nil { diff --git a/src/runtime/synctest_baremetal.go b/src/runtime/synctest_baremetal.go new file mode 100644 index 0000000000..9762ad5f8e --- /dev/null +++ b/src/runtime/synctest_baremetal.go @@ -0,0 +1,5 @@ +//go:build baremetal + +package runtime + +const synctestSupported = false diff --git a/src/runtime/synctest_hosted.go b/src/runtime/synctest_hosted.go new file mode 100644 index 0000000000..ce6820a4d5 --- /dev/null +++ b/src/runtime/synctest_hosted.go @@ -0,0 +1,5 @@ +//go:build !baremetal + +package runtime + +const synctestSupported = true