Subject: Re: gcc4.0
To: None <john@johnrshannon.com>
From: None <segv@netctl.net>
List: tech-pkg
Date: 11/03/2005 12:18:45
On Wed, 2 Nov 2005 04:09:23 -0700
"John R. Shannon" <john@johnrshannon.com> wrote:

> If you'd like to try it, you can download:
> 
> http://www.johnrshannon.com/NetBSD/gcc4.tar.gz
> 
> and/or
> 
> http://www.johnrshannon.com/NetBSD/gcc4-ada.tar.gz
> 
> untar in pkgsrc/lang

I had to add the following changes to lang/gcc4 in order to get it building:

lang/gcc4/Makefile had to be modified to add support for math/mpfr package,
otherwise Fortran compiler cannot be build:

.if !empty(BUILD_F77:M[Yy][Ee][Ss])
.include "../../devel/gmp/buildlink3.mk"
.include "../../math/mpfr/buildlink3.mk" 
CONFIGURE_ARGS+=        --with-gmp=${BUILDLINK_PREFIX.gmp}
CONFIGURE_ARGS+=        --with-mpfr=${BUILDLINK_PREFIX.mpfr}
USE_TOOLS+=             chmod
MAKE_ENV+=              ac_cv_path_ac_cv_prog_chmod="${TOOLS_CHMOD}"
.endif


Also I had to add the following patches, which are Solaris specific and
are described at http://gcc.gnu.org/gcc-4.0/changes.html#4.0.2

diff -u -r1.2917.2.85 -r1.2917.2.86
--- libstdc++-v3/ChangeLog      2005/09/21 03:58:38     1.2917.2.85
+++ libstdc++-v3/ChangeLog      2005/09/27 05:04:51     1.2917.2.86
@@ -1,3 +1,11 @@
+2005-09-25  Benjamin Kosnik  <bkoz@redhat.com>
+           Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * include/ext/mt_allocator.h
+       (__per_type_pool<...true>::_S_initialize_once): Always call
+       _M_initialize_once.
+       (__common_pool<...true>::_S_initialize_once): Same.
+
 2005-09-20  Release Manager
 
        * GCC 4.0.2 released.


diff -u -r1.45.8.2 -r1.45.8.3
--- libstdc++-v3/include/ext/mt_allocator.h     2005/09/20 05:24:49     1.45.8.2
+++ libstdc++-v3/include/ext/mt_allocator.h     2005/09/27 05:05:21     1.45.8.3
@@ -432,8 +432,11 @@
                static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
                __gthread_once(&__once, _S_initialize);
              }
-           else
-             _S_get_pool()._M_initialize_once(); 
+
+           // Double check initialization. May be necessary on some
+           // systems for proper construction when not compiling with
+           // thread flags.
+           _S_get_pool()._M_initialize_once(); 
            __init = true;
          }
       }
@@ -524,8 +527,11 @@
                static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
                __gthread_once(&__once, _S_initialize);
              }
-           else
-             _S_get_pool()._M_initialize_once(); 
+
+           // Double check initialization. May be necessary on some
+           // systems for proper construction when not compiling with
+           // thread flags.
+           _S_get_pool()._M_initialize_once(); 
            __init = true;
          }
       }