[PATCH] MC: Don't emit min version directives when -fno-integrated-as is on

Filipe Cabecinhas filcab at gmail.com
Thu Jan 22 09:00:39 PST 2015


Hi all,

For using cctools: use as -q, which uses the clang assembler.

For afl-fuzz it's simple. You have two options:
Use Xcode's clang, which is the same used for as -q, which afl uses
(AFL_CLANG=`xcrun -p clang` (AFL_CXX too)).
Or
Change afl-as.c, look for -q (lower case. Should be conditioned on DARWIN),
change to -c. Export AFL_AS=clang (path to your top of tree clang that is
emitting the asm that as doesn't understand).

Regards,

  Filipe

On Thursday, January 22, 2015, Nico Weber <thakis at chromium.org> wrote:

> On Thu, Jan 22, 2015 at 6:05 AM, Rafael Espíndola <
> rafael.espindola at gmail.com
> <javascript:_e(%7B%7D,'cvml','rafael.espindola at gmail.com');>> wrote:
>
>> On 22 January 2015 at 00:36, Nico Weber <thakis at chromium.org
>> <javascript:_e(%7B%7D,'cvml','thakis at chromium.org');>> wrote:
>> > 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?
>>
>> Yes, it puts us in a direction we really don't want to go.
>>
>> On OS X /usr/bin/as is really old and not supported. If afl is using
>> it instead clang that is a bug in afl.
>>
>
> afl is using -no-integrated-as to munge the asm output. It doesn't care
> which as gets run.
>
>
>> The correct way of making this easier would probably be to write a
>> program that is command line compatible with /usr/bin/as but uses MC.
>>
>
> That sounds great, but until that exists this patch seems to increase
> clang's it's-just-works-iness  by at least 8.3% for a very minor code
> change. Once llvm-gas (or however it should be called) exists, it's no
> longer necessary.
>


-- 
  F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150122/66c09234/attachment.html>


More information about the llvm-commits mailing list