openbsd-ports/lang/gcc/4.7/patches/patch-boehm-gc_dyn_load_c
pascal f2b393605c Import gcc 4.7.
ok espie@
2012-04-23 15:56:40 +00:00

49 lines
1.7 KiB
Plaintext

$OpenBSD: patch-boehm-gc_dyn_load_c,v 1.1.1.1 2012/04/23 15:56:41 pascal Exp $
--- boehm-gc/dyn_load.c.orig Wed Jun 29 10:19:08 2011
+++ boehm-gc/dyn_load.c Mon Apr 2 16:34:32 2012
@@ -60,6 +60,7 @@
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
+ !(defined(OPENBSD) && defined(__ELF__)) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
--> We only know how to find data segments of dynamic libraries for the
@@ -99,9 +100,9 @@
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
+ (defined(OPENBSD) && defined(__ELF__)) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
# include <stddef.h>
-# include <elf.h>
# include <link.h>
#endif
@@ -115,7 +116,7 @@
# define ElfW(type) Elf64_##type
# endif
# else
-# ifdef NETBSD
+# if defined(NETBSD) || defined(OPENBSD)
# if ELFSIZE == 32
# define ElfW(type) Elf32_##type
# else
@@ -364,6 +365,7 @@ void GC_register_dynamic_libraries()
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
+ (defined(OPENBSD) && defined(__ELF__)) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
@@ -555,7 +557,7 @@ GC_bool GC_register_main_static_data()
/* 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>
/* for compatibility with 1.4.x */
# ifndef DT_DEBUG