internal/task, runtime: add subsections_via_symbols to assembly files on darwin

This allows the assembly routines in these files to be stripped as dead
code if they're not referenced.  This solves the link issues on MacOS
when the `leaking` garbage collector or the `coroutines` scheduler
are selected.

Fixes #2081
This commit is contained in:
Damian Gryski
2021-09-05 17:32:00 -07:00
committed by Ron Evans
parent eaab05fc43
commit 32de906f6d
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -72,3 +72,8 @@ tinygo_swapTask:
// Return into the new task, as if tinygo_swapTask was a regular call.
ret
#ifdef __MACH__ // Darwin
// allow these symbols to stripped as dead code
.subsections_via_symbols
#endif
+5
View File
@@ -27,3 +27,8 @@ _tinygo_scanCurrentStack:
// were only pushed to be discoverable by the GC.
addq $56, %rsp
retq
#ifdef __MACH__ // Darwin
// allow these symbols to stripped as dead code
.subsections_via_symbols
#endif