Using SwiftSyntax with latest compiler, not one bundled with Xcode

I recently ran into issues with miscompliation Miscompiled code (Embedded Swift). After updating to a newer toolchain which should fix my issue I am unable to compile my code on macOS at all (on Linux it's fine since there is no Xcode nonsense to deal with).

<module-includes>:1:9: note: in file included from <module-includes>:1:
1 | #import "_includes.h"
  |         `- note: in file included from <module-includes>:1:
2 | #import "AtomicBool.h"
3 | #import "swiftsyntax_errno.h"

<unknown>:0: error: could not build Objective-C module '_SwiftSyntaxCShims'
/Users/teampuzel/projects/Engine/packages/swift-syntax/Sources/_SwiftSyntaxCShims/include/_includes.h:34:10: error: 'unistd.h' file not found
32 |
33 | #elif defined(__unix__) || defined(__APPLE__)
34 | #include <unistd.h>
   |          `- error: 'unistd.h' file not found
35 | #endif
36 |

I could previously work around this by compiling SwiftSyntax using the default Xcode toolchain, however now it complains about a mismatched compiler version of 6.0 and 6.1.

How do I build SwiftSyntax using the latest compiler?

Okay, apparently on macOS toolchains require an -sdk flag or they won't work correctly, it works now.