summaryrefslogtreecommitdiff
path: root/lang/parrot/patches/patch-ab
blob: 0abce3717e3b08b2674e310938004c911f06fcb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$NetBSD: patch-ab,v 1.7 2009/04/20 07:55:00 he Exp $

The R_PPC_ADDR16{HI,LO} constants are named something else on
NetBSD, and might be elsewhere.
Also add workarounds for NetBSD/powerpc 3.x, which has some
constants defined as enums.

--- src/exec_save.c.orig	2009-03-08 21:32:43.000000000 +0100
+++ src/exec_save.c	2009-04-19 12:55:25.000000000 +0200
@@ -150,6 +150,26 @@
 #    include <elf.h>
 #  endif
 
+#  if defined(PARROT_PPC)
+#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+         defined(R_PPC_16_HI) && defined(R_PPC_16_LO)
+#      define	R_PPC_ADDR16_HI	R_PPC_16_HI
+#      define	R_PPC_ADDR16_LO	R_PPC_16_LO
+#    endif
+     /*
+      * NetBSD/powerpc 3.x and OpenBSD/powerpc doesn't define these constants,
+      * but instead has them as enums, so add some workarounds for those.
+      */
+#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+         (defined(__NetBSD__) || defined(__OpenBSD__))
+#      define	R_PPC_ADDR16_HI RELOC_16_HI
+#      define	R_PPC_ADDR16_LO RELOC_16_LO
+#    endif
+#    if !defined(R_PPC_REL24) && (defined(__NetBSD__) || defined(__OpenBSD__))
+#      define	R_PPC_REL24	RELOC_REL24
+#    endif
+#  endif /* PARROT_PPC */
+
 /* Add a section to the file
  *
  * n = Name