]>
Commit | Line | Data |
---|---|---|
eaf5b57a | 1 | --- solenv/inc/unxlngs.mk~ 2004-02-24 00:20:16.000000000 +0100 |
2 | +++ solenv/inc/unxlngs.mk 2004-02-24 00:42:46.000000000 +0100 | |
3 | @@ -64,7 +64,7 @@ | |
4 | ASM=gcc | |
5 | AFLAGS=-Wa,-Av8plus,-K,PIC -c $(CDEFS) | |
6 | ||
7 | -SOLAR_JAVA=TRUE | |
8 | +SOLAR_JAVA= | |
9 | JAVAFLAGSDEBUG=-g | |
10 | ||
11 | # filter for supressing verbose messages from linker | |
12 | @@ -95,6 +96,15 @@ | |
13 | CFLAGS= | |
14 | .ENDIF | |
15 | CFLAGS+=-fmessage-length=0 -c $(INCLUDE) | |
16 | + | |
17 | +# flags to enable build with symbols; required for crashdump feature | |
18 | +.IF "$(ENABLE_SYMBOLS)"=="SMALL" | |
19 | +CFLAGSENABLESYMBOLS=-g1 | |
20 | +.ELSE | |
21 | +CFLAGSENABLESYMBOLS=-g | |
22 | +.ENDIF | |
23 | + | |
24 | + | |
25 | # flags for the C++ Compiler | |
26 | CFLAGSCC= -pipe | |
27 | # Flags for enabling exception handling | |
28 | @@ -129,10 +139,12 @@ | |
29 | CFLAGSDBGUTIL= | |
30 | # Compiler flags for enabling optimazations | |
31 | # CFLAGSOPT=-O2 | |
32 | +CFLAGSOPT=-O3 -fno-strict-aliasing | |
33 | +#CFLAGSOPT=-O2 -fno-strict-aliasing | |
34 | # reduce to -O1 to avoid optimisation problems | |
35 | -CFLAGSOPT=-O1 | |
36 | +#CFLAGSOPT=-O1 | |
37 | # Compiler flags for disabling optimazations | |
38 | -CFLAGSNOOPT= | |
39 | +CFLAGSNOOPT=-fno-strict-aliasing | |
40 | # Compiler flags for discibing the output path | |
41 | CFLAGSOUTOBJ=-o | |
42 | # Enable all warnings | |
43 | @@ -152,8 +164,10 @@ | |
44 | LINKFLAGS=-z combreloc $(LINKFLAGSRUNPATH) | |
45 | ||
46 | # linker flags for linking applications | |
47 | -LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec | |
48 | -LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec | |
49 | +#LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec | |
50 | +#LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec | |
51 | +LINKFLAGSAPPGUI= -Wl,--noinhibit-exec | |
52 | +LINKFLAGSAPPCUI= -Wl,--noinhibit-exec | |
53 | ||
54 | # linker flags for linking shared libraries | |
55 | LINKFLAGSSHLGUI= -shared | |
56 | diff -u -r1.7.10.2 makefile.mk | |
57 | --- crashrep/source/unx/makefile.mk 21 Aug 2003 09:46:32 -0000 1.7.10.2 | |
58 | +++ crashrep/source/unx/makefile.mk 25 Aug 2003 11:28:34 -0000 | |
59 | @@ -125,6 +125,9 @@ | |
60 | .IF "$(OS)" == "FREEBSD" | |
61 | APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11 | |
62 | .ENDIF | |
63 | +.IF "$(CPUNAME)$(OS)"=="SPARCLINUX" | |
64 | +APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11 -ldl -lnsl | |
65 | +.ENDIF | |
66 | ||
67 | .ENDIF | |
68 | # Building crash_report_static | |
69 | diff -u -r1.21 makefile.mk | |
70 | --- dbaccess/util/makefile.mk 15 Apr 2003 13:33:01 -0000 1.21 | |
71 | +++ dbaccess/util/makefile.mk 25 Aug 2003 11:28:40 -0000 | |
72 | @@ -76,6 +76,9 @@ | |
73 | ||
74 | LDUMP=ldump2.exe | |
75 | ||
76 | +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" | |
77 | +DYNAMIC+=-Wl,--export-dynamic | |
78 | +.ENDIF | |
79 | # --- database core (dba) ----------------------------------- | |
80 | ||
81 | LIB1TARGET=$(SLB)$/dbaccess.lib | |
82 | diff -u -r1.4 backtrace.c | |
83 | --- sal/osl/unx/backtrace.c 16 Jul 2003 17:20:28 -0000 1.4 | |
84 | +++ sal/osl/unx/backtrace.c 25 Aug 2003 11:32:03 -0000 | |
85 | @@ -81,11 +81,10 @@ | |
86 | ||
87 | #else | |
88 | ||
89 | -#error Unknown Solaris target platform. | |
90 | +#error Unknown Solaris target platform. | |
91 | ||
92 | #endif /* defined SPARC or INTEL */ | |
93 | ||
94 | - | |
95 | int backtrace( void **buffer, int max_frames ) | |
96 | { | |
97 | struct frame *fp; | |
98 | @@ -177,7 +176,7 @@ | |
99 | #include <exception.h> | |
100 | #include <sys/signal.h> | |
101 | #include <unistd.h> | |
102 | - | |
103 | + | |
104 | /* Need extra libs -lexc -ldwarf -lelf */ | |
105 | ||
106 | int backtrace( void **buffer, int max_frames ) | |
107 | @@ -188,13 +187,13 @@ | |
108 | memset(&context, 0, sizeof(struct sigcontext)); | |
109 | ||
110 | exc_setjmp(&context); | |
111 | - while(context.sc_pc != 1 && i < max_frames) { | |
112 | - exc_unwind(&context, 0); | |
113 | + while(context.sc_pc != 1 && i < max_frames) { | |
114 | + exc_unwind(&context, 0); | |
115 | if(context.sc_pc != 1) { | |
116 | *(buffer++) = (void *)context.sc_pc; | |
117 | i++; | |
118 | } | |
119 | - } | |
120 | + } | |
121 | return(i); | |
122 | } | |
123 | ||
124 | @@ -207,7 +206,7 @@ | |
125 | if ( fp ) { | |
126 | while(context.sc_pc!=1) { | |
127 | if(context.sc_pc != 1) { | |
128 | - exc_unwind_name(&context, 0, &name); | |
129 | + exc_unwind_name(&context, 0, &name); | |
130 | fprintf(fp, " 0x%012lx %.100s\n", context.sc_pc, name ? name : "<unknown function>"); | |
131 | free(name); | |
132 | } | |
133 | @@ -219,3 +218,125 @@ | |
134 | } | |
135 | #endif /* defined IRIX */ | |
136 | ||
137 | +#if defined(LINUX) | |
138 | +#if defined(SPARC) | |
139 | +#define FRAME_PTR_OFFSET 1 | |
140 | +#define FRAME_OFFSET 0 | |
141 | + | |
142 | +#else | |
143 | + | |
144 | +#error Unknown Linux target platform. | |
145 | +#endif /* defined SPARC or INTEL */ | |
146 | + | |
147 | +#include <pthread.h> | |
148 | +#include <setjmp.h> | |
149 | +#include <stdio.h> | |
150 | +#include "backtrace.h" | |
151 | +# define ptrdiff_t int | |
152 | + | |
153 | +typedef struct | |
154 | +{ | |
155 | + const char *dli_fname; /* File name of defining object. */ | |
156 | + void *dli_fbase; /* Load address of that object. */ | |
157 | + const char *dli_sname; /* Name of nearest symbol. */ | |
158 | + void *dli_saddr; /* Exact value of nearest symbol. */ | |
159 | +} Dl_info; | |
160 | + | |
161 | + | |
162 | + | |
163 | +struct frame { | |
164 | + long fr_local[8]; | |
165 | + long fr_arg[6]; | |
166 | + struct frame *fr_savfp; | |
167 | + long fr_savpc; | |
168 | +# ifndef __arch64__ | |
169 | + char *fr_stret; | |
170 | +# endif | |
171 | + long fr_argd[6]; | |
172 | + long fr_argx[0]; | |
173 | +}; | |
174 | + | |
175 | +/* http://gcc.gnu.org/ml/java-patches/2000-q2/msg00115.html */ | |
176 | + | |
177 | + | |
178 | +int backtrace( void **buffer, int max_frames ) | |
179 | +{ | |
180 | + struct frame *fp; | |
181 | + jmp_buf ctx; | |
182 | + int i; | |
183 | + | |
184 | + /* flush register windows */ | |
185 | +#ifdef SPARC | |
186 | + asm("ta 3"); | |
187 | +#endif | |
188 | + /* get stack- and framepointer */ | |
189 | + setjmp(ctx); | |
190 | + fp = (struct frame*)(((size_t*)(ctx))[FRAME_PTR_OFFSET]); | |
191 | + for ( i=0; (i<FRAME_OFFSET) && (fp!=0); i++) | |
192 | + fp = fp->fr_savfp; | |
193 | + | |
194 | + /* iterate through backtrace */ | |
195 | + for (i=0; fp && fp->fr_savpc && i<max_frames; i++) | |
196 | + { | |
197 | + /* store frame */ | |
198 | + *(buffer++) = (void *)fp->fr_savpc; | |
199 | + /* next frame */ | |
200 | + fp=fp->fr_savfp; | |
201 | + } | |
202 | + return i; | |
203 | +} | |
204 | + | |
205 | +void backtrace_symbols_fd( void **buffer, int size, int fd ) | |
206 | +{ | |
207 | + FILE *fp = fdopen( fd, "w" ); | |
208 | + | |
209 | + if ( fp ) | |
210 | + { | |
211 | + void **pFramePtr; | |
212 | + | |
213 | + for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- ) | |
214 | + { | |
215 | + Dl_info dli; | |
216 | + ptrdiff_t offset; | |
217 | + | |
218 | + if ( 0 != dladdr( *pFramePtr, &dli ) ) | |
219 | + { | |
220 | + if ( dli.dli_fname && dli.dli_fbase ) | |
221 | + { | |
222 | + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase; | |
223 | + fprintf( fp, "%s+0x%x", dli.dli_fname, offset ); | |
224 | + } | |
225 | + if ( dli.dli_sname && dli.dli_saddr ) | |
226 | + { | |
227 | + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr; | |
228 | + fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset ); | |
229 | + } | |
230 | + } | |
231 | + fprintf( fp, "[0x%x]\n", *pFramePtr ); | |
232 | + } | |
233 | + | |
234 | + fflush( fp ); | |
235 | + fclose( fp ); | |
236 | + } | |
237 | +} | |
238 | + | |
239 | +#endif /* defined LINUX */ | |
240 | + | |
241 | +/* User functions for run-time dynamic loading. | |
242 | + Copyright (C) 1995-1999,2000,2001,2003 Free Software Foundation, Inc. | |
243 | + This file is part of the GNU C Library. | |
244 | + | |
245 | + The GNU C Library is free software; you can redistribute it and/or | |
246 | + modify it under the terms of the GNU Lesser General Public | |
247 | + License as published by the Free Software Foundation; either | |
248 | + version 2.1 of the License, or (at your option) any later version. | |
249 | + | |
250 | + The GNU C Library is distributed in the hope that it will be useful, | |
251 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
252 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
253 | + Lesser General Public License for more details. | |
254 | + | |
255 | + You should have received a copy of the GNU Lesser General Public | |
256 | + License along with the GNU C Library; if not, write to the Free | |
257 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
258 | + 02111-1307 USA. */ | |
259 | diff -u -r1.4 backtrace.h | |
260 | --- sal/osl/unx/backtrace.h 16 Jul 2003 17:20:38 -0000 1.4 | |
261 | +++ sal/osl/unx/backtrace.h 25 Aug 2003 11:32:03 -0000 | |
262 | @@ -60,7 +60,7 @@ | |
263 | ************************************************************************/ | |
264 | ||
265 | ||
266 | -#if defined (SOLARIS) || (FREEBSD) | |
267 | +#if defined (SOLARIS) || (FREEBSD) || (LINUX) | |
268 | ||
269 | #ifdef __cplusplus | |
270 | extern "C" { | |
271 | diff -u -r1.23 makefile.mk | |
272 | --- sal/osl/unx/makefile.mk 16 Jul 2003 17:21:01 -0000 1.23 | |
273 | +++ sal/osl/unx/makefile.mk 25 Aug 2003 11:32:03 -0000 | |
274 | @@ -137,7 +137,7 @@ | |
275 | $(OBJ)$/file_stat.obj | |
276 | #.ENDIF | |
277 | ||
278 | -.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" | |
279 | +.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" || "$(OS)$(CPU)"="LINUXS" | |
280 | SLOFILES += $(SLO)$/backtrace.obj | |
281 | OBJFILES += $(OBJ)$/backtrace.obj | |
282 | .ENDIF | |
283 | diff -u -r1.18.42.1 makefile.mk | |
284 | --- sc/util/makefile.mk 15 Aug 2003 11:52:48 -0000 1.18.42.1 | |
285 | +++ sc/util/makefile.mk 25 Aug 2003 11:32:25 -0000 | |
286 | @@ -83,7 +83,9 @@ | |
287 | .IF "$(OS)"=="IRIX" | |
288 | LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30 | |
289 | .ENDIF | |
290 | - | |
291 | +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" | |
292 | +DYNAMIC+=-Wl,--export-dynamic | |
293 | +.ENDIF | |
294 | # --- Resourcen ---------------------------------------------------- | |
295 | ||
296 | RESLIB1LIST=\ | |
297 | diff -u -r1.20.86.1 makefile.mk | |
298 | --- sd/util/makefile.mk 15 Aug 2003 11:50:45 -0000 1.20.86.1 | |
299 | +++ sd/util/makefile.mk 25 Aug 2003 11:32:45 -0000 | |
300 | @@ -84,6 +84,9 @@ | |
301 | LINKFLAGS+=/SEGMENTS:512 /PACKD:32768 | |
302 | .ENDIF | |
303 | ||
304 | +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" | |
305 | +DYNAMIC+=-Wl,--export-dynamic | |
306 | +.ENDIF | |
307 | # --- Resourcen ---------------------------------------------------- | |
308 | ||
309 | .IF "$(GUI)"=="WIN" | |
310 | diff -u -r1.24.104.1 makefile.mk | |
311 | --- sw/util/makefile.mk 15 Aug 2003 11:47:10 -0000 1.24.104.1 | |
312 | +++ sw/util/makefile.mk 25 Aug 2003 11:33:50 -0000 | |
313 | @@ -109,6 +109,10 @@ | |
314 | LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=40 | |
315 | .ENDIF | |
316 | ||
317 | +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" | |
318 | +DYNAMIC+=-Wl,--export-dynamic | |
319 | +.ENDIF | |
320 | + | |
321 | .IF "$(header)" == "" | |
322 | ||
323 | sw_res_files= \ | |
324 | ||
325 | --- boost/boost_1_27_0.patch.orig 2004-01-29 07:31:14.000000000 -0500 | |
326 | +++ boost/boost_1_27_0.patch 2004-01-29 10:20:21.869315000 -0500 | |
327 | @@ -202,10 +200,10 @@ | |
328 | + : "m" (pCount->aVal) | |
329 | + : "memory"); | |
330 | + | |
331 | -+ return nCount; | |
332 | -+ } | |
333 | ++ return nCount; | |
334 | ++} | |
335 | + | |
336 | -+ #elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc) | |
337 | ++#elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc) | |
338 | + | |
339 | + static __inline__ int atomic_inc(atomic_t * pCount) | |
340 | + { | |
341 | @@ -239,8 +237,8 @@ | |
342 | + : "r" (pCount), "m" (pCount->aVal) | |
343 | + : "cc"); | |
344 | + | |
345 | -+ return nCount; | |
346 | -+ } | |
347 | ++ return nCount; | |
348 | ++} | |
349 | + | |
350 | + | |
351 | +#elif defined(__s390__) |