openbsd-ports/lang/llvm-gcc4/patches/patch-boehm-gc_dyn_load_c
sthen cb6a8938ed Import llvm-gcc4, not yet linked to the build. This is a work in
progress, largely based on the gcc port in ports/lang/gcc/4.2.
Requested by jsg@.

It's somewhat usable on i386 (shared lib versions not yet properly
under control). Build on amd64 currently fails with -fPIC problems.

-- --
lvm-gcc is the LLVM C front end. It is a modified version of gcc
that compiles C/C++/ObjC programs into native objects, LLVM bitcode or
LLVM assembly language, depending upon the options.

By default, llvm-gcc compiles to native objects just like GCC does.
If the -emit-llvm option is given then it will generate LLVM bitcode
files instead. If -S (assembly) is also given, then it will generate
LLVM assembly.

Being derived from the GNU Compiler Collection, llvm-gcc has many of
gcc's features and accepts most of gcc's options. It handles a number
of gcc's extensions to the C programming language.
<sthen@zephyr:/usr/ports/mystuff/lang/llvm-gcc4:9>$CVS: ----------------------------------------------------------------------
2009-06-22 22:37:31 +00:00

49 lines
1.8 KiB
Plaintext

$OpenBSD: patch-boehm-gc_dyn_load_c,v 1.1.1.1 2009/06/22 22:37:32 sthen Exp $
--- boehm-gc/dyn_load.c.orig Mon Sep 18 14:45:08 2006
+++ boehm-gc/dyn_load.c Thu Jan 29 17:20:51 2009
@@ -57,6 +57,7 @@
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
+ !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
--> We only know how to find data segments of dynamic libraries for the
@@ -87,9 +88,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
@@ -103,7 +104,7 @@
# define ElfW(type) Elf64_##type
# endif
# else
-# ifdef NETBSD
+# if defined(NETBSD) || defined(OPENBSD)
# if ELFSIZE == 32
# define ElfW(type) Elf32_##type
# else
@@ -298,6 +299,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)
@@ -481,7 +483,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