It seems that when suing NSTask to launch an executable from a process running under Rosetta 2, the new process will always run under Rosetta as well, even if the target executable has an arm64 slice.
Is there a way to override/prevent this?
In my concrete case, I have a x86_64 process that is launching debugserver (from inside Xcode 12, which is a fat binary with both x86_64 and arm64 slices) to debug another (arm64) process. In my testing, the exact same command line for debugserver works fine when run from Terminal, but when my process launches it via NSTask, debugserver thinks its target binary is/should be x86_64, and thus fails...
Thoughts?
Is there a way to override/prevent this?
In my concrete case, I have a x86_64 process that is launching debugserver (from inside Xcode 12, which is a fat binary with both x86_64 and arm64 slices) to debug another (arm64) process. In my testing, the exact same command line for debugserver works fine when run from Terminal, but when my process launches it via NSTask, debugserver thinks its target binary is/should be x86_64, and thus fails...
Thoughts?