On Tue, Jun 26, 2007 at 08:24:24AM +0200, Tobias Oetiker wrote:
> Hi RRDdevelopers,
> 
> I have done some more portability tests. this time with struct
> alignement.
> 
> have a look at
> 
> http://oss.oetiker.ch/rrdtool-trac/wiki/PortableRrdFormat
> 
> so it seems that if the structs are layed out properly the memory
> layout is the same at least on intel/linux and sparc/solaris architectures.
> 
> additional input from other architectures is highly appreciated.
Hi Tobi.

Here we go:

 - MIPS:

[EMAIL PROTECTED] ~ $ hinv -c processor
1 300 MHZ IP30 Processor
CPU: MIPS R12000 Processor Chip Revision: 2.3
FPU: MIPS R12010 Floating Point Chip Revision: 0.0
[EMAIL PROTECTED] ~ $ cc -v
MIPSpro Compilers: Version 7.4
[EMAIL PROTECTED] ~ $ cc -o align ./align.c
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  

Same with gcc:
[EMAIL PROTECTED] ~ $ gcc -v
Reading specs from 
/usr/local/gcc-2.95.3/lib/gcc-lib/mips-sgi-irix6.5/2.95.3/specs
gcc version 2.95.3 20010315 (release)
[EMAIL PROTECTED] ~ $ gcc -o align align.c 
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  fing
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88 
 
 - Itanium2 IA64:

[EMAIL PROTECTED] ~ $ cc -V
(Bundled) cc: HP aC++/ANSI C B3910B A.05.50 [May 15 2003]
[EMAIL PROTECTED] ~ $ cc -o align align.c
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  

and with gcc:

[EMAIL PROTECTED] ~ $ gcc -v
Reading specs from 
/usr/local/gcc-3.3.4/lib/gcc-lib/ia64-hp-hpux11.22/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure 
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared 
--enable-languages=c,c++,f77 --with-gnu-as --enable-libunwind-exceptions
Thread model: single
gcc version 3.3.4
[EMAIL PROTECTED] ~ $ gcc -o align align.c
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  

 - PA-RISC 64bit:

[EMAIL PROTECTED] ~ $ gcc -v
Reading specs from 
/usr/local/gcc-3.3.4/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure 
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared 
--enable-languages=c,c++,f77 --with-gnu-as
Thread model: single
gcc version 3.3.4
[EMAIL PROTECTED] ~ $ gcc -o align align.c
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 07 5b cd 15   88 88 88 88  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  

 - PowerPC 64 Bit:

[... snipp ...]
Processor Type: PowerPC_POWER5
Number Of Processors: 2
Processor Clock Speed: 1648 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
[... snipp ...]

[EMAIL PROTECTED] ~ $ /usr/local/gcc-3.3.4/bin/gcc -v
Reading specs from 
/usr/local/gcc-3.3.4/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure 
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared 
--enable-languages=c,c++,f77 -with-cpu-common --disable-multilib
Thread model: aix
gcc version 3.3.4

[EMAIL PROTECTED] ~ $ /usr/local/gcc-3.3.4/bin/gcc -o align align.c
[EMAIL PROTECTED] ~ $ ./align 
struct test non-aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   5b 26 43 5e  
 95 46 ee 81   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  


struct test aligned:
 30 31 32 00   88 88 88 88  
 07 5b cd 15   07 5b cd 15  
 5b 26 43 5e   95 46 ee 81  
 5b 26 43 5e   95 46 ee 81  
 00 00 00 00   07 5b cd 15  
 00 00 00 01   88 88 88 88  

HTH,

Andreas.

-- 
Dipl.-Ing. Andreas Maus             science+computing ag
System Administration               Hagellocher Weg 73
mail: [EMAIL PROTECTED]   72070 Tuebingen, Germany
tel.: +49 7071 9457 671             www.science-computing.de

Attachment: pgpalS5VqpwA1.pgp
Description: PGP signature

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

Reply via email to