So mytype_t is defined as u_int64_t which is defined as uint64_t
Yet I see the generated wrapper code use unsigned long instead of unsigned long long
Could this be due to a cross build environment?
How do I get cffi to generate the right code?
Thx
Sarvi
We are compiling some 12 other python extensions without any emulators the same way I am compiling these cffi extensions.
I can't find anything through google on autoconf and emulations for cross compilation.
And we don't use it for any of the more then 100 or some components that we cross compile.
May be I don't understand the issue with data types and sizes
http://en.wikipedia.org/wiki/C_data_types
From what I can tell, int, long sizes vary with platforms. If you really want fixed length data types it looks like you need to use intN_t from stdint.h. And considering that cffi has basic data types thare infact intN_t, shouldn't that be the right choice?
Sarvi
Sarvi
I understand u will still have problem with basic int/ long and what size they should map to on the target.
Is there simpler way, without resorting to emulators.
http://www.mesa3d.org/autoconf.html
According to the above link, we should be using ./configure --build=..... --host=... --target=... --enable-32-bit
In autoconf, the --enable-32-bit allows you to force the -m32 flag to gcc get 32 bit compatible binaries even though the target is 64 bit
Shouldn't we have something equivalent to --target and --enable-32-bit for cffi code generation and compilation.
Sarvi
On Sat, Oct 13, 2012 at 10:51 AM, Sarvi Shanmugham <sarv...@gmail.com> wrote:
> It uses Hakan's approach to compile a set of C test programs to figure out
> the sizes of different primitive data types on the target.
> It then uses this information to populate a type_size table which it uses to
> populate the backend.nonstandard_integer types() and
> the backend.sizeof() functions. For the rest it falls back to the C backend.
I think the idea was to not fall back to the C backend in situations
where it would misbehave or crash with some strange error message.
Instead some helpful error message could be generated.
> On Saturday, October 13, 2012 1:07:39 AM UTC-7, Armin Rigo wrote:
>> An "emulator" is sometimes used when cross-compiling to some devices.
>> See for example http://www.scratchbox.org/ . It gives an environment
>> in which we can not only compile for a foreign target architecture,
>> but also run snippets. For example it avoids the hacky solution of
>> 'configure' presented by Hakan above: with an emulator, it is possible
>> to compile and then run anything, as opposed to just check if it
>> compiles.
Scratchbox is a great approach and it works mostly out of the box for
arm targets. However I have not had much luck setting it up for less
common targets.
--
Håkan Ardö