Commit 0475a5ca544e3a59fb961f14342228aad1d0acb6
1 parent
e5febef5
Solaris 9/x86 support, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2577 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
46 additions
and
1 deletions
Makefile.target
| @@ -217,6 +217,12 @@ LIBS+=-lwinmm -lws2_32 -liphlpapi | @@ -217,6 +217,12 @@ LIBS+=-lwinmm -lws2_32 -liphlpapi | ||
| 217 | endif | 217 | endif |
| 218 | ifdef CONFIG_SOLARIS | 218 | ifdef CONFIG_SOLARIS |
| 219 | LIBS+=-lsocket -lnsl -lresolv | 219 | LIBS+=-lsocket -lnsl -lresolv |
| 220 | +ifdef NEEDS_LIBSUNMATH | ||
| 221 | +LIBS+=-lsunmath | ||
| 222 | +LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib | ||
| 223 | +OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc | ||
| 224 | +BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc | ||
| 225 | +endif | ||
| 220 | endif | 226 | endif |
| 221 | 227 | ||
| 222 | # profiling code | 228 | # profiling code |
configure
| @@ -139,9 +139,21 @@ SunOS) | @@ -139,9 +139,21 @@ SunOS) | ||
| 139 | solaris="yes" | 139 | solaris="yes" |
| 140 | make="gmake" | 140 | make="gmake" |
| 141 | install="ginstall" | 141 | install="ginstall" |
| 142 | + needs_libsunmath="no" | ||
| 142 | solarisrev=`uname -r | cut -f2 -d.` | 143 | solarisrev=`uname -r | cut -f2 -d.` |
| 143 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then | 144 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 144 | - if test "$solarisrev" -ge 10 ; then | 145 | + if test "$solarisrev" -le 9 ; then |
| 146 | + if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then | ||
| 147 | + needs_libsunmath="yes" | ||
| 148 | + else | ||
| 149 | + echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" | ||
| 150 | + echo "libsunmath from the Sun Studio compilers tools, due to a lack of" | ||
| 151 | + echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" | ||
| 152 | + echo "Studio 11 can be downloaded from www.sun.com." | ||
| 153 | + exit 1 | ||
| 154 | + fi | ||
| 155 | + fi | ||
| 156 | + if test "$solarisrev" -ge 9 ; then | ||
| 145 | kqemu="yes" | 157 | kqemu="yes" |
| 146 | fi | 158 | fi |
| 147 | fi | 159 | fi |
| @@ -727,6 +739,10 @@ fi | @@ -727,6 +739,10 @@ fi | ||
| 727 | if test "$solaris" = "yes" ; then | 739 | if test "$solaris" = "yes" ; then |
| 728 | echo "CONFIG_SOLARIS=yes" >> $config_mak | 740 | echo "CONFIG_SOLARIS=yes" >> $config_mak |
| 729 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h | 741 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
| 742 | + if test "$needs_libsunmath" = "yes" ; then | ||
| 743 | + echo "NEEDS_LIBSUNMATH=yes" >> $config_mak | ||
| 744 | + echo "#define NEEDS_LIBSUNMATH 1" >> $config_h | ||
| 745 | + fi | ||
| 730 | fi | 746 | fi |
| 731 | if test "$gdbstub" = "yes" ; then | 747 | if test "$gdbstub" = "yes" ; then |
| 732 | echo "CONFIG_GDBSTUB=yes" >> $config_mak | 748 | echo "CONFIG_GDBSTUB=yes" >> $config_mak |
fpu/softfloat-native.c
| @@ -30,6 +30,25 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM) | @@ -30,6 +30,25 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM) | ||
| 30 | #define sqrtf(f) ((float)sqrt(f)) | 30 | #define sqrtf(f) ((float)sqrt(f)) |
| 31 | #define remainderf(fa, fb) ((float)remainder(fa, fb)) | 31 | #define remainderf(fa, fb) ((float)remainder(fa, fb)) |
| 32 | #define rintf(f) ((float)rint(f)) | 32 | #define rintf(f) ((float)rint(f)) |
| 33 | +#if !defined(__sparc__) && HOST_SOLARIS < 10 | ||
| 34 | +extern long double rintl(long double); | ||
| 35 | +extern long double scalbnl(long double, int); | ||
| 36 | + | ||
| 37 | +long long | ||
| 38 | +llrintl(long double x) { | ||
| 39 | + return ((long long) rintl(x)); | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +long | ||
| 43 | +lrintl(long double x) { | ||
| 44 | + return ((long) rintl(x)); | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +long double | ||
| 48 | +ldexpl(long double x, int n) { | ||
| 49 | + return (scalbnl(x, n)); | ||
| 50 | +} | ||
| 51 | +#endif | ||
| 33 | #endif | 52 | #endif |
| 34 | 53 | ||
| 35 | #if defined(__powerpc__) | 54 | #if defined(__powerpc__) |
fpu/softfloat.h
| @@ -32,6 +32,10 @@ these four paragraphs for those parts of this code that are retained. | @@ -32,6 +32,10 @@ these four paragraphs for those parts of this code that are retained. | ||
| 32 | #ifndef SOFTFLOAT_H | 32 | #ifndef SOFTFLOAT_H |
| 33 | #define SOFTFLOAT_H | 33 | #define SOFTFLOAT_H |
| 34 | 34 | ||
| 35 | +#if defined(HOST_SOLARIS) && defined(NEEDS_LIBSUNMATH) | ||
| 36 | +#include <sunmath.h> | ||
| 37 | +#endif | ||
| 38 | + | ||
| 35 | #include <inttypes.h> | 39 | #include <inttypes.h> |
| 36 | #include "config.h" | 40 | #include "config.h" |
| 37 | 41 |