[ccan] [PATCH] cpuid: new module

David Gibson david at gibson.dropbear.id.au
Mon Sep 23 23:31:25 EST 2013


On Mon, Sep 23, 2013 at 12:44:57PM +0000, Ahmed Samy wrote:
> On Mon, Sep 23, 2013 at 11:33 AM, David Gibson
> <david at gibson.dropbear.id.au>wrote:
> 
> > > For a compiler magic, we can test with ${shell "arch -m"} maybe?
> >
> > That might work.  I don't know if ccan has support for
> > cross-compiling, in which case you'd need to check target arch, rather
> > than host arch.
> >
> > I'm not sure if it does support cross-compiling either, but for a
> temporary thing we could do:
> 
>    TARGETARCH=i386
>    WITH_CPUID="no"
>    ifeq ($(ARCH}, i386)
>            WITH_CPUID="yes"
>    endif
> 
> Also test for x86_64 but that's probably not the most effecient way, will
> wait for Rusty's comeback or a better suggestion.

The other approach would be to wrap everything in the actual files in
	#if defined(__i386__) || defined(__x86_64__)
and leave nothing, or BUILD_BUG stubs for other archs.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20130923/c7655012/attachment.sig>


More information about the ccan mailing list