Any static should be conditioned on CONFIG_LIB_SYSCALL for the
task_spawn() version in sched/task/task_spawn.c, however, that is not
really necessary either because that version is not linked into the
same binary as is the version in libs/libc/spawn.
I suppose a user could enable CONFIG_LIB_SYSCALL in a FLAT build.
Then both would be linked into the same blob, but that is kind of a
useless configuration.
So, I think the preferred fix would simply to make CONFIG_LIB_SYSCALL
dependent on !CONFIG_BUILD_FLAT in the Kconfig file.