Re: Make FIO for Android

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



By the way, that patch plus a (working, ideally) cpuid fix gives a
clean build on Android/arm and Android/x86

On 12 April 2013 17:10, Aaron Carroll <xaaronc@xxxxxxxxx> wrote:
> On 12 April 2013 17:00, Jens Axboe <axboe@xxxxxxxxx> wrote:
>> On Fri, Apr 12 2013, Aaron Carroll wrote:
>>> tuff
>>> > should be basic enough that it isn't a lot of trouble to carry it. At
>>> > least when we figure out why the Android NDK doesn't like the current
>>> > restraints :-)
>>>
>>> Digging around the GCC headers seems to have helped.  If you change
>>> the constraint on ebx to:
>>>         : "=a" (*eax), "=r" (*ebx), "=c" (*ecx), "=d" (*edx)
>>> then it builds.
>>
>> But it doesn't work, we lose the output :-)
>
> Ahh, I missed some important stuff.  The ASM from cpuid.h looks like
> this on my Android/x86 GCC:
>
> #define __cpuid(level, a, b, c, d)          \
>   __asm__ ("xchg{l}\t{%%}ebx, %1\n\t"           \
>        "cpuid\n\t"                  \
>        "xchg{l}\t{%%}ebx, %1\n\t"           \
>        : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
>        : "0" (level))
>
> Hopefully someone who knows what they're doing can turn that into an fio fix :)
>
>>> The relevant comment from cpuid.h:
>>>   /* %ebx may be the PIC register.  */
>>> which is ifdef'd on __PIC__
>>>
>>> Dunno what that means, but it builds with that, plus a very small
>>> Android-specific fix.  Both in attached patch.
>>
>> Patch is garbled?
>
> Ok, so gmail sucks for dev work.  Sorry.  The Android bit follows inline.
>
> diff --git a/os/os-android.h b/os/os-android.h
> index b844982..df22333 100644
> --- a/os/os-android.h
> +++ b/os/os-android.h
> @@ -13,6 +13,7 @@
>  #include <sched.h>
>  #include <linux/unistd.h>
>  #include <linux/major.h>
> +#include <asm/byteorder.h>
>
>  #include "binject.h"
>  #include "../file.h"
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux