This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/RFA] fix hpux build problems
- From: Randolph Chung <randolph at tausq dot org>
- To: gdb-patches at sources dot redhat dot com
- Cc: dave at hiauly1 dot hia dot nrc dot ca
- Date: Fri, 12 Nov 2004 17:40:15 -0800
- Subject: [patch/RFA] fix hpux build problems
- Reply-to: Randolph Chung <randolph at tausq dot org>
This patch fixes several build errors with the hpux targets, and tries to
sort out the host/target dependencies so that we can eventually do cross-builds.
Compile and lightly tested with:
--host=hppa2.0w-hp-hpux11.11 --target=hppa2.0w-hp-hpux11.11 (SOM)
--host=hppa64-hp-hpux11.11 --target=hppa64-hp-hpux11.11 (ELF)
These two cross targets don't work at the moment (do we care?):
--host=hppa2.0w-hp-hpux11.11 --target=hppa64-hp-hpux11.11
* this might work, but i don't have a proper toolchain to test
it. There may be problems with pa64solib.o.
--host=hppa64-hp-hpux11.11 --target=hppa-elf
* only hppa64 has elf support, but hppa*-elf selects a 32-bit bfd
target in libbfd.
ok?
randolph
2004-11-12 Randolph Chung <tausq@debian.org>
* pa64solib.c (pa64_solib_thread_start_addr): Rename from
so_lib_thread_start_addr.
* pa64solib.h (so_list): Forward declare.
(pa64_solib_thread_start_addr): Prototype.
* somsolib.c (SHL_LOAD, SHL_UNLOAD): Define if not already defined.
(no_shared_libraries): Remove.
(som_solib_thread_start_addr): Rename from so_lib_thread_start_addr.
* somsolib.h (som_solib_thread_start_addr): Likewise; prototype.
* hpread.c (hpread_process_one_debug_symbol): Use either the som or
the elf solib handler to find the start address.
* config/pa/hppahpux.mh (NATDEPFILES): Move target-specific support
files to the target makefile.
* config/pa/hpux1020.mh (NATDEPFILES): Likewise.
* config/pa/hpux11.mh (NATDEPFILES): Likewise.
* config/pa/hpux11w.mh (NATDEPFILES): Likewise.
* config/pa/hppa64.mt (TDEPFILES): Put target-specific support files for
symbol reading and shared library handling here.
* config/pa/hppahpux.mt (TDEPFILES): Likewise. Define PA_SOM_ONLY so
we can build a 32-bit SOM only target without bringing in 64-bit
support.
Index: hpread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpread.c,v
retrieving revision 1.53
diff -u -p -r1.53 hpread.c
--- hpread.c 23 Oct 2004 16:18:08 -0000 1.53
+++ hpread.c 13 Nov 2004 00:53:47 -0000
@@ -5779,8 +5779,14 @@ hpread_process_one_debug_symbol (union d
* where to look for this variable, using a call-back
* to interpret the private shared-library data.
*/
- SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
- so_lib_thread_start_addr (so);
+ if (bfd_get_flavour(objfile->obfd) == bfd_target_som_flavour)
+ SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
+ som_solib_thread_start_addr (so);
+#ifndef PA_SOM_ONLY
+ else
+ SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
+ pa64_solib_thread_start_addr (so);
+#endif
}
}
break;
Index: pa64solib.h
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.h,v
retrieving revision 1.4
diff -u -p -r1.4 pa64solib.h
--- pa64solib.h 1 Nov 2001 16:17:08 -0000 1.4
+++ pa64solib.h 13 Nov 2004 00:53:48 -0000
@@ -22,6 +22,7 @@
struct target_ops;
struct objfile;
struct section_offsets;
+struct so_list;
/* Called to add symbols from a shared library to gdb's symbol table. */
@@ -147,3 +148,5 @@ extern char *pa64_solib_address (CORE_AD
/* If ADDR lies in a shared library, return its name. */
#define PC_SOLIB(addr) pa64_solib_address (addr)
+
+CORE_ADDR pa64_solib_thread_start_addr (struct so_list *so);
Index: somsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.c,v
retrieving revision 1.37
diff -u -p -r1.37 somsolib.c
--- somsolib.c 11 Sep 2004 10:24:51 -0000 1.37
+++ somsolib.c 13 Nov 2004 00:53:48 -0000
@@ -51,6 +51,14 @@
#define O_BINARY 0
#endif
+#ifndef SHL_LOAD
+#define SHL_LOAD 4
+#endif
+
+#ifndef SHL_UNLOAD
+#define SHL_UNLOAD 8
+#endif
+
/* Uncomment this to turn on some debugging output.
*/
@@ -1557,25 +1565,6 @@ som_solib_restart (void)
}
-/* LOCAL FUNCTION
-
- no_shared_libraries -- handle command to explicitly discard symbols
- from shared libraries.
-
- DESCRIPTION
-
- Implements the command "nosharedlibrary", which discards symbols
- that have been auto-loaded from shared libraries. Symbols from
- shared libraries that were added by explicit request of the user
- are not discarded. Also called from remote.c. */
-
-void
-no_shared_libraries (char *ignored, int from_tty)
-{
- /* FIXME */
-}
-
-
void
_initialize_som_solib (void)
{
@@ -1621,7 +1610,7 @@ threshold in megabytes. Is ignored when
/* Get some HPUX-specific data from a shared lib.
*/
CORE_ADDR
-so_lib_thread_start_addr (struct so_list *so)
+som_solib_thread_start_addr (struct so_list *so)
{
return so->som_solib.tsd_start_addr;
}
Index: somsolib.h
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.h,v
retrieving revision 1.7
diff -u -p -r1.7 somsolib.h
--- somsolib.h 29 Mar 2003 23:29:47 -0000 1.7
+++ somsolib.h 13 Nov 2004 00:53:48 -0000
@@ -171,7 +171,7 @@ extern char *som_solib_address (CORE_ADD
extern CORE_ADDR som_solib_get_solib_by_pc (CORE_ADDR addr);
struct so_list;
-extern CORE_ADDR so_lib_thread_start_addr (struct so_list *so);
+extern CORE_ADDR som_solib_thread_start_addr (struct so_list *so);
extern void no_shared_libraries (char *ignored, int from_tty);
Index: config/pa/hppa64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppa64.mt,v
retrieving revision 1.4
diff -u -p -r1.4 hppa64.mt
--- config/pa/hppa64.mt 13 Sep 2004 20:55:41 -0000 1.4
+++ config/pa/hppa64.mt 13 Nov 2004 00:53:48 -0000
@@ -1,3 +1,3 @@
# Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
-TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o pa64solib.o somsolib.o somread.o hpread.o solib.o
DEPRECATED_TM_FILE= tm-hppa64.h
Index: config/pa/hppahpux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppahpux.mh,v
retrieving revision 1.5
diff -u -p -r1.5 hppahpux.mh
--- config/pa/hppahpux.mh 5 Aug 2004 19:25:49 -0000 1.5
+++ config/pa/hppahpux.mh 13 Nov 2004 00:53:48 -0000
@@ -1,6 +1,6 @@
# Host: Hewlett-Packard PA-RISC machine, running HPUX
NAT_FILE= nm-hppah.h
-NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
+NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infptrace.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
Index: config/pa/hppahpux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppahpux.mt,v
retrieving revision 1.3
diff -u -p -r1.3 hppahpux.mt
--- config/pa/hppahpux.mt 13 Sep 2004 20:55:41 -0000 1.3
+++ config/pa/hppahpux.mt 13 Nov 2004 00:53:48 -0000
@@ -1,3 +1,4 @@
# Target: HP PA-RISC running hpux
-TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o
+MT_CFLAGS = -DPA_SOM_ONLY=1
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o somread.o hpread.o somsolib.o solib.o
DEPRECATED_TM_FILE= tm-hppah.h
Index: config/pa/hpux1020.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux1020.mh,v
retrieving revision 1.7
diff -u -p -r1.7 hpux1020.mh
--- config/pa/hpux1020.mh 18 Sep 2004 18:45:57 -0000 1.7
+++ config/pa/hpux1020.mh 13 Nov 2004 00:53:48 -0000
@@ -7,6 +7,6 @@
MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah.h
-NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infptrace.o somread.o hpread.o somsolib.o
+NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infptrace.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
Index: config/pa/hpux11.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux11.mh,v
retrieving revision 1.7
diff -u -p -r1.7 hpux11.mh
--- config/pa/hpux11.mh 18 Sep 2004 18:45:57 -0000 1.7
+++ config/pa/hpux11.mh 13 Nov 2004 00:53:48 -0000
@@ -7,6 +7,6 @@
MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah11.h
-NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o somread.o hpread.o somsolib.o
+NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
Index: config/pa/hpux11w.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux11w.mh,v
retrieving revision 1.8
diff -u -p -r1.8 hpux11w.mh
--- config/pa/hpux11w.mh 18 Sep 2004 18:45:57 -0000 1.8
+++ config/pa/hpux11w.mh 13 Nov 2004 00:53:48 -0000
@@ -7,6 +7,6 @@
MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah11.h
-NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o hpread.o pa64solib.o solib.o
+NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/