The constant C string implementation in CodeGenModule is incorrect. When you do str + "\0", you are appending a C string to the string, and so it inserts all of the characters before the first NULL byte into the C++ string. Since \0 is the first byte, (str + "\0") == str. This means anything calling GetAddrOfConstantCString() is getting the wrong result. I found this due to the ObjC class lookup function being passed unterminated strings - it also explains the random crashes on Linux in the ObjC load function. I haven't checked if this pattern is being used anywhere else.