View | Details | Raw Unified | Return to bug 242389
Collapse All | Expand All

(-)Makefile (-1 / +6 lines)
Lines 24-30 Link Here
24
BROKEN_mips64=	No ASM support
24
BROKEN_mips64=	No ASM support
25
BROKEN_mips=	No ASM support
25
BROKEN_mips=	No ASM support
26
26
27
USES=		cpe compiler:c11 gmake tar:xz
27
USES=		cpe gmake tar:xz
28
USE_GCC=	yes
28
USE_LDCONFIG=	yes
29
USE_LDCONFIG=	yes
29
CPE_VENDOR=	inria
30
CPE_VENDOR=	inria
30
HAS_CONFIGURE=	yes
31
HAS_CONFIGURE=	yes
Lines 101-106 Link Here
101
PLIST_SUB+=	PROF=""
102
PLIST_SUB+=	PROF=""
102
.endif
103
.endif
103
104
105
.if defined(PPC_ABI) && ${PPC_ABI} == ELFv2
106
EXTRA_PATCHES=	${PATCHDIR}/extra-patch-asmcomp_power_arch.ml
107
.endif
108
104
post-extract:
109
post-extract:
105
.if ${PORT_OPTIONS:MDOCS}
110
.if ${PORT_OPTIONS:MDOCS}
106
	@if ! (cd ${WRKDIR} && \
111
	@if ! (cd ${WRKDIR} && \
(-)files/extra-patch-asmcomp_power_arch.ml (+11 lines)
Line 0 Link Here
1
--- asmcomp/power/arch.ml.orig	2019-12-02 10:44:34 UTC
2
+++ asmcomp/power/arch.ml
3
@@ -28,7 +28,7 @@ type abi = ELF32 | ELF64v1 | ELF64v2
4
 let abi =
5
   match Config.model with
6
   | "ppc" -> ELF32
7
-  | "ppc64" -> ELF64v1
8
+  | "ppc64" -> ELF64v2
9
   | "ppc64le" -> ELF64v2
10
   | _ -> assert false
11
 
(-)files/patch-asmrun_power.S (+99 lines)
Line 0 Link Here
1
--- asmrun/power.S.orig	2019-12-02 12:34:04 UTC
2
+++ asmrun/power.S
3
@@ -13,7 +13,7 @@
4
 /*                                                                        */
5
 /**************************************************************************/
6
 
7
-#if defined(MODEL_ppc64le)
8
+#if _CALL_ELF == 2
9
         .abiversion 2
10
 #endif
11
 
12
@@ -42,7 +42,7 @@
13
 #define CALLBACK_LINK_SIZE 16
14
 #define CALLBACK_LINK_OFFSET 0
15
 #endif
16
-#if defined(MODEL_ppc64)
17
+#if _CALL_ELF == 1
18
 #define RESERVED_STACK 48
19
 #define PARAM_SAVE_AREA (8*8)
20
 #define LR_SAVE 16
21
@@ -54,7 +54,7 @@
22
 #define CALLBACK_LINK_SIZE 32
23
 #define CALLBACK_LINK_OFFSET 48
24
 #endif
25
-#if defined(MODEL_ppc64le)
26
+#if _CALL_ELF == 2
27
 #define RESERVED_STACK 32
28
 #define PARAM_SAVE_AREA 0
29
 #define LR_SAVE 16
30
@@ -82,7 +82,7 @@
31
 
32
 #endif
33
 
34
-#if defined(MODEL_ppc64)
35
+#if _CALL_ELF == 1
36
 #define FUNCTION(name) \
37
   .section ".opd","aw"; \
38
   .align 3; \
39
@@ -98,7 +98,7 @@
40
 
41
 #endif
42
 
43
-#if defined(MODEL_ppc64le)
44
+#if _CALL_ELF == 2
45
 #define FUNCTION(name) \
46
   .section ".text"; \
47
   .globl name; \
48
@@ -157,7 +157,7 @@
49
 
50
 #endif
51
 
52
-#if defined(MODEL_ppc64)
53
+#if _CALL_ELF == 1
54
         .section ".opd","aw"
55
 #else
56
         .section ".text"
57
@@ -338,14 +338,14 @@ FUNCTION(caml_c_call)
58
 #if defined(MODEL_ppc)
59
         mtctr   28
60
         bctrl
61
-#elif defined(MODEL_ppc64)
62
+#elif _CALL_ELF == 1
63
         ld      0, 0(28)
64
         mr      26, 2   /* save current TOC in a callee-save register */
65
         mtctr   0
66
         ld      2, 8(28)
67
         bctrl
68
         mr      2, 26   /* restore current TOC */
69
-#elif defined(MODEL_ppc64le)
70
+#elif _CALL_ELF == 2
71
         mtctr   28
72
         mr      12, 28
73
         mr      26, 2   /* save current TOC in a callee-save register */
74
@@ -514,14 +514,14 @@ FUNCTION(caml_start_program)
75
 #if defined(MODEL_ppc)
76
         mtctr   12
77
 .L105:  bctrl
78
-#elif defined(MODEL_ppc64)
79
+#elif _CALL_ELF == 1
80
         ld      0, 0(12)
81
         mtctr   0
82
         std     2, TOC_SAVE(1)
83
         ld      2, 8(12)
84
 .L105:  bctrl
85
         ld      2, TOC_SAVE(1)
86
-#elif defined(MODEL_ppc64le)
87
+#elif _CALL_ELF == 2
88
         mtctr   12
89
         std     2, TOC_SAVE(1)
90
 .L105:  bctrl
91
@@ -634,7 +634,7 @@ FUNCTION(caml_callback3_exn)
92
         b       .L102
93
 ENDFUNCTION(caml_callback3_exn)
94
 
95
-#if defined(MODEL_ppc64)
96
+#if _CALL_ELF == 1
97
         .section ".opd","aw"
98
 #else
99
         .section ".text"
(-)files/patch-byterun_caml_stack.h (+15 lines)
Line 0 Link Here
1
--- byterun/caml/stack.h.orig	2017-07-13 08:56:44 UTC
2
+++ byterun/caml/stack.h
3
@@ -40,10 +40,10 @@
4
 #if defined(MODEL_ppc)
5
 #define Saved_return_address(sp) *((intnat *)((sp) - 4))
6
 #define Callback_link(sp) ((struct caml_context *)((sp) + 16))
7
-#elif defined(MODEL_ppc64)
8
+#elif _CALL_ELF == 1
9
 #define Saved_return_address(sp) *((intnat *)((sp) + 16))
10
 #define Callback_link(sp) ((struct caml_context *)((sp) + (48 + 32)))
11
-#elif defined(MODEL_ppc64le)
12
+#elif _CALL_ELF == 2
13
 #define Saved_return_address(sp) *((intnat *)((sp) + 16))
14
 #define Callback_link(sp) ((struct caml_context *)((sp) + (32 + 32)))
15
 #else
(-)files/patch-testsuite_tests_asmcomp_power.S (+62 lines)
Line 0 Link Here
1
--- testsuite/tests/asmcomp/power.S.orig	2019-12-02 12:36:28 UTC
2
+++ testsuite/tests/asmcomp/power.S
3
@@ -26,11 +26,11 @@
4
 #define RESERVED_STACK 16
5
 #define LR_SAVE_AREA 4
6
 #endif
7
-#if defined(MODEL_ppc64)
8
+#if _CALL_ELF == 1
9
 #define RESERVED_STACK 48
10
 #define LR_SAVE_AREA 16
11
 #endif
12
-#if defined(MODEL_ppc64le)
13
+#if _CALL_ELF == 2
14
 #define RESERVED_STACK 32
15
 #define LR_SAVE_AREA 16
16
 #endif
17
@@ -46,7 +46,7 @@
18
   name:
19
 #endif
20
 
21
-#if defined(MODEL_ppc64)
22
+#if _CALL_ELF == 1
23
 #define FUNCTION(name) \
24
   .section ".opd","aw"; \
25
   .align 3; \
26
@@ -58,7 +58,7 @@
27
   .L.name:
28
 #endif
29
 
30
-#if defined(MODEL_ppc64le)
31
+#if _CALL_ELF == 2
32
 #define FUNCTION(name) \
33
   .section ".text"; \
34
   .globl name; \
35
@@ -118,11 +118,11 @@ FUNCTION(call_gen_code)
36
     /* Get function pointer in CTR */
37
 #if defined(MODEL_ppc)
38
         mtctr   3
39
-#elif defined(MODEL_ppc64)
40
+#elif _CALL_ELF == 1
41
         ld      0, 0(3)
42
         mtctr   0
43
         ld      2, 8(3)
44
-#elif defined(MODEL_ppc64le)
45
+#elif _CALL_ELF == 2
46
         mtctr   3
47
         mr      12, 3
48
 #else
49
@@ -184,11 +184,11 @@ FUNCTION(caml_c_call)
50
     /* Jump to C function (address in r28) */
51
 #if defined(MODEL_ppc)
52
         mtctr   28
53
-#elif defined(MODEL_ppc64)
54
+#elif _CALL_ELF == 1
55
         ld      0, 0(28)
56
         mtctr   0
57
         ld      2, 8(28)
58
-#elif defined(MODEL_ppc64le)
59
+#elif _CALL_ELF == 2
60
         mtctr   28
61
         mr      12, 28
62
 #else

Return to bug 242389