svn commit: r545786 - head/lang/ocaml/files
Niclas Zeising
zeising at FreeBSD.org
Sat Aug 22 21:32:37 UTC 2020
Author: zeising
Date: Sat Aug 22 21:32:36 2020
New Revision: 545786
URL: https://svnweb.freebsd.org/changeset/ports/545786
Log:
lang/ocaml: Fix build with llvm 11
Fix the build of lang/ocaml with llvm 11.
There are two issues, first off, te issue with -fno-common, which is default
with llvm 11. This is fixed by pulling in a modified patch from upstream,
as well as local patches.
Secondly, there's a problem with how asm sections are handled, patch this
locally. Thanks to dim@ for help with this.
MFH: 2020Q3 (implicit, -fno-common fixes, ok by joenum)
Added:
head/lang/ocaml/files/patch-675e98a2.c (contents, props changed)
head/lang/ocaml/files/patch-asmrun_amd64.S (contents, props changed)
head/lang/ocaml/files/patch-byterun_backtrace.c (contents, props changed)
Added: head/lang/ocaml/files/patch-675e98a2.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lang/ocaml/files/patch-675e98a2.c Sat Aug 22 21:32:36 2020 (r545786)
@@ -0,0 +1,48 @@
+--- asmrun/startup.c.orig 2017-07-13 08:56:44 UTC
++++ asmrun/startup.c
+@@ -44,8 +44,8 @@
+ #endif
+
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
++struct ext_table caml_code_fragments_table;
+
+ /* Initialize the atom table and the static data and code area limits. */
+
+--- byterun/caml/intext.h.orig 2017-07-13 08:56:44 UTC
++++ byterun/caml/intext.h
+@@ -196,7 +196,7 @@ struct code_fragment {
+
+ CAMLextern struct code_fragment * caml_extern_find_code(char *addr);
+
+-struct ext_table caml_code_fragments_table;
++extern struct ext_table caml_code_fragments_table;
+
+ #endif /* CAML_INTERNALS */
+
+--- byterun/caml/major_gc.h.orig 2017-07-13 08:56:44 UTC
++++ byterun/caml/major_gc.h
+@@ -64,9 +64,9 @@ extern uintnat total_heap_size;
+ extern char *caml_gc_sweep_hp;
+
+ extern int caml_major_window;
+-double caml_major_ring[Max_major_window];
+-int caml_major_ring_index;
+-double caml_major_work_credit;
++extern double caml_major_ring[Max_major_window];
++extern int caml_major_ring_index;
++extern double caml_major_work_credit;
+ extern double caml_gc_clock;
+
+ /* [caml_major_gc_hook] is called just between the end of the mark
+--- byterun/fix_code.c.orig 2017-07-13 08:56:44 UTC
++++ byterun/fix_code.c
+@@ -38,6 +38,7 @@
+ code_t caml_start_code;
+ asize_t caml_code_size;
+ unsigned char * caml_saved_code;
++struct ext_table caml_code_fragments_table;
+
+ /* Read the main bytecode block from a file */
+
Added: head/lang/ocaml/files/patch-asmrun_amd64.S
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lang/ocaml/files/patch-asmrun_amd64.S Sat Aug 22 21:32:36 2020 (r545786)
@@ -0,0 +1,11 @@
+--- asmrun/amd64.S.orig 2020-08-22 20:02:29 UTC
++++ asmrun/amd64.S
+@@ -725,7 +725,7 @@ G(caml_system__spacetime_shapes):
+ #elif defined(SYS_mingw64) || defined(SYS_cygwin)
+ .section .rdata,"dr"
+ #else
+- .section .rodata.cst8,"a", at progbits
++ .section .rodata.cst8,"aM", at progbits,8
+ #endif
+ .globl G(caml_negf_mask)
+ .align SIXTEEN_ALIGN
Added: head/lang/ocaml/files/patch-byterun_backtrace.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lang/ocaml/files/patch-byterun_backtrace.c Sat Aug 22 21:32:36 2020 (r545786)
@@ -0,0 +1,12 @@
+--- byterun/backtrace.c.orig 2020-08-22 14:46:44 UTC
++++ byterun/backtrace.c
+@@ -27,9 +27,6 @@
+ #include "caml/backtrace_prim.h"
+ #include "caml/fail.h"
+
+-/* The table of debug information fragments */
+-struct ext_table caml_debug_info;
+-
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+ CAMLexport backtrace_slot * caml_backtrace_buffer = NULL;
More information about the svn-ports-head
mailing list