public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/gcc/4.4.3/gentoo: 92_all_gcc-4.4-cloog-dl.patch README.history
@ 2010-04-25 18:42 Mark Loeser (halcy0n)
  0 siblings, 0 replies; only message in thread
From: Mark Loeser (halcy0n) @ 2010-04-25 18:42 UTC (permalink / raw
  To: gentoo-commits

halcy0n     10/04/25 18:42:56

  Modified:             README.history
  Added:                92_all_gcc-4.4-cloog-dl.patch
  Log:
  Prevent linking of ppl/cloog into everything; bug #317059

Revision  Changes    Path
1.2                  src/patchsets/gcc/4.4.3/gentoo/README.history

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?r1=1.1&r2=1.2

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README.history	8 Feb 2010 12:57:27 -0000	1.1
+++ README.history	25 Apr 2010 18:42:56 -0000	1.2
@@ -1,3 +1,6 @@
+1.1		25.04.2010
+	+ 92_all_gcc-4.4-cloog-dl.patch
+
 1.0		07.02.2009
 	+ 00_all_gcc-4.1-alpha-mieee-default.patch
 	+ 00_all_gcc-trampolinewarn.patch



1.1                  src/patchsets/gcc/4.4.3/gentoo/92_all_gcc-4.4-cloog-dl.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/92_all_gcc-4.4-cloog-dl.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/92_all_gcc-4.4-cloog-dl.patch?rev=1.1&content-type=text/plain

Index: 92_all_gcc-4.4-cloog-dl.patch
===================================================================
# DP: Link against -ldl instead of -lcloog -lppl. Exit with an error when using
# DP: the Graphite loop transformation infrastructure without having the
# DP: libcloog-ppl0 package installed. Packages using these optimizations
# DP: should build-depend on libcloog-ppl0.

2009-01-27  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl.
	(graphite.o): Force -O, remove -fkeep-inline-functions.
	* graphite.c: Include <dlfcn.h>.  Reference libcloog and libppl symbols
	through pointers in cloog_pointers variable.
	(init_cloog_pointers): New function.
	(gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora.
	(graphite_transform_loops): Call init_cloog_pointers.

--- a/src/gcc/Makefile.in.jj	2009-01-26 20:50:38.000000000 +0100
+++ b/src/gcc/Makefile.in	2009-01-27 14:18:10.000000000 +0100
@@ -915,7 +915,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
 # How to link with both our special library facilities
 # and the system's installed libraries.
 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
+BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
 # Any system libraries needed just for GNAT.
 SYSLIBS = @GNAT_LIBEXC@
 
@@ -3076,6 +3076,9 @@ $(out_object_file): $(out_file) $(CONFIG
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
 		$(out_file) $(OUTPUT_OPTION)
 
+graphite.o : \
+  ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+
 # Build auxiliary files that support ecoff format.
 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
--- a/src/gcc/graphite.c.jj	2009-01-24 19:59:02.000000000 +0100
+++ b/src/gcc/graphite.c	2009-01-27 14:52:08.000000000 +0100
@@ -59,6 +59,110 @@ along with GCC; see the file COPYING3.  
 #include "cloog/cloog.h"
 #include "graphite.h"
 
+#include <dlfcn.h>
+#define DYNSYMS \
+  DYNSYM (cloog_block_alloc); \
+  DYNSYM (cloog_block_list_free); \
+  DYNSYM (cloog_block_list_malloc); \
+  DYNSYM (cloog_clast_create); \
+  DYNSYM (cloog_clast_free); \
+  DYNSYM (cloog_domain_free); \
+  DYNSYM (cloog_domain_matrix2domain); \
+  DYNSYM (cloog_initialize); \
+  DYNSYM (cloog_loop_malloc); \
+  DYNSYM (cloog_matrix_alloc); \
+  DYNSYM (cloog_matrix_copy); \
+  DYNSYM (cloog_matrix_free); \
+  DYNSYM (cloog_matrix_print); \
+  DYNSYM (cloog_names_malloc); \
+  DYNSYM (cloog_names_scalarize); \
+  DYNSYM (cloog_options_free); \
+  DYNSYM (cloog_options_malloc); \
+  DYNSYM (cloog_program_dump_cloog); \
+  DYNSYM (cloog_program_extract_scalars); \
+  DYNSYM (cloog_program_free); \
+  DYNSYM (cloog_program_generate); \
+  DYNSYM (cloog_program_malloc); \
+  DYNSYM (cloog_program_print); \
+  DYNSYM (cloog_program_scatter); \
+  DYNSYM (cloog_statement_alloc); \
+  DYNSYM (ppl_finalize); \
+  DYNSYM (pprint); \
+  DYNSYM (stmt_block); \
+  DYNSYM (stmt_for); \
+  DYNSYM (stmt_guard); \
+  DYNSYM (stmt_root); \
+  DYNSYM (stmt_user);
+static struct
+{
+  bool inited;
+  void *h;
+#define DYNSYM(x) __typeof (x) *p_##x
+  DYNSYMS
+#undef DYNSYM
+} cloog_pointers;
+
+#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
+#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
+#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
+#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
+#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
+#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
+#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
+#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
+#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
+#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
+#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
+#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
+#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
+#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
+#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
+#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
+#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
+#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
+#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
+#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
+#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
+#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
+#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
+#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
+#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
+#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
+#define pprint (*cloog_pointers.p_pprint)
+#define stmt_block (*cloog_pointers.p_stmt_block)
+#define stmt_for (*cloog_pointers.p_stmt_for)
+#define stmt_guard (*cloog_pointers.p_stmt_guard)
+#define stmt_root (*cloog_pointers.p_stmt_root)
+#define stmt_user (*cloog_pointers.p_stmt_user)
+
+#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
+
+static bool
+init_cloog_pointers (void)
+{
+  void *h;
+
+  if (cloog_pointers.inited)
+    return cloog_pointers.h != NULL;
+  h = dlopen ("libcloog-ppl.so.0", RTLD_LAZY);
+  cloog_pointers.h = h;
+  if (h == NULL)
+    return false;
+#define DYNSYM(x) \
+  do \
+    { \
+      union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
+      u.q = dlsym (h, #x); \
+      if (u.q == NULL) \
+	return false; \
+      cloog_pointers.p_##x = u.p; \
+    } \
+  while (0)
+  DYNSYMS
+#undef DYNSYM
+  return true;
+}
+
 static VEC (scop_p, heap) *current_scops;
 
 /* Converts a GMP constant V to a tree and returns it.  */
@@ -4019,10 +4151,10 @@ clast_get_body_of_loop (struct clast_stm
    STMT.  */
 
 static tree
-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
+gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
 {
-  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
-  const char *cloog_iv = stmt_for->iterator;
+  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
+  const char *cloog_iv = stmt_fora->iterator;
   CloogStatement *cs = stmt->statement;
   graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
 
@@ -6061,6 +6193,12 @@ graphite_transform_loops (void)
   if (number_of_loops () <= 1)
     return;
 
+  if (!init_cloog_pointers ())
+    {
+      sorry ("Graphite loop optimizations can only be used if the libcloog-ppl0 package is installed");
+      return;
+    }
+
   current_scops = VEC_alloc (scop_p, heap, 3);
   recompute_all_dominators ();
 






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-25 18:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-25 18:42 [gentoo-commits] gentoo commit in src/patchsets/gcc/4.4.3/gentoo: 92_all_gcc-4.4-cloog-dl.patch README.history Mark Loeser (halcy0n)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox