From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23825 invoked by alias); 24 Jan 2006 05:55:20 -0000 Received: (qmail 23810 invoked by uid 22791); 24 Jan 2006 05:55:19 -0000 X-Spam-Check-By: sourceware.org Received: from voldemort.codesourcery.com (HELO sethra.codesourcery.com) (65.74.133.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jan 2006 05:55:17 +0000 Received: from sethra.codesourcery.com (localhost.localdomain [127.0.0.1]) by sethra.codesourcery.com (8.12.11/8.12.11) with ESMTP id k0O5tGRd007238 for ; Mon, 23 Jan 2006 21:55:16 -0800 Received: (from mitchell@localhost) by sethra.codesourcery.com (8.12.11/8.12.11/Submit) id k0O5tGmu007234; Mon, 23 Jan 2006 21:55:16 -0800 Date: Tue, 24 Jan 2006 05:55:00 -0000 Message-Id: <200601240555.k0O5tGmu007234@sethra.codesourcery.com> From: Mark Mitchell To: gdb-patches@sources.redhat.com Subject: PATCH: Fix LP64 model bug in PPC simulator Reply-to: mark@codesourcery.com Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00351.txt.bz2 The PowerPC simulator didn't work on a little-endian LP64 platform (like x86_64-unknown-linux-gnu). The problem turned out to be that ppc/sim/words.h is defining {un,}signed32 unconditionally as "long" -- but then depending on that being 32 bits. Fixed with a bit of autoconfiscation. Tested by verifying that I can now run a simple PowerPC binary in simulation on x86_64-unknown-linux-gnu. OK? -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713 Index: configure.ac =================================================================== RCS file: /cvs/src/src/sim/ppc/configure.ac,v retrieving revision 1.4 diff -c -5 -p -r1.4 configure.ac *** configure.ac 28 Nov 2005 23:19:39 -0000 1.4 --- configure.ac 24 Jan 2006 05:50:56 -0000 *************** AC_TYPE_OFF_T *** 590,599 **** --- 590,602 ---- AC_TYPE_PID_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_UID_T + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_FUNCS(access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink) AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h sys/vfs.h sys/statfs.h) AC_HEADER_DIRENT Index: words.h =================================================================== RCS file: /cvs/src/src/sim/ppc/words.h,v retrieving revision 1.2 diff -c -5 -p -r1.2 words.h *** words.h 20 Apr 2005 14:43:55 -0000 1.2 --- words.h 24 Jan 2006 05:50:59 -0000 *************** typedef char natural8; *** 53,67 **** --- 53,79 ---- typedef short natural16; typedef long natural32; typedef signed char signed8; typedef signed short signed16; + #if SIZEOF_INT == 4 + typedef signed int signed32; + #elif SIZEOF_LONG == 4 typedef signed long signed32; + #else + #error "No 32-bit type" + #endif typedef unsigned char unsigned8; typedef unsigned short unsigned16; + #if SIZEOF_INT == 4 + typedef unsigned int unsigned32; + #elif SIZEOF_LONG == 4 typedef unsigned long unsigned32; + #else + #error "No 32-bit type" + #endif #ifdef __GNUC__ typedef long long natural64; typedef signed long long signed64; typedef unsigned long long unsigned64;