I'm producing dylibs with embedded bitcode and using the -bitcode-symbol-map
flag to specify an output directory where files of the form UUID.bcsymbolmap
get produced. I'd like to teach my build system about those bcsymbolmap
files so I can install and package them, but it is hard to do so since the output name for the file is determined by the LC_UUID
value in the dylib which seems to be determined by ld
. It seems I have two choices:
Find a way to explicitly set the
LC_UUID
of the dylib when building it, so that I can predict the output name of thebcsymbolmap
file.Specify a well known name for the
bcsymbolmap
file (the-bitcode-symbol-map
option does support this) which does not contain the UUID, and then at install time, figure out theLC_UUID
of the associated dylib and rename thebcsymbolmap
file appropriately.
However, I don't see either a linker flag that will let me specify the LC_UUID
of the library when building it, or a tool to let me change it after the fact (thinking here of something like install_name_tool
), nor do I see a utility that will easily give me back the LC_UUID
of a given library (to do the needed renaming of the bcsymbolmap
file), short of parsing the output of otool -l
, which seems fragile and unpleasant.
I'd prefer to keep my options limited to things that ship with XCode. Does anyone know of tools to easily inject, edit, or emit the LC_UUID
for a dylib?