Revision 0475a5ca

b/Makefile.target
217 217
endif
218 218
ifdef CONFIG_SOLARIS
219 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 226
endif
221 227

  
222 228
# profiling code
b/configure
139 139
    solaris="yes"
140 140
    make="gmake"
141 141
    install="ginstall"
142
    needs_libsunmath="no"
142 143
    solarisrev=`uname -r | cut -f2 -d.`
143 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 157
            kqemu="yes"
146 158
        fi
147 159
    fi
......
727 739
if test "$solaris" = "yes" ; then
728 740
  echo "CONFIG_SOLARIS=yes" >> $config_mak
729 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 746
fi
731 747
if test "$gdbstub" = "yes" ; then
732 748
  echo "CONFIG_GDBSTUB=yes" >> $config_mak
b/fpu/softfloat-native.c
30 30
#define sqrtf(f)		((float)sqrt(f))
31 31
#define remainderf(fa, fb)	((float)remainder(fa, fb))
32 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 52
#endif
34 53

  
35 54
#if defined(__powerpc__)
b/fpu/softfloat.h
32 32
#ifndef SOFTFLOAT_H
33 33
#define SOFTFLOAT_H
34 34

  
35
#if defined(HOST_SOLARIS) && defined(NEEDS_LIBSUNMATH)
36
#include <sunmath.h>
37
#endif
38

  
35 39
#include <inttypes.h>
36 40
#include "config.h"
37 41

  

Also available in: Unified diff