rpms/gcc/devel gcc41-dtor-relro.patch, NONE, 1.1 gcc41-libgomp-ncpus.patch, NONE, 1.1 gcc41-pr28482.patch, NONE, 1.1 gcc41-pr31748.patch, NONE, 1.1 gcc41-tls-data-alignment.patch, NONE, 1.1 .cvsignore, 1.205, 1.206 gcc41.spec, 1.159, 1.160 sources, 1.207, 1.208 gcc41-pr30558.patch, 1.1, NONE gcc41-pr31598.patch, 1.1, NONE gcc41-rh231818.patch, 1.3, NONE

Jakub Jelinek (jakub) fedora-extras-commits at redhat.com
Thu May 3 21:56:45 UTC 2007


Author: jakub

Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1886

Modified Files:
	.cvsignore gcc41.spec sources 
Added Files:
	gcc41-dtor-relro.patch gcc41-libgomp-ncpus.patch 
	gcc41-pr28482.patch gcc41-pr31748.patch 
	gcc41-tls-data-alignment.patch 
Removed Files:
	gcc41-pr30558.patch gcc41-pr31598.patch gcc41-rh231818.patch 
Log Message:
4.1.2-12

gcc41-dtor-relro.patch:

--- NEW FILE gcc41-dtor-relro.patch ---
2007-05-03  Ulrich Drepper  <drepper at redhat.com>
	    Jakub Jelinek  <jakub at redhat.com>

	* crtstuff.c (HIDDEN_DTOR_LIST_END): New macro.
	(__do_global_dtors_aux): Use more paranoid loop to run
	destructors if HIDDEN_DTOR_LIST_END.
	(__DTOR_END__): Export as a hidden symbol when HIDDEN_DTOR_LIST_END.

--- gcc/crtstuff.c.jj	2007-01-24 22:24:21.000000000 +0100
+++ gcc/crtstuff.c	2007-05-03 10:40:29.000000000 +0200
@@ -106,6 +107,11 @@ call_ ## FUNC (void)					\
 # define EH_FRAME_SECTION_CONST
 #endif
 
+#if !defined(DTOR_LIST_END) && defined(OBJECT_FORMAT_ELF) \
+    && defined(HAVE_GAS_HIDDEN) && !defined(FINI_ARRAY_SECTION_ASM_OP)
+# define HIDDEN_DTOR_LIST_END
+#endif
+
 /* We do not want to add the weak attribute to the declarations of these
    routines in unwind-dw2-fde.h because that will cause the definition of
    these symbols to be weak as well.
@@ -265,10 +271,6 @@ extern void __cxa_finalize (void *) TARG
 static void __attribute__((used))
 __do_global_dtors_aux (void)
 {
-#ifndef FINI_ARRAY_SECTION_ASM_OP
-  static func_ptr *p = __DTOR_LIST__ + 1;
-  func_ptr f;
-#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP)  */
   static _Bool completed;
 
   if (__builtin_expect (completed, 0))
@@ -282,12 +284,32 @@ __do_global_dtors_aux (void)
 #ifdef FINI_ARRAY_SECTION_ASM_OP
   /* If we are using .fini_array then destructors will be run via that
      mechanism.  */
+#elif defined(HIDDEN_DTOR_LIST_END)
+  {
+    /* Safer version that makes sure only .dtors function pointers are
+       called even if the static variable is maliciously changed.  */
+    extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden")));
+    static size_t dtor_idx;
+    const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1;
+    func_ptr f;
+
+    while (dtor_idx < max_idx)
+      {
+	f = __DTOR_LIST__[++dtor_idx];
+	f ();
+      }
+  }
 #else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */
-  while ((f = *p))
-    {
-      p++;
-      f ();
-    }
+  {
+    static func_ptr *p = __DTOR_LIST__ + 1;
+    func_ptr f;
+
+    while ((f = *p))
+      {
+	p++;
+	f ();
+      }
+  }
 #endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */
 
 #ifdef USE_EH_FRAME_REGISTRY
@@ -471,6 +493,17 @@ STATIC func_ptr __CTOR_END__[1]
 
 #ifdef DTOR_LIST_END
 DTOR_LIST_END;
+#elif defined(HIDDEN_DTOR_LIST_END)
+#ifdef DTORS_SECTION_ASM_OP
+asm (DTORS_SECTION_ASM_OP);
+#endif
+func_ptr __DTOR_END__[1]
+  __attribute__ ((unused,
+#ifndef DTORS_SECTION_ASM_OP
+		  section(".dtors"),
+#endif
+		  aligned(sizeof(func_ptr)), visibility ("hidden")))
+  = { (func_ptr) 0 };
 #elif defined(DTORS_SECTION_ASM_OP)
 asm (DTORS_SECTION_ASM_OP);
 STATIC func_ptr __DTOR_END__[1]

gcc41-libgomp-ncpus.patch:

--- NEW FILE gcc41-libgomp-ncpus.patch ---
2007-05-02  Jakub Jelinek  <jakub at redhat.com>

	* config/linux/proc.c: New file.

--- libgomp/config/linux/proc.c.jj	2007-05-02 13:50:37.000000000 +0200
+++ libgomp/config/linux/proc.c	2007-05-02 16:00:47.000000000 +0200
@@ -0,0 +1,179 @@
+/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Contributed by Jakub Jelinek <jakub at redhat.com>.
+
+   This file is part of the GNU OpenMP Library (libgomp).
+
+   Libgomp is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+   FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
+   more details.
+
+   You should have received a copy of the GNU Lesser General Public License 
+   along with libgomp; see the file COPYING.LIB.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with other files, some
+   of which are compiled with GCC, to produce an executable, this library
+   does not by itself cause the resulting executable to be covered by the
+   GNU General Public License.  This exception does not however invalidate
+   any other reasons why the executable file might be covered by the GNU
+   General Public License.  */
+
+/* This file contains system specific routines related to counting
+   online processors and dynamic load balancing.  */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+#include "libgomp.h"
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+#  include <sys/loadavg.h>
+# endif
+#endif
+
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+static unsigned long
+cpuset_popcount (cpu_set_t *cpusetp)
+{
+#ifdef CPU_COUNT
+  /* glibc 2.6 and above provide a macro for this.  */
+  return CPU_COUNT (cpusetp);
+#else
+  size_t i;
+  unsigned long ret = 0;
+  extern int check[sizeof (cpusetp->__bits[0]) == sizeof (unsigned long int)];
+
+  (void) check;
+  for (i = 0; i < sizeof (*cpusetp) / sizeof (cpusetp->__bits[0]); i++)
+    {
+      unsigned long int mask = cpusetp->__bits[i];
+      if (mask == 0)
+	continue;
+      ret += __builtin_popcountl (mask);
+    }
+  return ret;
+#endif
+}
+#endif
+
+/* At startup, determine the default number of threads.  It would seem
+   this should be related to the number of cpus online.  */
+
+void
+gomp_init_num_threads (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+  cpu_set_t cpuset;
+
+  if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset) == 0)
+    {
+      /* Count only the CPUs this process can use.  */
+      gomp_nthreads_var = cpuset_popcount (&cpuset);
+      if (gomp_nthreads_var == 0)
+	gomp_nthreads_var = 1;
+      return;
+    }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+  gomp_nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
+#endif
+}
+
+static int
+get_num_procs (void)
+{
+#ifdef HAVE_PTHREAD_AFFINITY_NP
+  cpu_set_t cpuset;
+
+  if (gomp_cpu_affinity == NULL)
+    {
+      /* Count only the CPUs this process can use.  */
+      if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset),
+				  &cpuset) == 0)
+	{
+	  int ret = cpuset_popcount (&cpuset);
+	  return ret != 0 ? ret : 1;
+	}
+    }
+  else
+    {
+      size_t idx;
+      static int affinity_cpus;
+
+      /* We can't use pthread_getaffinity_np in this case
+	 (we have changed it ourselves, it binds to just one CPU).
+	 Count instead the number of different CPUs we are
+	 using.  */
+      CPU_ZERO (&cpuset);
+      if (affinity_cpus == 0)
+	{
+	  int cpus = 0;
+	  for (idx = 0; idx < gomp_cpu_affinity_len; idx++)
+	    if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpuset))
+	      {
+		cpus++;
+		CPU_SET (gomp_cpu_affinity[idx], &cpuset);
+	      }
+	  affinity_cpus = cpus;
+	}
+      return affinity_cpus;
+    }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+  return sysconf (_SC_NPROCESSORS_ONLN);
+#else
+  return gomp_nthreads_var;
+#endif
+}
+
+/* When OMP_DYNAMIC is set, at thread launch determine the number of
+   threads we should spawn for this team.  */
+/* ??? I have no idea what best practice for this is.  Surely some
+   function of the number of processors that are *still* online and
+   the load average.  Here I use the number of processors online
+   minus the 15 minute load average.  */
+
+unsigned
+gomp_dynamic_max_threads (void)
+{
+  unsigned n_onln, loadavg;
+
+  n_onln = get_num_procs ();
+  if (n_onln > gomp_nthreads_var)
+    n_onln = gomp_nthreads_var;
+
+  loadavg = 0;
+#ifdef HAVE_GETLOADAVG
+  {
+    double dloadavg[3];
+    if (getloadavg (dloadavg, 3) == 3)
+      {
+	/* Add 0.1 to get a kind of biased rounding.  */
+	loadavg = dloadavg[2] + 0.1;
+      }
+  }
+#endif
+
+  if (loadavg >= n_onln)
+    return 1;
+  else
+    return n_onln - loadavg;
+}
+
+int
+omp_get_num_procs (void)
+{
+  return get_num_procs ();
+}
+
+ialias (omp_get_num_procs)

gcc41-pr28482.patch:

--- NEW FILE gcc41-pr28482.patch ---
2007-05-02  Jakub Jelinek  <jakub at redhat.com>

	PR libgomp/28482
	* configure.tgt: Don't link with -Wl,-z,nodlopen even on Linux.

--- libgomp/configure.tgt.jj	2007-04-20 12:55:40.000000000 +0200
+++ libgomp/configure.tgt	2007-05-02 17:32:15.000000000 +0200
@@ -11,14 +11,11 @@
 #  XLDFLAGS		Add extra link flags to use.
 
 # Optimize TLS usage by avoiding the overhead of dynamic allocation.
-# This does require that the library be present during process 
-# startup, so mark the library as not to be dlopened.
 if test $have_tls = yes ; then
   case "${target}" in
 
     *-*-linux*)
 	XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
-	XLDFLAGS="${XLDFLAGS} -Wl,-z,nodlopen"
 	;;
   esac
 fi

gcc41-pr31748.patch:

--- NEW FILE gcc41-pr31748.patch ---
2007-05-01  Jakub Jelinek  <jakub at redhat.com>

	PR c++/31748
	* semantics.c (finish_omp_clauses): Use %qD instead of %qE for
	DECL_P in not a variable and appears more than once error messages.

	* g++.dg/gomp/pr31748.C: New test.

--- gcc/cp/semantics.c.jj	2007-04-26 09:30:58.000000000 +0200
+++ gcc/cp/semantics.c	2007-05-01 14:22:58.000000000 +0200
@@ -3376,14 +3376,17 @@ finish_omp_clauses (tree clauses)
 	    {
 	      if (processing_template_decl)
 		break;
-	      error ("%qE is not a variable in clause %qs", t, name);
+	      if (DECL_P (t))
+		error ("%qD is not a variable in clause %qs", t, name);
+	      else
+		error ("%qE is not a variable in clause %qs", t, name);
 	      remove = true;
 	    }
 	  else if (bitmap_bit_p (&generic_head, DECL_UID (t))
 		   || bitmap_bit_p (&firstprivate_head, DECL_UID (t))
 		   || bitmap_bit_p (&lastprivate_head, DECL_UID (t)))
 	    {
-	      error ("%qE appears more than once in data clauses", t);
+	      error ("%qD appears more than once in data clauses", t);
 	      remove = true;
 	    }
 	  else
--- gcc/testsuite/g++.dg/gomp/pr31748.C.jj	2007-05-01 14:26:13.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr31748.C	2007-05-01 14:26:07.000000000 +0200
@@ -0,0 +1,10 @@
+// PR c++/31748
+
+struct A;
+
+void
+foo ()
+{
+#pragma omp parallel private(A)	// { dg-error "struct A.*is not a variable" }
+  ;
+}

gcc41-tls-data-alignment.patch:

--- NEW FILE gcc41-tls-data-alignment.patch ---
2007-05-03  Jakub Jelinek  <jakub at redhat.com>

	* varasm.c (align_variable): Don't increase alignment for
	DECL_THREAD_LOCAL_P variables above BITS_PER_WORD through
	DATA_ALIGNMENT or CONSTANT_ALIGNMENT.

--- gcc/varasm.c.jj	2007-04-14 14:55:25.000000000 +0200
+++ gcc/varasm.c	2007-05-03 11:23:56.000000000 +0200
@@ -1097,11 +1097,22 @@ align_variable (tree decl, bool dont_out
   if (! DECL_USER_ALIGN (decl))
     {
 #ifdef DATA_ALIGNMENT
-      align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+      unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+      /* Don't increase alignment too much for TLS variables - TLS space
+	 is too precious.  */
+      if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
+	align = data_align;
 #endif
 #ifdef CONSTANT_ALIGNMENT
       if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node)
-	align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
+	{
+	  unsigned int const_align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl),
+							 align);
+	  /* Don't increase alignment too much for TLS variables - TLS space
+	     is too precious.  */
+	  if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
+	    align = const_align;
+	}
 #endif
     }
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/.cvsignore,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -r1.205 -r1.206
--- .cvsignore	25 Apr 2007 09:44:58 -0000	1.205
+++ .cvsignore	3 May 2007 21:56:10 -0000	1.206
@@ -1 +1 @@
-gcc-4.1.2-20070424.tar.bz2
+gcc-4.1.2-20070503.tar.bz2


Index: gcc41.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc41.spec,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -r1.159 -r1.160
--- gcc41.spec	25 Apr 2007 09:44:58 -0000	1.159
+++ gcc41.spec	3 May 2007 21:56:10 -0000	1.160
@@ -1,6 +1,6 @@
-%define DATE 20070424
+%define DATE 20070503
 %define gcc_version 4.1.2
-%define gcc_release 11
+%define gcc_release 12
 %define _unpackaged_files_terminate_build 0
 %define multilib_64_archs sparc64 ppc64 s390x x86_64
 %define include_gappletviewer 1
@@ -137,12 +137,14 @@
 Patch26: gcc41-java-bogus-debugline.patch
 Patch27: gcc41-libjava-visibility.patch
 Patch28: gcc41-pr31187.patch
-Patch29: gcc41-rh231818.patch
+Patch29: gcc41-dtor-relro.patch
 Patch30: gcc41-rh234515.patch
-Patch31: gcc41-pr30558.patch
+Patch31: gcc41-libgomp-ncpus.patch
 Patch32: gcc41-rh236895.patch
-Patch33: gcc41-pr31598.patch
+Patch33: gcc41-pr28482.patch
 Patch34: gcc41-rh235008.patch
+Patch35: gcc41-pr31748.patch
+Patch36: gcc41-tls-data-alignment.patch
 
 %define _gnu %{nil}
 %ifarch sparc
@@ -450,12 +452,14 @@
 %patch26 -p0 -b .java-bogus-debugline~
 %patch27 -p0 -b .libjava-visibility~
 %patch28 -p0 -b .pr31187~
-%patch29 -p0 -b .rh231818~
+%patch29 -p0 -b .dtor-relro~
 %patch30 -p0 -b .rh234515~
-%patch31 -p0 -b .pr30558~
+%patch31 -p0 -b .libgomp-ncpus~
 %patch32 -p0 -b .rh236895~
-%patch33 -p0 -b .pr31598~
+%patch33 -p0 -b .pr28482~
 %patch34 -p0 -b .rh235008~
+%patch35 -p0 -b .pr31748~
+%patch36 -p0 -b .tls-data-alignment~
 
 sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c
 sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@@ -1579,6 +1583,19 @@
 %doc rpm.doc/changelogs/libmudflap/ChangeLog*
 
 %changelog
+* Thu May  3 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-12
+- update from gcc-4_1-branch (-r124100:124365)
+  - PRs c++/30016, c++/30221, middle-end/30761, target/18989,
+	target/28675, tree-optimization/29446, tree-optimization/31698
+- add default.css Java resource (Tom Fitzsimmons, #237304)
+- don't increase alignment of TLS variables too much
+- __do_global_dtors_aux hardening
+- allow libgomp to be dlopened (PR libgomp/28482)
+- speed up and improve libgomp omp_get_num_procs and dynamic
+  thread count computation
+- GOMP_CPU_AFFINITY support
+- fix ICE on C++ type passed as OpenMP clause variable (PR c++/31748)
+
 * Wed Apr 25 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-11
 - update from gcc-4_1-branch (-r123951:124100)
   - PRs middle-end/31448, preprocessor/30468, target/28623, target/31641


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/sources,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -r1.207 -r1.208
--- sources	25 Apr 2007 09:44:58 -0000	1.207
+++ sources	3 May 2007 21:56:10 -0000	1.208
@@ -1 +1 @@
-0a2c2aaf18c3227cfb4a6f85ec68847d  gcc-4.1.2-20070424.tar.bz2
+f592f2e4d5779b970a7050a864131e69  gcc-4.1.2-20070503.tar.bz2


--- gcc41-pr30558.patch DELETED ---


--- gcc41-pr31598.patch DELETED ---


--- gcc41-rh231818.patch DELETED ---




More information about the fedora-extras-commits mailing list