The assembler included with cctools doesn't understand
.macosx_version_min. We shouldn't try to emit that directive if we
aren't going to use the integrated assembler.
This fixes PR21636.
Differential D6371
MC: Don't emit min version directives when -fno-integrated-as is on majnemer on Nov 22 2014, 9:29 AM. Authored by
Details
The assembler included with cctools doesn't understand This fixes PR21636.
Diff Detail Event TimelineComment Actions I believe we've been trying to avoid special casing the integrated Comment Actions This patch is working around a directive which the cctools assembler does not have. Asking it to trigger on another condition would essentially be a proxy for "MC is targeting the cctools assembler" anyway. Comment Actions Could we do this down in the MCStreamer instead? It looks like MCAsmStreamer::EmitVersionMin should just be a no-op, maybe? (or a no-op on Darwin? Is the version directive valid anywhere else other than LLVM's integrated assembler?) Comment Actions How would we be able to emit the version information for Darwin if it were a no-op? I might be missing something but it sounds like .ios_version_min and .macosx_version_min would not properly round-trip.
AFAIK, only the LLVM integrated assembler understands .ios_version_min and .macosx_version_min. I've checked the cctools sources and the latest binutils GAS sources as well. Comment Actions The non integrated assembler can't handle lots of things the compiler emits on Darwin. The only realistic use of that command line option now is when processing .s files. Sent from my iPad Comment Actions FWIW, cctools' as doesn't understand .cfi_startproc et al either, so even if we did this, we'd barf over those. While this single case is quite trivial, I could see this snowballing messily elsewhere. =/ Comment Actions I'm trying to use afl-fuzz with asan on OS X. afl-fuzz tells you to set CXX to afl-clang++ and rebuild your program. afl-clang++ then calls clang++ with -no-integrated-as and -B to a path with its own as wrapper that inserts some instrumentation assembly before calling real as. This doesn't work on OS X because clang++ writes this .macosx_version_min directive that as doesn't support. If I apply this patch, everything does work. So this seems like a useful thing to me – are there any downsides to this patch? Are there any other possible fixes for this use-case? Does llvm have an as-compatible assembler driver somewhere? |