From 1eff70451fbb079c1d5b8f45ff8c8a2b8f74d7ba Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 10 Dec 2007 17:43:13 +0000 Subject: Fix PR1836: in the interpreter, read and write apints using the minimum possible number of bytes. For little endian targets run on little endian machines, apints are stored in memory from LSB to MSB as before. For big endian targets on big endian machines they are stored from MSB to LSB which wasn't always the case before (if the target and host endianness doesn't match values are stored according to the host's endianness). Doing this requires knowing the endianness of the host, which is determined when configuring - thanks go to Anton for this. Only having access to little endian machines I was unable to properly test the big endian part, which is also the most complicated... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44796 91177308-0d34-0410-b5e6-96231b3b80d8 --- autoconf/configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'autoconf') diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 979e3a8..fe16b50 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -227,7 +227,10 @@ dnl Define a substitution, ARCH, for the target architecture AC_SUBST(ARCH,$llvm_cv_target_arch) dnl Check for the endianness of the target -AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) +AC_C_BIGENDIAN([AC_SUBST([ENDIAN],[big]), + AC_DEFINE([MSB_FIRST], [1], [Define if this target is big endian])], + [AC_SUBST([ENDIAN],[little]), + AC_DEFINE([LSB_FIRST], [1], [Define if this target is little endian])]) dnl Check for build platform executable suffix if we're crosscompiling if test "$cross_compiling" = yes; then -- cgit v1.1