From: Mark Mitchell <mark@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: PATCH: Fix LP64 model bug in PPC simulator
Date: Tue, 24 Jan 2006 05:55:00 -0000 [thread overview]
Message-ID: <200601240555.k0O5tGmu007234@sethra.codesourcery.com> (raw)
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;
next reply other threads:[~2006-01-24 5:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-24 5:55 Mark Mitchell [this message]
2006-01-24 19:27 ` Mark Kettenis
2006-01-24 19:52 ` Mark Mitchell
2006-01-24 21:09 ` Daniel Jacobowitz
2006-01-24 21:45 ` Mark Kettenis
2006-01-24 23:49 ` Mark Mitchell
[not found] ` <5981.192.87.1.22.1138179926.squirrel@webmail.xs4all.nl>
2006-01-25 17:32 ` Mark Mitchell
2006-01-25 23:08 ` Mark Kettenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200601240555.k0O5tGmu007234@sethra.codesourcery.com \
--to=mark@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox