Porting issue in Solaris.

I've a code which is compiled in a solaris 32 bit system and compiled with the option CCGNUFLAGS=-xarch=v8 -xcache=16/32/1:1024/64/1 -xchip=ultra +d -instances=static ( which i guess means , it'll run as a 32 bit application ) .. These object files are unzipped and linked on a sun OS 5.8 which supports 64 bit applications too..

I've zeroed in on a probable portion of the code thats causing the problem .

The code part is ....

register long offset ; ( Offset takes 66076 in a test case );

register long diff ; ( Diff takes 33967 in that test case );

month = int((offset >> 8) & 0xFF);

day = int(offset & 0xFF);

In a 32 bit linux system, this is producing month = 2 and Day = 28 ..

In a 64 bit Solaris system, too, this is giving identical results..

However, when the application is built on the 32 bit solaris system and ran on the 64 bit system, both month and day are coming up as zero ....

I dont have direct access to test this code segment in a 32 bit machine..

Is there a glitch in the code over this porting compatibilities ? Does casting and bitmasks cause a problem ? I examined the little endian/big endian concerns.. Seems bitmasks can cause a problem..But , why it is not happening on a 64 bit solaris platform ?

Please reply ..

Thanks,

Ajith

[1370 byte] By [ajith_prasada] at [2007-11-26 13:36:13]
# 1

When you run a 32-bit application on 64-bit Solaris, it runs in a 32-bit environment. The results should be identical to the results when run on a 32-bit Solaris kernel. It also should not matter whether the 32-bit application was compiled on a 32-bit system or on a 64-bit system.

Are the 32-bit and 64-bit versions of Solaris the same? Do they have the same patches?

I suspect you are seeing a bug in an older 32-bit Solaris library on the 64-bit Solaris system that is fixed in a newer version of that library on the 32-bit system.

clamage45a at 2007-7-7 22:21:06 > top of Java-index,Development Tools,Solaris and Linux Development Tools...