This is the minimal copy and paste version to get something running on Darwin.
Note the file platfrom_defs.h.inc. The section name has a ',' because of Mach-O. The section attribute length can be at most 16 characters. Thus, I had to remove the llvm part of the name.
The objcopy changes are beyond my me.
It stills fails the liniting. It claims that stddef.h and stdint.h are system headers. stddef.h and stdint.h are provided by the libc and the resource directory of clang ...
This is probably OK as a compromise. Few points around this:
This gives you a C symbol but requires scope qualification in the callers from within LLVM libc. Exactly what we want.