I've run into one weird issue in Xcode 13.2.1 (didn't test with others) when linking very specific code in a universal macOS application. Debug builds work fine for all platforms (Apple/Intel). Release build though fails in one function implementing Blowfish crypto only for arm64, works fine on Intel. A decrypt function returns garbage only in this very specific case. Intel code under Rosetta also works fine. After few hours of elimination I narrowed it down to Link-Time Optimization option (LTO) - when it's set to anything else but No it does create this problem on arm64 only. I can't reproduce this with a smaller project using same Blowfish code and even enabling LTO for Debug build doesn't reproduce this. It has to be Release, LTO, arm64 and some ***** dust. Does anybody have any idea what's going on? I'd really like to find what happens here!
arm64 Link-Time Optimization problems
It’s hard to say for sure what’s going on here without a lot more info (the source for this function, the assembly from the .o
file, and the assembly in the final program). However, I suspect that the most likely cause is a bug and I recommend that you file it as such.
I can't reproduce this with a smaller project using same Blowfish code and even enabling LTO for Debug build doesn't reproduce this.
Yeah, that makes it tricky. Fortunately for linker bugs you don’t need to send us a buildable project. Rather, go to your build transcript, find the link command, and snarf that command and all the files it references. You can attach that to your bug and that should allow the linker folks to investigate.
Please post your bug number, just for the record.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"