--- solenv/inc/unxlngs.mk~ 2004-02-24 00:20:16.000000000 +0100 +++ solenv/inc/unxlngs.mk 2004-02-24 00:42:46.000000000 +0100 @@ -64,7 +64,7 @@ ASM=gcc AFLAGS=-Wa,-Av8plus,-K,PIC -c $(CDEFS) -SOLAR_JAVA=TRUE +SOLAR_JAVA= JAVAFLAGSDEBUG=-g # filter for supressing verbose messages from linker @@ -95,6 +96,15 @@ CFLAGS= .ENDIF CFLAGS+=-fmessage-length=0 -c $(INCLUDE) + +# flags to enable build with symbols; required for crashdump feature +.IF "$(ENABLE_SYMBOLS)"=="SMALL" +CFLAGSENABLESYMBOLS=-g1 +.ELSE +CFLAGSENABLESYMBOLS=-g +.ENDIF + + # flags for the C++ Compiler CFLAGSCC= -pipe # Flags for enabling exception handling @@ -129,10 +139,12 @@ CFLAGSDBGUTIL= # Compiler flags for enabling optimazations # CFLAGSOPT=-O2 +CFLAGSOPT=-O3 -fno-strict-aliasing +#CFLAGSOPT=-O2 -fno-strict-aliasing # reduce to -O1 to avoid optimisation problems -CFLAGSOPT=-O1 +#CFLAGSOPT=-O1 # Compiler flags for disabling optimazations -CFLAGSNOOPT= +CFLAGSNOOPT=-fno-strict-aliasing # Compiler flags for discibing the output path CFLAGSOUTOBJ=-o # Enable all warnings @@ -152,8 +164,10 @@ LINKFLAGS=-z combreloc $(LINKFLAGSRUNPATH) # linker flags for linking applications -LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec -LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec +#LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec +#LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec +LINKFLAGSAPPGUI= -Wl,--noinhibit-exec +LINKFLAGSAPPCUI= -Wl,--noinhibit-exec # linker flags for linking shared libraries LINKFLAGSSHLGUI= -shared diff -u -r1.7.10.2 makefile.mk --- crashrep/source/unx/makefile.mk 21 Aug 2003 09:46:32 -0000 1.7.10.2 +++ crashrep/source/unx/makefile.mk 25 Aug 2003 11:28:34 -0000 @@ -125,6 +125,9 @@ .IF "$(OS)" == "FREEBSD" APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11 .ENDIF +.IF "$(CPUNAME)$(OS)"=="SPARCLINUX" +APP2STDLIBS=$(STATIC) `pkg-config --libs gtk+-2.0` -lpng -lzlib -ljpeg -ltiff $(DYNAMIC) -lXext -lX11 -ldl -lnsl +.ENDIF .ENDIF # Building crash_report_static diff -u -r1.21 makefile.mk --- dbaccess/util/makefile.mk 15 Apr 2003 13:33:01 -0000 1.21 +++ dbaccess/util/makefile.mk 25 Aug 2003 11:28:40 -0000 @@ -76,6 +76,9 @@ LDUMP=ldump2.exe +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" +DYNAMIC+=-Wl,--export-dynamic +.ENDIF # --- database core (dba) ----------------------------------- LIB1TARGET=$(SLB)$/dbaccess.lib diff -u -r1.4 backtrace.c --- sal/osl/unx/backtrace.c 16 Jul 2003 17:20:28 -0000 1.4 +++ sal/osl/unx/backtrace.c 25 Aug 2003 11:32:03 -0000 @@ -81,11 +81,10 @@ #else -#error Unknown Solaris target platform. +#error Unknown Solaris target platform. #endif /* defined SPARC or INTEL */ - int backtrace( void **buffer, int max_frames ) { struct frame *fp; @@ -177,7 +176,7 @@ #include #include #include - + /* Need extra libs -lexc -ldwarf -lelf */ int backtrace( void **buffer, int max_frames ) @@ -188,13 +187,13 @@ memset(&context, 0, sizeof(struct sigcontext)); exc_setjmp(&context); - while(context.sc_pc != 1 && i < max_frames) { - exc_unwind(&context, 0); + while(context.sc_pc != 1 && i < max_frames) { + exc_unwind(&context, 0); if(context.sc_pc != 1) { *(buffer++) = (void *)context.sc_pc; i++; } - } + } return(i); } @@ -207,7 +206,7 @@ if ( fp ) { while(context.sc_pc!=1) { if(context.sc_pc != 1) { - exc_unwind_name(&context, 0, &name); + exc_unwind_name(&context, 0, &name); fprintf(fp, " 0x%012lx %.100s\n", context.sc_pc, name ? name : ""); free(name); } @@ -219,3 +218,125 @@ } #endif /* defined IRIX */ +#if defined(LINUX) +#if defined(SPARC) +#define FRAME_PTR_OFFSET 1 +#define FRAME_OFFSET 0 + +#else + +#error Unknown Linux target platform. +#endif /* defined SPARC or INTEL */ + +#include +#include +#include +#include "backtrace.h" +# define ptrdiff_t int + +typedef struct +{ + const char *dli_fname; /* File name of defining object. */ + void *dli_fbase; /* Load address of that object. */ + const char *dli_sname; /* Name of nearest symbol. */ + void *dli_saddr; /* Exact value of nearest symbol. */ +} Dl_info; + + + +struct frame { + long fr_local[8]; + long fr_arg[6]; + struct frame *fr_savfp; + long fr_savpc; +# ifndef __arch64__ + char *fr_stret; +# endif + long fr_argd[6]; + long fr_argx[0]; +}; + +/* http://gcc.gnu.org/ml/java-patches/2000-q2/msg00115.html */ + + +int backtrace( void **buffer, int max_frames ) +{ + struct frame *fp; + jmp_buf ctx; + int i; + + /* flush register windows */ +#ifdef SPARC + asm("ta 3"); +#endif + /* get stack- and framepointer */ + setjmp(ctx); + fp = (struct frame*)(((size_t*)(ctx))[FRAME_PTR_OFFSET]); + for ( i=0; (ifr_savfp; + + /* iterate through backtrace */ + for (i=0; fp && fp->fr_savpc && ifr_savpc; + /* next frame */ + fp=fp->fr_savfp; + } + return i; +} + +void backtrace_symbols_fd( void **buffer, int size, int fd ) +{ + FILE *fp = fdopen( fd, "w" ); + + if ( fp ) + { + void **pFramePtr; + + for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- ) + { + Dl_info dli; + ptrdiff_t offset; + + if ( 0 != dladdr( *pFramePtr, &dli ) ) + { + if ( dli.dli_fname && dli.dli_fbase ) + { + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase; + fprintf( fp, "%s+0x%x", dli.dli_fname, offset ); + } + if ( dli.dli_sname && dli.dli_saddr ) + { + offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr; + fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset ); + } + } + fprintf( fp, "[0x%x]\n", *pFramePtr ); + } + + fflush( fp ); + fclose( fp ); + } +} + +#endif /* defined LINUX */ + +/* User functions for run-time dynamic loading. + Copyright (C) 1995-1999,2000,2001,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ diff -u -r1.4 backtrace.h --- sal/osl/unx/backtrace.h 16 Jul 2003 17:20:38 -0000 1.4 +++ sal/osl/unx/backtrace.h 25 Aug 2003 11:32:03 -0000 @@ -60,7 +60,7 @@ ************************************************************************/ -#if defined (SOLARIS) || (FREEBSD) +#if defined (SOLARIS) || (FREEBSD) || (LINUX) #ifdef __cplusplus extern "C" { diff -u -r1.23 makefile.mk --- sal/osl/unx/makefile.mk 16 Jul 2003 17:21:01 -0000 1.23 +++ sal/osl/unx/makefile.mk 25 Aug 2003 11:32:03 -0000 @@ -137,7 +137,7 @@ $(OBJ)$/file_stat.obj #.ENDIF -.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" +.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" || "$(OS)$(CPU)"="LINUXS" SLOFILES += $(SLO)$/backtrace.obj OBJFILES += $(OBJ)$/backtrace.obj .ENDIF diff -u -r1.18.42.1 makefile.mk --- sc/util/makefile.mk 15 Aug 2003 11:52:48 -0000 1.18.42.1 +++ sc/util/makefile.mk 25 Aug 2003 11:32:25 -0000 @@ -83,7 +83,9 @@ .IF "$(OS)"=="IRIX" LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30 .ENDIF - +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" +DYNAMIC+=-Wl,--export-dynamic +.ENDIF # --- Resourcen ---------------------------------------------------- RESLIB1LIST=\ diff -u -r1.20.86.1 makefile.mk --- sd/util/makefile.mk 15 Aug 2003 11:50:45 -0000 1.20.86.1 +++ sd/util/makefile.mk 25 Aug 2003 11:32:45 -0000 @@ -84,6 +84,9 @@ LINKFLAGS+=/SEGMENTS:512 /PACKD:32768 .ENDIF +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" +DYNAMIC+=-Wl,--export-dynamic +.ENDIF # --- Resourcen ---------------------------------------------------- .IF "$(GUI)"=="WIN" diff -u -r1.24.104.1 makefile.mk --- sw/util/makefile.mk 15 Aug 2003 11:47:10 -0000 1.24.104.1 +++ sw/util/makefile.mk 25 Aug 2003 11:33:50 -0000 @@ -109,6 +109,10 @@ LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=40 .ENDIF +.IF "$(OS)$(CPUNAME)"=="LINUXSPARC" +DYNAMIC+=-Wl,--export-dynamic +.ENDIF + .IF "$(header)" == "" sw_res_files= \ --- boost/boost_1_27_0.patch.orig 2004-01-29 07:31:14.000000000 -0500 +++ boost/boost_1_27_0.patch 2004-01-29 10:20:21.869315000 -0500 @@ -202,10 +200,10 @@ + : "m" (pCount->aVal) + : "memory"); + -+ return nCount; -+ } ++ return nCount; ++} + -+ #elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc) ++#elif defined ( POWERPC ) || defined(__powerpc__) || defined (ppc) + + static __inline__ int atomic_inc(atomic_t * pCount) + { @@ -239,8 +237,8 @@ + : "r" (pCount), "m" (pCount->aVal) + : "cc"); + -+ return nCount; -+ } ++ return nCount; ++} + + +#elif defined(__s390__)