In Xcode 10 while using new build system, if your xcconfig contains any conditional variable assignment, xcodebuild will generate an error saying "illegal instruction 4". For example:
FOO[sdk=macosx*] = buzz
After removing "[sdk=macosx*]", xcodebuild works as charm.
I went through the Xcode 10 build system patch notes, Apple wasn't saying anything about dropping support for conditional variable assignment. So this is supposed to be a bug in xcodebuild i guess?
By the way, the issue also has been seen in new build system in Xcode 9.4 (while since new build system is not default in Xcode 9.4, you have to manually setting the project setting.)