From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 209DBDDE03 for ; Tue, 20 Nov 2007 07:37:04 +1100 (EST) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IuDMb-0006DO-6k for linuxppc-embedded@ozlabs.org; Mon, 19 Nov 2007 12:37:01 -0800 Message-ID: <13844837.post@talk.nabble.com> Date: Mon, 19 Nov 2007 12:37:01 -0800 (PST) From: Mirek23 To: linuxppc-embedded@ozlabs.org Subject: Problem with 64-bit variables on ppc405 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Dear All, I have successfully build crosstools (gcc-4.0.2-glibc-2.3.2) for my ppc 405 processor (part of xilinx virtex-4). I have compiled the Linux kernel 2.6.23rc2 and busy box 1.4.2. All together works fin but I am facing the problem with the variables declared in C as double and long long. Doubles and long long are 8 bytes long but the byte order differs on my host linux Intel PC from this what I have on the target linux ppc 405. double , long long byte order looks like below: linux intel x86 ppc405 1,2,3,4,5,6,7,8 5,6,7,8,1,2,3,4 int and long types in 'C' (4 byte variables) have the same byte order on both platforms. It seems to be that 64-bit variables have different order. I do not know if it comes from: 1. the configuration of the crosstools (ie. the way how the gcc and glibc is built) 2. the kernel configuration. The ppc 405 does not have the FPU built in so I have set in the kernel: processor->math emulation I did not set anything concerning FPU in Crosstools. The Crosstools configuration file demo-powerpc-405.sh looks like: #!/bin/sh # This script has one line for each known working toolchain # for this architecture. Uncomment the one you want. # Generated by generate-demo.pl from buildlogs/all.dats.txt set -ex TARBALLS_DIR=$HOME/downloads RESULT_TOP=/opt/crosstool export TARBALLS_DIR RESULT_TOP GCC_LANGUAGES="c,c++" export GCC_LANGUAGES # Really, you should do the mkdir before running this, # and chown /opt/crosstool to yourself so you don't need to run as root. mkdir -p $RESULT_TOP eval `cat powerpc-405.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest Does anybody have an idea how to sort out this problem to have byte order for 64-bit variables on ppc405 the same as for linux on intel x86. Best Regards Mirek -- View this message in context: http://www.nabble.com/Problem-with-64-bit-variables-on-ppc405-tf4839313.html#a13844837 Sent from the linuxppc-embedded mailing list archive at Nabble.com.