[Development] Urgent help needed: determining endianness at compile time in INTEGRITY

Kimmo Ollila Kimmo.Ollila at qt.io
Thu May 17 08:26:27 CEST 2018


>From INTEGRITY documentation I found the following macros:

Endianness Macros
One of these symbols is always defined to specify the endianness of the target processor.

Big Endian byte order.

Little Endian byte order.

I tested and these are working.

Best regards,
Kimmo Ollila

-----Original Message-----
From: Development <development-bounces+kimmo.ollila=qt.io at qt-project.org> On Behalf Of Thiago Macieira
Sent: keskiviikkona 16. toukokuuta 2018 19.19
To: development at qt-project.org
Subject: [Development] Urgent help needed: determining endianness at compile time in INTEGRITY

We've got a change blocked because some third-party code is unable to find a macro that determines the endianness of the target while compiling with GHS's compiler for INTEGRITY.

Can someone help? Any of the following would help:

(a) documentation link stating what macro is set

(b) a simple test program in C that shows how to determine the endianness at compile time

(c) a function that does 64-bit host-to-network and back conversions on INTEGRITY

(d) an actual patch to TinyCBOR - https://github.com/intel/tinycbor (file

Please note that Qt doesn't seem to have a problem -- qprocessordetection.h has an #error and it's not triggering. So it would seem Qt has a solution. I have not looked at the code because I need to submit to the third-party and I need therefore MIT-licensed solutions. A Qt Company employee could open qprocessordetection.h and determine how it makes this work -- the only other copyright holder of relevance in that file is Intel.

For reference, TinyCBOR already tries these tests:
	defined(__ARMEB__) || defined(__MIPSEB__) || defined(__sparc__)

	defined(__ARMEL__) || defined(__i386) || defined(__i386__) || 
	defined(__x86_64) || defined(__x86_64__) || \
	defined(__amd64) || defined(__MIPSEL__)

It's possible it's one of those and there's something else wrong. I don't have access to the toolchain and therefore can't test to see what it is.
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Development mailing list
Development at qt-project.org

More information about the Development mailing list