Skip to contentSkip to conversation

Endian problems when migrating program from HP-UX to RedHat Linux

Linux-ia64 Yap Tan Sing 2 participants 2 messages Apr 18, 2001

lore
Share & tools
lore
#0 lore raw

Hi,

Currently I am trying to migrate a program from HP-UX to RedHat 6.2 Linux (on Dell PowerEdge2400 server). I am facing endian conversion problem. From HP homepage learned that Linux is little endian whereas HP-UX is big endian. If I am not wrong there is a gcc option to generate big endian code (-mbig-endian), but I learned that this option is only applicable to Linux on advanced RISC machines (ARM). I think Dell PowerEdge2400 server is using Pentium III so I guess it is not an ARM machine. Do you have any idea how can I actually get big endian code using my current Dell PowerEdge2400 server? Please help. Thanks in advance.

Thanks & Best Regards,
Yap Tan Sing

#1 lore raw

Endianness is a feature of the system (CPU+OS). You can not change it by using a compiler option.

ia64-linux is little-endian. If you want your program to run on ia64-linux, then you have to make it work on little-endian systems.

It would be possible to create a big-endian ia64-linux OS, but that would be a great deal of work, and is not a practical solution.

If you just want to run your program on IA-64 hardware, and don't care about the OS, then you could use an ia64-hpux system, which is big-endian.

Jim