add powerpc support, mostly related to ELF.

This commit is contained in:
brad 2002-03-10 07:44:43 +00:00
parent f331347981
commit e710bfd4c3
3 changed files with 92 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.39 2002/02/04 15:05:32 naddy Exp $
# $OpenBSD: Makefile,v 1.40 2002/03/10 07:44:43 brad Exp $
ONLY_FOR_ARCHS= i386 sparc m68k
ONLY_FOR_ARCHS= i386 sparc m68k powerpc
COMMENT= "pager/text-based web browser"
@ -46,7 +46,9 @@ DOCS= FAQ.html HISTORY MANUAL.html \
README README.dict README.func STORY.html \
keymap.default keymap.lynx menu.default menu.submenu
PATCH_LIST= patch-configure
PATCH_LIST= patch-configure \
patch-gc_include_private_gcconfig_h \
patch-gc_dyn_load_c
.if ${FLAVOR:L:Mimage}
. if !${FLAVOR:L:Mm17n}

View File

@ -0,0 +1,53 @@
OpenBSD$
--- gc/dyn_load.c.orig Wed Dec 19 19:37:29 2001
+++ gc/dyn_load.c Sun Mar 10 02:30:27 2002
@@ -57,7 +57,9 @@
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
- !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD)
+ !(defined(NETBSD) && defined(__ELF__)) && \
+ !(defined(OPENBSD) && defined(__ELF__)) && \
+ !defined(HURD)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -248,7 +250,9 @@ void GC_register_dynamic_libraries()
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || \
- (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
+ (defined(NETBSD) && defined(__ELF__)) || \
+ (defined(OPENBSD) && defined(__ELF__)) || \
+ defined(HURD)
#ifdef USE_PROC_FOR_LIBRARIES
@@ -429,14 +433,14 @@ static char *parse_map_entry(char *buf_p
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
/* versions. Thanks to Jakub Jelinek for most of the code. */
-#include <stddef.h>
-#include <elf.h>
-#include <link.h>
-
# if defined(LINUX) /* Are others OK here, too? */ \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+#include <stddef.h>
+#include <elf.h>
+#include <link.h>
+
/* We have the header files for a glibc that includes dl_iterate_phdr. */
/* It may still not be available in the library on the target system. */
/* Thus we also treat it as a weak symbol. */
@@ -507,7 +511,7 @@ GC_bool GC_register_dynamic_libraries_dl
/* This doesn't necessarily work in all cases, e.g. with preloaded
* dynamic libraries. */
-#if defined(NETBSD)
+#if defined(NETBSD) || defined(OPENBSD)
# include <sys/exec_elf.h>
#else
# include <elf.h>

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-gc_include_private_gcconfig_h,v 1.1 2002/03/10 07:44:44 brad Exp $
--- gc/include/private/gcconfig.h.orig Sun Mar 10 01:52:20 2002
+++ gc/include/private/gcconfig.h Sun Mar 10 01:58:59 2002
@@ -49,10 +49,14 @@
# define HP
# define mach_type_known
# endif
-# if defined(OPENBSD) && defined(m68k)
+# if defined(OPENBSD) && defined(__m68k__)
# define M68K
# define mach_type_known
# endif
+# if defined(OPENBSD) && defined(__powerpc__)
+# define POWERPC
+# define mach_type_known
+# endif
# if defined(OPENBSD) && defined(__sparc__)
# define SPARC
# define mach_type_known
@@ -673,6 +677,14 @@
# ifdef NETBSD
# define ALIGNMENT 4
# define OS_TYPE "NETBSD"
+# define HEURISTIC2
+ extern char etext;
+# define DATASTART GC_data_start
+# define DYNAMIC_LOADING
+# endif
+# ifdef OPENBSD
+# define ALIGNMENT 4
+# define OS_TYPE "OPENBSD"
# define HEURISTIC2
extern char etext;
# define DATASTART GC_data_start