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
5 AFLAGS=-Wa,-Av8plus,-K,PIC -c $(CDEFS)
11 # filter for supressing verbose messages from linker
15 CFLAGS+=-fmessage-length=0 -c $(INCLUDE)
17 +# flags to enable build with symbols; required for crashdump feature
18 +.IF "$(ENABLE_SYMBOLS)"=="SMALL"
19 +CFLAGSENABLESYMBOLS=-g1
21 +CFLAGSENABLESYMBOLS=-g
25 # flags for the C++ Compiler
27 # Flags for enabling exception handling
30 # Compiler flags for enabling optimazations
32 +CFLAGSOPT=-O3 -fno-strict-aliasing
33 +#CFLAGSOPT=-O2 -fno-strict-aliasing
34 # reduce to -O1 to avoid optimisation problems
37 # Compiler flags for disabling optimazations
39 +CFLAGSNOOPT=-fno-strict-aliasing
40 # Compiler flags for discibing the output path
44 LINKFLAGS=-z combreloc $(LINKFLAGSRUNPATH)
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
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
60 .IF "$(OS)" == "FREEBSD"
61 APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11
63 +.IF "$(CPUNAME)$(OS)"=="SPARCLINUX"
64 +APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11 -ldl -lnsl
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
76 +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC"
77 +DYNAMIC+=-Wl,--export-dynamic
79 # --- database core (dba) -----------------------------------
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
89 -#error Unknown Solaris target platform.
90 +#error Unknown Solaris target platform.
92 #endif /* defined SPARC or INTEL */
95 int backtrace( void **buffer, int max_frames )
99 #include <exception.h>
100 #include <sys/signal.h>
104 /* Need extra libs -lexc -ldwarf -lelf */
106 int backtrace( void **buffer, int max_frames )
107 @@ -188,13 +187,13 @@
108 memset(&context, 0, sizeof(struct sigcontext));
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;
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>");
133 @@ -219,3 +218,125 @@
135 #endif /* defined IRIX */
139 +#define FRAME_PTR_OFFSET 1
140 +#define FRAME_OFFSET 0
144 +#error Unknown Linux target platform.
145 +#endif /* defined SPARC or INTEL */
147 +#include <pthread.h>
150 +#include "backtrace.h"
151 +# define ptrdiff_t int
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. */
166 + struct frame *fr_savfp;
175 +/* http://gcc.gnu.org/ml/java-patches/2000-q2/msg00115.html */
178 +int backtrace( void **buffer, int max_frames )
184 + /* flush register windows */
188 + /* get stack- and framepointer */
190 + fp = (struct frame*)(((size_t*)(ctx))[FRAME_PTR_OFFSET]);
191 + for ( i=0; (i<FRAME_OFFSET) && (fp!=0); i++)
194 + /* iterate through backtrace */
195 + for (i=0; fp && fp->fr_savpc && i<max_frames; i++)
198 + *(buffer++) = (void *)fp->fr_savpc;
205 +void backtrace_symbols_fd( void **buffer, int size, int fd )
207 + FILE *fp = fdopen( fd, "w" );
213 + for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- )
218 + if ( 0 != dladdr( *pFramePtr, &dli ) )
220 + if ( dli.dli_fname && dli.dli_fbase )
222 + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
223 + fprintf( fp, "%s+0x%x", dli.dli_fname, offset );
225 + if ( dli.dli_sname && dli.dli_saddr )
227 + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
228 + fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset );
231 + fprintf( fp, "[0x%x]\n", *pFramePtr );
239 +#endif /* defined LINUX */
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.
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.
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.
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
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
263 ************************************************************************/
266 -#if defined (SOLARIS) || (FREEBSD)
267 +#if defined (SOLARIS) || (FREEBSD) || (LINUX)
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
275 $(OBJ)$/file_stat.obj
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
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
288 LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30
291 +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC"
292 +DYNAMIC+=-Wl,--export-dynamic
294 # --- Resourcen ----------------------------------------------------
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
301 LINKFLAGS+=/SEGMENTS:512 /PACKD:32768
304 +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC"
305 +DYNAMIC+=-Wl,--export-dynamic
307 # --- Resourcen ----------------------------------------------------
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
314 LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=40
317 +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC"
318 +DYNAMIC+=-Wl,--export-dynamic
321 .IF "$(header)" == ""
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)
336 -+ #elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc)
337 ++#elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc)
339 + static __inline__ int atomic_inc(atomic_t * pCount)
342 + : "r" (pCount), "m" (pCount->aVal)
351 +#elif defined(__s390__)