@@ -839,15 +839,15 @@ int dsymutil_main(int argc, char **argv, const llvm::ToolContext &) {
839
839
return EXIT_FAILURE;
840
840
841
841
if (NeedsTempFiles) {
842
- const bool Fat64 = Options.LinkOpts .Fat64 ;
842
+ bool Fat64 = Options.LinkOpts .Fat64 ;
843
843
if (!Fat64) {
844
844
// Universal Mach-O files can't have an archicture slice that starts
845
845
// beyond the 4GB boundary. "lipo" can create a 64 bit universal
846
- // header, but not all tools can parse these files so we want to return
847
- // an error if the file can't be encoded as a file with a 32 bit
846
+ // header, but older tools may not support these files so we want to
847
+ // emit a warning if the file can't be encoded as a file with a 32 bit
848
848
// universal header. To detect this, we check the size of each
849
849
// architecture's skinny Mach-O file and add up the offsets. If they
850
- // exceed 4GB, then we return an error .
850
+ // exceed 4GB, we emit a warning .
851
851
852
852
// First we compute the right offset where the first architecture will
853
853
// fit followin the 32 bit universal header. The 32 bit universal header
@@ -866,13 +866,15 @@ int dsymutil_main(int argc, char **argv, const llvm::ToolContext &) {
866
866
if (!stat)
867
867
break ;
868
868
if (FileOffset > UINT32_MAX) {
869
- WithColor::error ()
870
- << formatv (" the universal binary has a slice with a starting "
871
- " offset ({0:x}) that exceeds 4GB and will produce "
872
- " an invalid Mach-O file. Use the -fat64 flag to "
873
- " generate a universal binary with a 64-bit header "
874
- " but note that not all tools support this format." ,
875
- FileOffset);
869
+ Fat64 = true ;
870
+ WithColor::warning () << formatv (
871
+ " the universal binary has a slice with a starting offset "
872
+ " ({0:x}) that exceeds 4GB. To avoid producing an invalid "
873
+ " Mach-O file, a universal binary with a 64-bit header will be "
874
+ " generated, which may not be supported by older tools. Use the "
875
+ " -fat64 flag to force a 64-bit header and silence this "
876
+ " warning." ,
877
+ FileOffset);
876
878
return EXIT_FAILURE;
877
879
}
878
880
FileOffset += stat->getSize ();
0 commit comments