I built GCC 4.0.2 with --target=powerpcle-440-eabi. The resulting GCC produces little-endian objects but with big-endian logic (big-endian register and load/store usage). I can force the compiler to use little-endian logic by specifying -mlittle on the command line...but does powerpcle-*-eabi not imply a default of little-endian for both byte ordering and logic? Secondary issue is that the GCC libaries built with --target=poerpcle-*-eabi contain big-endian logic and so will break with compiled code meant to use -mlittle.
Source: typedef long long LL; LL increment(LL x) { return x+1; } Object compiled with "-O2": 00000000 <increment>: 0: 01 00 84 30 addic r4,r4,1 /* big-endian logic, little-endian ordering */ 4: 94 01 63 7c addze r3,r3 8: 20 00 80 4e blr Object compiled with "-O2 -mlittle": 00000000 <increment>: 0: 01 00 63 30 addic r3,r3,1 /* little-endian logic, little-endian ordering */ 4: 94 01 84 7c addze r4,r4 8: 20 00 80 4e blr Object compiled with "-O2 -mbig": 00000000 <increment>: 0: 30 84 00 01 addic r4,r4,1 /* big-endian logic, big-endian ordering */ 4: 7c 63 01 94 addze r3,r3 8: 4e 80 00 20 blr -- Summary: GCC compiled with --target=powerpcle-*-eabi produces big-endian logic with little-endian ordering Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: aweiner at lsil dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25565