Xcode 10 sets ARCH/CURRENT_ARCH to "undefined_arch", resulting in incorrect linker args
See release notes here: https://download.developer.apple.com/Documentation/Xcode_10_beta_Release_Notes/Xcode_10_Beta_Release_Notes.pdf
The new build system passes
undefined_arch
as the value for the ARCH environment variable when running shell script build phases. The value was previously not well defined. Any shell scripts depending on this value must behave correctly for all defined architectures being built, available via the ARCHS environment variable.
This seems to apply in multiple places; I've seen CMake emitting that in toolchain files in the CMakeFiles directory when CMake is run from a shell while Xcode 10 is selected via xcode-select
(maybe it's getting it from xcbuild
or some other tool, somehow?).