This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patches for cross from sparc-sun-solaris2.6 to sparc64-sun-solaris2.8


I had to make some changes in order to compile gcc-3.3.1 as a
cross-compiler from sparc-sun-solaris2.6 to sparc64-sun-solaris2.8,
using a native gcc-3.3 as my host compiler.

Some of them have not been made in a way that can be integrated with a
general release: they're mainly intended for those in a similar
situation, or for those who know how to make these changes only appear
if building on Solaris 2.6. I've only tested these changes in my
particular circumstances.

I'm submitting this for your consideration: if you all think that any
of these changes should be a real patch, please let me know and I'll
put some more work into them. (I'll also submit them as one patch per
message.:)

I believe these changes are small enough to be legally insignificant.
The block following _GLIBCPP_HAVE_SQRTF was derived from
http://speakeasy.rpmfind.net/linux/KDE/stable/3.0.1/Solaris/Solaris8/BuildInstruction
I only changed the inlined-function names from sqrt to sqrtf and
sqrtl.

SUMMARY

libffi/aclocal.m4.  Changed default return value of bigendian test
from "unknown" to "yes". Before the fix, configure said "sorry".

libffi/configure.  Explicitly set return value of bigendian test from
"unknown" to "yes" before final test. Before the fix, configure said
"sorry".

libjava/configure.  Added "x..." to arguments to test in case variable
is null. Before the fix, configure said that test needed arguments.

libstdc++-v3/config/os/newlib/ctype_noninline.h.  Changed variable
name from _ctype_ to __ctype.  Added cast to (const char *) to return
statement. Before the fix, the compilation of this library gave
errors.

libstdc++-v3/config/linker-map.gnu. Remove sqrtf and sqrtl from linker
map. I'm not sure about this change, since my goal (made through the
HAVE_SQRTF change) was to emulate the inclusion of sqrtf as a text
symbol in the sunfreeware distribution of libstdc++ in gcc-3.3.

libstdc++-v3/include/c_std/std_cmath.h.  Commented out macro test, so
C externs are always defined.  Changed sense of macro test so that
"using" statements are not compiled. Before the fix, the compilation
of this library gave either syntax errors, or said that the symbols
could not be found.

libstdc++-v3/configure.  Undefine HAVE_SQRTF since Solaris does not.
Before the fix, sqrtf was not listed by nm as a text (T) symbol in
this library.

PATCHES

I used the form "diff -c3p released-file modified-file".

*** libffi/aclocal.m4.dist	Tue Aug 26 13:02:31 2003
--- libffi/aclocal.m4	Tue Aug 26 13:02:53 2003
*************** undefine([AC_CV_NAME])dnl
*** 47,53 ****
  
  AC_DEFUN([AC_C_BIGENDIAN_CROSS],
  [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
! [ac_cv_c_bigendian=unknown
  # See if sys/param.h defines the BYTE_ORDER macro.
  AC_TRY_COMPILE([#include <sys/types.h>
  #include <sys/param.h>], [
--- 47,53 ----
  
  AC_DEFUN([AC_C_BIGENDIAN_CROSS],
  [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
! [ac_cv_c_bigendian=yes
  # See if sys/param.h defines the BYTE_ORDER macro.
  AC_TRY_COMPILE([#include <sys/types.h>
  #include <sys/param.h>], [

*** libffi/configure.dist	Tue Aug 26 13:03:27 2003
--- libffi/configure	Tue Aug 26 13:05:00 2003
*************** cat >> confdefs.h <<EOF
*** 3549,3554 ****
--- 3549,3556 ----
  #define BYTEORDER $BYTEORDER
  EOF
  
+ ac_cv_c_bigendian=yes
+  
  if test $ac_cv_c_bigendian = unknown; then
    { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
  fi

*** libjava/configure.dist	Tue Aug 26 13:05:48 2003
--- libjava/configure	Tue Aug 26 13:06:29 2003
*************** EOF
*** 4191,4197 ****
    fi
    
  
!    if test $ac_cv_header_locale_h = yes; then
      echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
  echo "configure:4197: checking for LC_MESSAGES" >&5
  if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
--- 4191,4197 ----
    fi
    
  
!    if test "x$ac_cv_header_locale_h" = "xyes"; then
      echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
  echo "configure:4197: checking for LC_MESSAGES" >&5
  if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then

*** libstdc++-v3/config/os/newlib/ctype_noninline.h.dist	Tue Aug 26 13:07:34 2003
--- libstdc++-v3/config/os/newlib/ctype_noninline.h	Tue Aug 26 13:10:12 2003
***************
*** 35,41 ****
    
    const ctype_base::mask*
    ctype<char>::classic_table() throw()
!   { return _ctype_ + 1; }
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 
--- 35,41 ----
    
    const ctype_base::mask*
    ctype<char>::classic_table() throw()
!   { return (const char *)__ctype + 1; }
  
    ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
  		     size_t __refs) 

*** libstdc++-v3/config/linker-map.gnu.dist	Wed Aug 27 13:00:19 2003
--- libstdc++-v3/config/linker-map.gnu	Wed Aug 27 13:02:48 2003
*************** GLIBCPP_3.2.1 {
*** 351,358 ****
    log10l;
    powf;
    powl;
-   sqrtf;
-   sqrtl;
    copysignf;
    nan;
    __signbit;
--- 351,356 ----


*** libstdc++-v3/include/c_std/std_cmath.h.dist	Tue Aug 26 13:12:29 2003
--- libstdc++-v3/include/c_std/std_cmath.h	Wed Aug 27 12:36:33 2003
*************** namespace __gnu_cxx
*** 81,88 ****
  {
    namespace  __c99_binding
    {
! #if _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK || \
!     _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC
      extern "C" float (acosf)(float);
      extern "C" float (asinf)(float);
      extern "C" float (atanf)(float);
--- 81,88 ----
  {
    namespace  __c99_binding
    {
! //#if defined(_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK) || \
! //    defined(_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC)
      extern "C" float (acosf)(float);
      extern "C" float (asinf)(float);
      extern "C" float (atanf)(float);
*************** namespace __gnu_cxx
*** 101,108 ****
      extern "C" float (sinhf)(float);
      extern "C" float (tanf)(float);
      extern "C" float (tanhf)(float);
! #endif
! #if !_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC
  #if _GLIBCPP_HAVE_ACOSF
      using ::acosf;
  #endif
--- 101,108 ----
      extern "C" float (sinhf)(float);
      extern "C" float (tanf)(float);
      extern "C" float (tanhf)(float);
! //#endif
! #if defined(_GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC)
  #if _GLIBCPP_HAVE_ACOSF
      using ::acosf;
  #endif
*************** namespace std 
*** 548,553 ****
--- 548,571 ----
    inline long double
    sqrt(long double __x)
    { return __builtin_sqrtl(__x); }
+ 
+ #if _GLIBCPP_HAVE_SQRTF
+   inline float
+   sqrtf(float __x)
+   { return __builtin_sqrtf(__x); }
+ #else
+   inline float
+   sqrtf(float __x) { return ::sqrt(static_cast<double>(__x)); }
+ #endif
+ 
+ #if _GLIBCPP_HAVE_SQRTL
+   inline long double
+   sqrtl(long double __x)
+   { return __builtin_sqrtl(__x); }
+ #else
+   inline long double
+   sqrtl(long double __x) { return ::sqrt(static_cast<double>(__x)); }
+ #endif
  
    using ::tan;
  

*** libstdc++-v3/configure.dist	Thu Jul 17 13:32:00 2003
--- libstdc++-v3/configure	Wed Aug 27 16:21:41 2003
*************** EOF
*** 10379,10385 ****
  EOF
  
        cat >> confdefs.h <<\EOF
! #define HAVE_SQRTF 1
  EOF
  
        cat >> confdefs.h <<\EOF
--- 10379,10385 ----
  EOF
  
        cat >> confdefs.h <<\EOF
! #undef HAVE_SQRTF
  EOF
  
        cat >> confdefs.h <<\EOF


--
Jason Catena


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]