Comment 6 for bug 1745155

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

With that, and after talking to some other engineers, we decided it is best, instead of whitelisting little endian arches, make the build process to fail whenever this can occur, which, right now, after investigation, is only related to how bitmaps are disposed in the imgfile (and mapped using (char *) w/out any endian converstion).

So, currently a test like:

union un {
    uint8_t u8;
    uint16_t u16;
    uint16_t u32;
    uint16_t u64;
};

union un u = { .u64 = 0x7b };

printf("0x%x\n", (uint) u.u8);
printf("0x%x\n", (uint) u.u16);
printf("0x%x\n", (uint) u.u32);
printf("0x%x\n", (uint) u.u64);

And verifying that all 4 variables have the same "0x7b" contents is enough to make sure we are running in a little endian arch.