This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb-970817 vs i386-pc-solaris2.5.1


GDB is not supported on ix86/solaris, and I do not have access
to a ix86/solaris system, so I can't comment on the first two patches.
(I suspect however that a better solution would be to create a new
config/i386/tm-i386sol2.h file, which gets used by i386sol2.mt, includes
tm-i386v4.h and adds the TIDGET definition from config/sparc/tm-sun4sol2.h).

The linker problem happens if you use gcc and the native ld.
A simple workaround for now is to remove
-Xlinker -export-dynamic
by hand from the INTERNAL_LDFLAGS in gdb/Makefile.

> Hi,
> 
> I have the misfortune to run solaris2.5.1 on my nice dual P200 Vectra.
> I tried to build gdb-970817 using this version of egcs:
> 
>   Reading specs from /p/lib/gcc-lib/i386-pc-solaris2.5.1/egcs-2.90.06/specs
>   gcc version egcs-2.90.06 970907 (gcc2-970802 experimental)
> 
> My first compile failed because neither R_PSR nor PS_FLAG_CARRY was defined.
> Here's a kludge to work around that.
> 
> --- procfs.c.orig	Sat Sep 27 12:22:02 1997
> +++ procfs.c	Sat Sep 27 12:21:50 1997
> @@ -5218,6 +5218,7 @@ procfs_lwp_creation_handler (pi, syscall
>    /* If lwp_create failed, then nothing interesting happened.  Continue the
>       process and go back to sleep. */
>  
> +#if defined (R_PSR) && defined (PS_FLAG_CARRY)
>    if (pi->prstatus.pr_reg[R_PSR] & PS_FLAG_CARRY)
>      {				/* _lwp_create failed */
>        pi->prrun.pr_flags &= PRSTEP;
> @@ -5228,6 +5229,7 @@ procfs_lwp_creation_handler (pi, syscall
>  
>        return 0;
>      }
> +#endif
>  
>    /* At this point, the new thread is stopped at it's first instruction, and
>       the parent is stopped at the exit from lwp_create.  */
> 
> 
> Next attempt failed because TIDGET is not defined and hence,
> procfs_pid_to_str (used below) is not defined.  Here's the really ugly
> kludge I used to work around that.
> 
> --- sol-thread.c.orig	Sat Sep 27 12:21:09 1997
> +++ sol-thread.c	Sat Sep 27 12:20:38 1997
> @@ -121,7 +121,11 @@ static int sol_thread_alive PARAMS ((int
>  #define THREAD_FLAG 0x80000000
>  #define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
>  #define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
> +#ifdef TIDGET
>  #define GET_LWP(LWP_ID) (TIDGET(LWP_ID))
> +#else
> +# define GET_LWP(LWP_ID) 1 /* Kludge!! */
> +#endif
>  #define GET_THREAD(THREAD_ID) (((THREAD_ID) >> 16) & 0x7fff)
>  #define BUILD_LWP(LWP_ID, PID) ((LWP_ID) << 16 | (PID))
>  #define BUILD_THREAD(THREAD_ID, PID) (THREAD_FLAG | BUILD_LWP (THREAD_ID, PID))
> @@ -1213,9 +1217,11 @@ solaris_pid_to_str (pid)
>  {
>    static char buf[100];
>  
> +#ifdef TIDGET
>    /* in case init failed to resolve the libthread_db library */
>    if (!procfs_suppress_run)
>      return procfs_pid_to_str (pid);
> +#endif
>  
>    if (is_thread (pid))
>      {
> 
> Finally, I got this (inexplicable to me) link error:
> 
>   ...
>   te.o main.o inflow.o gnu-regex.o     ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a ../libiberty/libiberty.a -ltermlib    -ldl -lm ../mmalloc/libmmalloc.a ../libiberty/libiberty.a
>   ld: fatal: entry point symbol `xport-dynamic' is undefined
>   collect2: ld returned 1 exit status
>   make[1]: *** [gdb] Error 1
>   make[1]: Leaving directory `/tmp/gdb-970817/gdb'
>   make: *** [all-gdb] Error 2
>   [Exit 2]
> 
> 


-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de