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
Этот коммит содержится в:
Damian Gryski 2021-09-05 17:32:00 -07:00 коммит произвёл Ron Evans
родитель eaab05fc43
коммит 32de906f6d
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -72,3 +72,8 @@ tinygo_swapTask:
// Return into the new task, as if tinygo_swapTask was a regular call. // Return into the new task, as if tinygo_swapTask was a regular call.
ret ret
#ifdef __MACH__ // Darwin
// allow these symbols to stripped as dead code
.subsections_via_symbols
#endif

Просмотреть файл

@ -27,3 +27,8 @@ _tinygo_scanCurrentStack:
// were only pushed to be discoverable by the GC. // were only pushed to be discoverable by the GC.
addq $56, %rsp addq $56, %rsp
retq retq
#ifdef __MACH__ // Darwin
// allow these symbols to stripped as dead code
.subsections_via_symbols
#endif