Modified by: [EMAIL PROTECTED],[EMAIL PROTECTED]
Reviewed by: NEEDED
Date: 10:06:05
Project:  Support for Solaris X86 

Synopsis:  

Adding full Solaris Sparc and X86 support in math64.h to fix
sporadic MulShift30 unreference symbol error.

Overview: 

This was reported in Bug 3533:

Running Solaris 10 (beta 72) on a Sun Blade 1500,
RealPlayer 10.0.2.619 dies while streaming audio from

<rtsp://real.advance.net:7071/encoder/frodo/frodo.rm>
after a few minutes with the message:

ld.so.1: /path/RealPlayer10/realplay.bin: fatal: relocation error: file
/path/RealPlayer10/common/clntcore.so: symbol MulShift30: referenced symbol not 
found

Also reported in Bug 4687:

>>>>> ld.so.1: realplay.bin: fatal: relocation error: file 
>>>>> /usr/local/RealPlayer/common/clntcore.so: symbol MulShift30: 
>>>>> referenced symbol not found
>>>>>
>>>>> at various times in the middle of a stream. It's not deterministic, 
>>>>> I can play the same stream again and not get it. This has occurred 
>>>>> from time to time with any of the realplay sparc downloads, most 
>>>>> recently I'm running 10.0.6.1219 RXEN10.


Built using:

 [0] Set BIF branch (realplayer_gtk_stable)
 [1] Set Target(s) (player_all)
 [2] Set Profile (/build1/buildingNOV/build/umakepf/helix-client-all-defines)

math64.h was modified before in cayenne branch and Head for Solaris
X86.  This fix for Neptune branch is similar. Now, Sparc and X86
Solaris will share the same block of code.

As a result, the fix for this problem is to:

  -  Use the HPUX block of code for Solaris X86 and Solaris
     SPARC by adding the correct defines for Solaris:
     
     #elif defined(_HPUX) || (defined (_SOLARIS) && !defined (__GNUC__)) 
   
  -  Delete the block of code that has similar functions
     that the HPUX block of code already has.
     
     The block of code being deleted was:
     
     #if (defined(__SVR4) && defined(__i386) && (defined(_NO_GNU_AS) ||
        !defined(__GNUC__)) )
     /* No 64bit, no asm provided in some other file..
     * need normal funcs for sun forte CC + 386
     * However... forte's inline assembly for MulShift32 is just as good
     * as the "hand tuned" gcc version, if you use
     *  cc -fast
     */
     ....
  
  -  Delete the sparc block of code; it was missing MulShift30.
  
  -  Use #if/#elif constructs
  
This should be very similar to what is in the HEAD and cayenne
now. Only difference should be that SPARC and X86 SOLARIS using same
block of code.
     
Files Added:
[File 1] - NONE

Files Modified:
[File 3] -  audio/fixptutil/pub/math64.h

Image Size and Heap Use impact (Client -Only):
<Description of image size and heaps size impact. >

Platforms and Profiles Affected:
Tested on X86 with helix-client-all-defines profile

Distribution Libraries Affected:
<List of distribution libraries affected>

Distribution library impact and planned action:
<Is an update required and if so when will it occur>

Platforms and Profiles Build Verified:

Platform - x86.
brion% uname -a
SunOS brion 5.10 Generic i86pc i386 i86pc
brion% 
Profile:helix-client-all-defines

Platforms and Profiles Functionality verified:
Same as above

Branch: <code branch(es) change is for>

Head, Neptune, Cayenne.

Copyright assignment: <MUST be one of the following statements >


   3.      My company SUN is bound by the terms
           of a commercial contribution agreement with RealNetworks,
           and I am authorized to contribute this code under said agreement. 

   
QA Instructions:

Full test suites run on an X86 and Sparc machines running Solaris 10.




------------- End Forwarded Message -------------


Index: math64.h
===================================================================
RCS file: /cvsroot/audio/fixptutil/pub/math64.h,v
retrieving revision 1.18.8.4
diff -u -r1.18.8.4 math64.h
--- math64.h    25 Apr 2005 20:13:04 -0000      1.18.8.4
+++ math64.h    8 Dec 2005 23:17:22 -0000
@@ -118,13 +118,12 @@
 #endif // TIMING
 
 #pragma warning(default:4035)
-#endif // (defined(_M_IX86) && defined(_MSC_VER)) || (defined(__WINS__) && 
defined(_SYMBIAN))
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // GCC / i386
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUC__) && defined(__i386__) && !defined(_NO_GNU_AS)
+#elif defined(__GNUC__) && defined(__i386__) && !defined(_NO_GNU_AS)
 
 #define HAVE_PLATFORM_MACROS
 
@@ -199,100 +198,12 @@
 #ifdef DEBUG
 #define ASSERT(x) if (!(x)) __asm__ __volatile ("int $3" :: )
 #endif
-#endif // defined(__GNUC__) && defined(__i386__)
-
-///////////////////////////////////////////////////////////////////////////////////////
-// Sun native compiler / Sparc
-///////////////////////////////////////////////////////////////////////////////////////
-
-#if defined(__sparc)
-
-// the macros definitions come from an il file here.
-#define HAVE_PLATFORM_MACROS
-
-/* Compute a * b / c, using 64-bit intermediate result */
-signed int MulDiv64(signed int a, signed int b, signed int c) ;
-
-/* Compute (a * b) >> 31, using 64-bit intermediate result */
-signed int MulShift31(signed int a, signed int b) ;
-
-/* Compute (a * b) >> 32, using 64-bit intermediate result */
-signed int MulShift32(signed int a, signed int b) ;
-
-/* Compute (a * b) >> n, using 64-bit intermediate result */
-signed int MulShiftN(signed int a, signed int b, signed int n) ;
-
-#ifdef TIMING
-int _t1 ;
-int rdtsc() ;
-#define TICK() _t1 = rdtsc()
-#define TOCK(nsamples) (_t1 = rdtsc()-_t1 , printf("cycles = %4.1f\n", \
-  _t1 / (double)(nsamples)), _t1 )
-#endif
-
-
-#define HAVE_FASTABS
-static inline int FASTABS(int x) 
-{
-       int sign;
-
-       sign = x >> 31;
-       x ^= sign;
-       x -= sign;
-
-       return x;
-}
-
-
-#ifdef DEBUG
-#include <assert.h>
-#define ASSERT(x)  assert(x)
-#endif
-#endif // defined(__sparc)
-
-#if (defined(__SVR4) && defined(__i386) && (defined(_NO_GNU_AS) || 
!defined(__GNUC__)) )
-/* No 64bit, no asm provided in some other file..
- * need normal funcs for sun forte CC + 386 
- * However... forte's inline assembly for MulShift32 is just as good
- * as the "hand tuned" gcc version, if you use
- *  cc -fast
- */
-static inline int MulDiv64(int a, int b, int c)
-{
-       long long t = (long long)((long long)a * (long long)b) ;
-       return (int)(t / c) ;
-}
-/* Compute (a * b) >> 32, using 64-bit intermediate result */
-static inline int MulShift32(int a, int b)
-{
-       long long res ;
-       res = (long long)((long long)a * (long long)b);
-       return (res>>32);
-}
-
-/* Compute (a * b) >> 31, using 64-bit intermediate result */
-static inline int MulShift31(int a, int b)
-{
-       long long res ;
-       res = (long long)((long long)a * (long long)b);
-       return (res>>31);
-}
-
-/* Compute (a * b) >> 30, using 64-bit intermediate result */
-static inline int MulShift30(int a, int b)
-{
-       long long res ;
-       res = (long long)((long long)a * (long long)b);
-       return (res>>30);
-}
-
-#endif
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // Codewarrior / PowerPC
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if defined(__MWERKS__) && defined(__POWERPC__)
+#elif defined(__MWERKS__) && defined(__POWERPC__)
 
 /*if your compiler can compile 64-bit instructions, define this. CW 8 cannot */
 /* #define USE_64BIT_INSNS */
@@ -407,14 +318,13 @@
 
 #endif // TIMING
 
-#endif //  defined(__MWERKS__) && defined(__POWERPC__)
 
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // GCC / PowerPC
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUC__) && (defined(__POWERPC__) || defined(__powerpc__))
+#elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__powerpc__))
 
 /*if your compiler can compile 64-bit instructions, and your CPU has them,
  define this. */
@@ -509,13 +419,12 @@
 
 #endif // TIMING
 
-#endif //  defined(__GNUC__) && defined(__POWERPC__)
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // EVC3.0 / ARM
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if (defined(_ARM) && defined(_MSC_VER))
+#elif (defined(_ARM) && defined(_MSC_VER))
 
 /* EVC does not allow us to use inline assembly. Thus, you'll only see 
prototypes here.
  */
@@ -549,13 +458,12 @@
 }
 #endif // __cplusplus
 
-#endif // (defined(_ARM) && defined(_MSC_VER))
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // GNUC / ARM
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if (defined(_ARM) && defined(__GNUC__))
+#elif (defined(_ARM) && defined(__GNUC__))
 
 #define HAVE_PLATFORM_MACROS
 
@@ -682,13 +590,12 @@
 
 #endif // defined(__MARM_THUMB__)
 
-#endif // (defined(_ARM) && defined(__GNUC__))
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // ARM_ADS / ARM
 
///////////////////////////////////////////////////////////////////////////////////////
 
-#if defined(ARM_ADS)
+#elif defined(ARM_ADS)
 
 static __inline int MulShift32(int x, int y)
 {
@@ -748,12 +655,13 @@
        return x;
 }
 
-#endif // defined(ARM_ADS)
 
 
///////////////////////////////////////////////////////////////////////////////////////
 // platform independent implementations
 
///////////////////////////////////////////////////////////////////////////////////////
 
+#elif defined(_HPUX) || (defined(_SOLARIS) && !defined(__GNUC__))
+
 #ifndef ASSERT
 #define ASSERT(x)
 #endif
@@ -766,7 +674,6 @@
 #define TOCK(nsamples) 1
 #endif
 
-#if defined(_HPUX)
 #define HAVE_PLATFORM_MACROS
 static __inline int MulDiv64(int a, int b, int c)
 {
@@ -809,8 +716,10 @@
        return x;
     return -x;
 }
-
+#else
+#error "You need to define 64 bit operations for your platform"
 #endif
+
 #ifndef HAVE_FASTABS
 static __inline int FASTABS(int x) 
 {
_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to