Gentoo Archives: gentoo-commits

From: "Mark Loeser (halcy0n)" <halcy0n@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.4.3/gentoo: 92_all_gcc-4.4-cloog-dl.patch README.history
Date: Sun, 25 Apr 2010 18:43:05
Message-Id: 20100425184257.26D752C04C@corvid.gentoo.org
1 halcy0n 10/04/25 18:42:56
2
3 Modified: README.history
4 Added: 92_all_gcc-4.4-cloog-dl.patch
5 Log:
6 Prevent linking of ppl/cloog into everything; bug #317059
7
8 Revision Changes Path
9 1.2 src/patchsets/gcc/4.4.3/gentoo/README.history
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.2&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.2&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?r1=1.1&r2=1.2
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history,v
18 retrieving revision 1.1
19 retrieving revision 1.2
20 diff -u -r1.1 -r1.2
21 --- README.history 8 Feb 2010 12:57:27 -0000 1.1
22 +++ README.history 25 Apr 2010 18:42:56 -0000 1.2
23 @@ -1,3 +1,6 @@
24 +1.1 25.04.2010
25 + + 92_all_gcc-4.4-cloog-dl.patch
26 +
27 1.0 07.02.2009
28 + 00_all_gcc-4.1-alpha-mieee-default.patch
29 + 00_all_gcc-trampolinewarn.patch
30
31
32
33 1.1 src/patchsets/gcc/4.4.3/gentoo/92_all_gcc-4.4-cloog-dl.patch
34
35 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
36 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
37
38 Index: 92_all_gcc-4.4-cloog-dl.patch
39 ===================================================================
40 # DP: Link against -ldl instead of -lcloog -lppl. Exit with an error when using
41 # DP: the Graphite loop transformation infrastructure without having the
42 # DP: libcloog-ppl0 package installed. Packages using these optimizations
43 # DP: should build-depend on libcloog-ppl0.
44
45 2009-01-27 Jakub Jelinek <jakub@××××××.com>
46
47 * Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl.
48 (graphite.o): Force -O, remove -fkeep-inline-functions.
49 * graphite.c: Include <dlfcn.h>. Reference libcloog and libppl symbols
50 through pointers in cloog_pointers variable.
51 (init_cloog_pointers): New function.
52 (gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora.
53 (graphite_transform_loops): Call init_cloog_pointers.
54
55 --- a/src/gcc/Makefile.in.jj 2009-01-26 20:50:38.000000000 +0100
56 +++ b/src/gcc/Makefile.in 2009-01-27 14:18:10.000000000 +0100
57 @@ -915,7 +915,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
58 # How to link with both our special library facilities
59 # and the system's installed libraries.
60 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
61 -BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
62 +BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
63 # Any system libraries needed just for GNAT.
64 SYSLIBS = @GNAT_LIBEXC@
65
66 @@ -3076,6 +3076,9 @@ $(out_object_file): $(out_file) $(CONFIG
67 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
68 $(out_file) $(OUTPUT_OPTION)
69
70 +graphite.o : \
71 + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
72 +
73 # Build auxiliary files that support ecoff format.
74 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
75 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
76 --- a/src/gcc/graphite.c.jj 2009-01-24 19:59:02.000000000 +0100
77 +++ b/src/gcc/graphite.c 2009-01-27 14:52:08.000000000 +0100
78 @@ -59,6 +59,110 @@ along with GCC; see the file COPYING3.
79 #include "cloog/cloog.h"
80 #include "graphite.h"
81
82 +#include <dlfcn.h>
83 +#define DYNSYMS \
84 + DYNSYM (cloog_block_alloc); \
85 + DYNSYM (cloog_block_list_free); \
86 + DYNSYM (cloog_block_list_malloc); \
87 + DYNSYM (cloog_clast_create); \
88 + DYNSYM (cloog_clast_free); \
89 + DYNSYM (cloog_domain_free); \
90 + DYNSYM (cloog_domain_matrix2domain); \
91 + DYNSYM (cloog_initialize); \
92 + DYNSYM (cloog_loop_malloc); \
93 + DYNSYM (cloog_matrix_alloc); \
94 + DYNSYM (cloog_matrix_copy); \
95 + DYNSYM (cloog_matrix_free); \
96 + DYNSYM (cloog_matrix_print); \
97 + DYNSYM (cloog_names_malloc); \
98 + DYNSYM (cloog_names_scalarize); \
99 + DYNSYM (cloog_options_free); \
100 + DYNSYM (cloog_options_malloc); \
101 + DYNSYM (cloog_program_dump_cloog); \
102 + DYNSYM (cloog_program_extract_scalars); \
103 + DYNSYM (cloog_program_free); \
104 + DYNSYM (cloog_program_generate); \
105 + DYNSYM (cloog_program_malloc); \
106 + DYNSYM (cloog_program_print); \
107 + DYNSYM (cloog_program_scatter); \
108 + DYNSYM (cloog_statement_alloc); \
109 + DYNSYM (ppl_finalize); \
110 + DYNSYM (pprint); \
111 + DYNSYM (stmt_block); \
112 + DYNSYM (stmt_for); \
113 + DYNSYM (stmt_guard); \
114 + DYNSYM (stmt_root); \
115 + DYNSYM (stmt_user);
116 +static struct
117 +{
118 + bool inited;
119 + void *h;
120 +#define DYNSYM(x) __typeof (x) *p_##x
121 + DYNSYMS
122 +#undef DYNSYM
123 +} cloog_pointers;
124 +
125 +#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
126 +#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
127 +#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
128 +#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
129 +#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
130 +#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
131 +#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
132 +#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
133 +#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
134 +#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
135 +#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
136 +#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
137 +#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
138 +#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
139 +#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
140 +#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
141 +#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
142 +#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
143 +#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
144 +#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
145 +#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
146 +#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
147 +#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
148 +#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
149 +#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
150 +#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
151 +#define pprint (*cloog_pointers.p_pprint)
152 +#define stmt_block (*cloog_pointers.p_stmt_block)
153 +#define stmt_for (*cloog_pointers.p_stmt_for)
154 +#define stmt_guard (*cloog_pointers.p_stmt_guard)
155 +#define stmt_root (*cloog_pointers.p_stmt_root)
156 +#define stmt_user (*cloog_pointers.p_stmt_user)
157 +
158 +#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
159 +
160 +static bool
161 +init_cloog_pointers (void)
162 +{
163 + void *h;
164 +
165 + if (cloog_pointers.inited)
166 + return cloog_pointers.h != NULL;
167 + h = dlopen ("libcloog-ppl.so.0", RTLD_LAZY);
168 + cloog_pointers.h = h;
169 + if (h == NULL)
170 + return false;
171 +#define DYNSYM(x) \
172 + do \
173 + { \
174 + union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
175 + u.q = dlsym (h, #x); \
176 + if (u.q == NULL) \
177 + return false; \
178 + cloog_pointers.p_##x = u.p; \
179 + } \
180 + while (0)
181 + DYNSYMS
182 +#undef DYNSYM
183 + return true;
184 +}
185 +
186 static VEC (scop_p, heap) *current_scops;
187
188 /* Converts a GMP constant V to a tree and returns it. */
189 @@ -4019,10 +4151,10 @@ clast_get_body_of_loop (struct clast_stm
190 STMT. */
191
192 static tree
193 -gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
194 +gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
195 {
196 - struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
197 - const char *cloog_iv = stmt_for->iterator;
198 + struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
199 + const char *cloog_iv = stmt_fora->iterator;
200 CloogStatement *cs = stmt->statement;
201 graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
202
203 @@ -6061,6 +6193,12 @@ graphite_transform_loops (void)
204 if (number_of_loops () <= 1)
205 return;
206
207 + if (!init_cloog_pointers ())
208 + {
209 + sorry ("Graphite loop optimizations can only be used if the libcloog-ppl0 package is installed");
210 + return;
211 + }
212 +
213 current_scops = VEC_alloc (scop_p, heap, 3);
214 recompute_all_dominators ();