Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo undefined
@ 2008-10-31 17:57 Klaus Zeitler
  2008-11-01  1:19 ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Klaus Zeitler @ 2008-10-31 17:57 UTC (permalink / raw)
  To: gdb-patches

The CVS version of gdb gives the following error for a Solaris 5.8 build:

gcc -g -O2      \
                -o gdb gdb.o libgdb.a \
                   ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a -lintl ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a     -ldl -lncurses -lz -lsocket -lnsl -lm   ../libiberty/libiberty.a  gnulib/libgnu.a
Undefined                       first referenced
 symbol                             in file
elfcore_write_prpsinfo              libgdb.a(procfs.o)
elfcore_write_prstatus              libgdb.a(procfs.o)
ld: fatal: Symbol referencing errors. No output written to gdb
collect2: ld returned 1 exit status
make[2]: *** [gdb] Error 1
make[2]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-cvs/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-cvs'
make: *** [all] Error 2
ERROR: gdb: make


I noticed that these 2 functions are defined in elf.c.
They are enclosed there with:
#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
but the function calls in procfs.c are not.

I'm not sure if any of the 2 defines HAVE_PRPSINFO_T or HAVE_PSINFO_T
should be set for Solaris 5.8 (I guess I'd have to understand the code
in the configure script), but I think that the calls in procfs.c
need the same #ifs as in elf.c.

I enclosed the 2 function calls in procfs.c also with
#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
and was able to build (and run) gdb.


Klaus

-- 
 -----------------------------------------------------
|  Klaus Zeitler      Between a rock and a hard place |
|  Email:             kzeitler@alcatel-lucent.com     |
 -----------------------------------------------------
---
If you think nobody cares if you're alive, try missing
a couple of car payments.               -- Earl Wilson


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo undefined
  2008-10-31 17:57 CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo undefined Klaus Zeitler
@ 2008-11-01  1:19 ` Joel Brobecker
  2008-11-01 22:18   ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2008-11-01  1:19 UTC (permalink / raw)
  To: Klaus Zeitler; +Cc: gdb-patches

> Undefined                       first referenced
>  symbol                             in file
> elfcore_write_prpsinfo              libgdb.a(procfs.o)
> elfcore_write_prstatus              libgdb.a(procfs.o)
> ld: fatal: Symbol referencing errors. No output written to gdb

I can reproduce. Looks like a problem in the bfd configure script,
as the following check returns "no":

  AC_CHECK_HEADERS(sys/procfs.h)

Extract from the config.log file:

  configure:19338: checking for sys/procfs.h
  configure:19343: result: no

Not much information there. In any case, as a result, the checks
for the various types in procfs.h are skipped:

    BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
    BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t)
    [...]
    BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
    [etc]

And so HAVE_PRPSINFO_T doesn't get defined as it should.

I have to run, now. I will look deeper into this hopefully tomorrow.

-- 
Joel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo undefined
  2008-11-01  1:19 ` Joel Brobecker
@ 2008-11-01 22:18   ` Joel Brobecker
  2008-11-01 23:31     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2008-11-01 22:18 UTC (permalink / raw)
  To: Klaus Zeitler; +Cc: gdb-patches

> > Undefined                       first referenced
> >  symbol                             in file
> > elfcore_write_prpsinfo              libgdb.a(procfs.o)
> > elfcore_write_prstatus              libgdb.a(procfs.o)
> > ld: fatal: Symbol referencing errors. No output written to gdb
> 
> I can reproduce. Looks like a problem in the bfd configure script,
> as the following check returns "no":
> 
>   AC_CHECK_HEADERS(sys/procfs.h)

Pedro reminded me that he actually had already seen the problem:
http://sourceware.org/ml/gdb-patches/2008-10/msg00283.html.

The problem is that _FILE_OFFSET_BITS is being defined to 64
in order to provide the capability of handling "large files".
The problem is that procfs on solaris clearly does not work
with the large-file environment activated. The error message
is pretty clear about that, I think:

 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #error  "Cannot use procfs in the large file compilation environment"
 #endif

This problem was introduced when we started using the AC_SYS_LARGEFILES
macro (patch checked in Sep 11). The work-around is to configure GDB
with --disable-largefile.

I'm not sure what the optimal fix should be. Looks like we cannot have
the two features at the same time on Solaris (I checked version 8, 9
and 10, both sparc and x86). To me, the simplest is to deactivate
AC_SYS_LARGEFILES in bfd for Solaris hosts (unless configured with
--enable-largefile perhaps?).

An alternative is to conditionalize the code in GDB that uses
elfcore_write_prpsinfo and elfcore_write_prstatus. GDB would
then build again, but I think that GDB would then generate core
files which would be missing some pieces that it used to contain.
So I'm not keen on this approach.

Any other suggestion?

-- 
Joel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo  undefined
  2008-11-01 22:18   ` Joel Brobecker
@ 2008-11-01 23:31     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-11-01 23:31 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Klaus Zeitler, gdb-patches

On Sat, Nov 01, 2008 at 03:17:48PM -0700, Joel Brobecker wrote:
> Any other suggestion?

This is clearly a bfd problem - I suggest redirecting the discussion
to the binutils list.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-01 23:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-31 17:57 CVS build for Solaris 5.8 fails: elfcore_write_prpsinfo undefined Klaus Zeitler
2008-11-01  1:19 ` Joel Brobecker
2008-11-01 22:18   ` Joel Brobecker
2008-11-01 23:31     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox