summaryrefslogtreecommitdiff
path: root/lang/ocaml/patches
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2017-10-10 12:10:05 +0000
committerhe <he@pkgsrc.org>2017-10-10 12:10:05 +0000
commit9ae6b2599ba30d7003de92523a3e1c6d510efce5 (patch)
treec4b8eaa25f645875796dc03f14a00f18aa9299d6 /lang/ocaml/patches
parent262bf15ca9076c66830e7276a13242dbece80660 (diff)
downloadpkgsrc-9ae6b2599ba30d7003de92523a3e1c6d510efce5.tar.gz
Apply the required fixes to make this work again on NetBSD/powerpc.
A similar set of changes has been sent upstream. OK by jaapb@
Diffstat (limited to 'lang/ocaml/patches')
-rw-r--r--lang/ocaml/patches/patch-asmrun_signals__osdep.h70
-rw-r--r--lang/ocaml/patches/patch-configure61
-rw-r--r--lang/ocaml/patches/patch-testsuite_tests_lib-dynlink-native_Makefile16
-rw-r--r--lang/ocaml/patches/patch-testsuite_tests_tool-ocamldoc-man_Makefile24
4 files changed, 141 insertions, 30 deletions
diff --git a/lang/ocaml/patches/patch-asmrun_signals__osdep.h b/lang/ocaml/patches/patch-asmrun_signals__osdep.h
index 2b0a75fc471..4eb9f0830aa 100644
--- a/lang/ocaml/patches/patch-asmrun_signals__osdep.h
+++ b/lang/ocaml/patches/patch-asmrun_signals__osdep.h
@@ -1,21 +1,34 @@
-$NetBSD: patch-asmrun_signals__osdep.h,v 1.1 2017/07/11 17:15:02 he Exp $
+$NetBSD: patch-asmrun_signals__osdep.h,v 1.2 2017/10/10 12:10:05 he Exp $
Provide necessary glue to do this on NetBSD/powerpc.
---- asmrun/signals_osdep.h.orig 2016-11-04 16:08:24.000000000 +0000
+--- asmrun/signals_osdep.h.orig 2017-07-13 08:56:44.000000000 +0000
+++ asmrun/signals_osdep.h
-@@ -154,6 +154,26 @@
- #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15])
- #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+@@ -303,27 +303,30 @@
+ #define CONTEXT_YOUNG_PTR (context->regs->gpr[31])
+ #define CONTEXT_SP (context->regs->gpr[1])
+-/****************** s390x, ELF (Linux) */
+-#elif defined(TARGET_s390x) && defined(SYS_elf)
+/****************** PowerPC, NetBSD */
-+
-+#elif defined(TARGET_power) && defined (__NetBSD__)
-+
+
+- #define DECLARE_SIGNAL_HANDLER(name) \
+- static void name(int sig, struct sigcontext * context)
++#elif defined(TARGET_power) && defined (SYS_netbsd)
+
+- #define SET_SIGACT(sigact,name) \
+- sigact.sa_handler = (void (*)(int)) (name); \
+- sigact.sa_flags = 0
+ #include <ucontext.h>
+ #define DECLARE_SIGNAL_HANDLER(name) \
+ static void name(int sig, siginfo_t * info, ucontext_t * context)
-+
+
+- typedef unsigned long context_reg;
+- #define CONTEXT_PC (context->sregs->regs.psw.addr)
+- #define CONTEXT_EXCEPTION_POINTER (context->sregs->regs.gprs[13])
+- #define CONTEXT_YOUNG_LIMIT (context->sregs->regs.gprs[10])
+- #define CONTEXT_YOUNG_PTR (context->sregs->regs.gprs[11])
+- #define CONTEXT_SP (context->sregs->regs.gprs[15])
+ #define SET_SIGACT(sigact,name) \
+ sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \
+ sigact.sa_flags = SA_SIGINFO
@@ -25,18 +38,39 @@ Provide necessary glue to do this on NetBSD/powerpc.
+ #define CONTEXT_YOUNG_PTR (context->uc_mcontext.__gregs[_REG_R31])
+ #define CONTEXT_SP (_UC_MACHINE_SP(context))
+ #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
-+
+
+-/****************** PowerPC, BSD */
+/* #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.CONTEXT_REG(r30)) */
+
- /****************** I386, Linux */
++/****************** PowerPC, other BSDs */
- #elif defined(TARGET_i386) && defined(SYS_linux_elf)
-@@ -287,7 +307,7 @@
+ #elif defined(TARGET_power) && \
+- (defined(SYS_bsd) || defined(SYS_bsd_elf) || defined(SYS_netbsd))
++ (defined(SYS_bsd) || defined(SYS_bsd_elf))
- /****************** PowerPC, ELF (Linux) */
+ #define DECLARE_SIGNAL_HANDLER(name) \
+ static void name(int sig, int code, struct sigcontext * context)
+@@ -339,6 +342,23 @@
+ #define CONTEXT_YOUNG_PTR (context->sc_frame.fixreg[31])
+ #define CONTEXT_SP (context->sc_frame.fixreg[1])
--#elif defined(TARGET_power) && defined(SYS_elf)
-+#elif defined(TARGET_power) && defined(SYS_elf) && !defined(__NetBSD__)
++/****************** s390x, ELF (Linux) */
++#elif defined(TARGET_s390x) && defined(SYS_elf)
++
++ #define DECLARE_SIGNAL_HANDLER(name) \
++ static void name(int sig, struct sigcontext * context)
++
++ #define SET_SIGACT(sigact,name) \
++ sigact.sa_handler = (void (*)(int)) (name); \
++ sigact.sa_flags = 0
++
++ typedef unsigned long context_reg;
++ #define CONTEXT_PC (context->sregs->regs.psw.addr)
++ #define CONTEXT_EXCEPTION_POINTER (context->sregs->regs.gprs[13])
++ #define CONTEXT_YOUNG_LIMIT (context->sregs->regs.gprs[10])
++ #define CONTEXT_YOUNG_PTR (context->sregs->regs.gprs[11])
++ #define CONTEXT_SP (context->sregs->regs.gprs[15])
++
+ /****************** SPARC, Solaris */
- #define DECLARE_SIGNAL_HANDLER(name) \
- static void name(int sig, struct sigcontext * context)
+ #elif defined(TARGET_sparc) && defined(SYS_solaris)
diff --git a/lang/ocaml/patches/patch-configure b/lang/ocaml/patches/patch-configure
index 607ae79f7dd..4b632a69bb7 100644
--- a/lang/ocaml/patches/patch-configure
+++ b/lang/ocaml/patches/patch-configure
@@ -1,9 +1,18 @@
-$NetBSD: patch-configure,v 1.24 2017/09/08 09:12:44 jaapb Exp $
+$NetBSD: patch-configure,v 1.25 2017/10/10 12:10:05 he Exp $
All kinds of OS-specific changes to configure
---- configure.orig 2016-11-04 16:08:24.000000000 +0000
+--- configure.orig 2017-07-13 08:56:44.000000000 +0000
+++ configure
+@@ -359,7 +359,7 @@ mkexe="\$(BYTECC)"
+ mkexedebugflag="-g"
+ bytecccompopts=""
+ byteccprivatecompopts=""
+-bytecclinkopts=""
++bytecclinkopts=" -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib"
+ ostype="Unix"
+ exe=""
+ iflexdir=""
@@ -764,7 +764,10 @@ if test $with_sharedlibs = "yes"; then
*gcc*)
sharedcccompopts="-fPIC"
@@ -48,7 +57,7 @@ All kinds of OS-specific changes to configure
i386-*-gnu0.3) natdynlink=true;;
i[3456]86-*-haiku*) natdynlink=true;;
arm*-*-linux*) natdynlink=true;;
-@@ -891,6 +893,7 @@ case "$target" in
+@@ -901,6 +903,7 @@ case "$target" in
sparc*-*-gnu*) arch=sparc; system=gnu;;
i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;;
i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;;
@@ -56,7 +65,7 @@ All kinds of OS-specific changes to configure
i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
i[3456]86-*-solaris*) if $arch64; then
arch=amd64; system=solaris
-@@ -900,6 +903,7 @@ case "$target" in
+@@ -910,6 +913,7 @@ case "$target" in
i[3456]86-*-haiku*) arch=i386; system=beos;;
i[3456]86-*-beos*) arch=i386; system=beos;;
i[3456]86-*-cygwin*) arch=i386; system=cygwin;;
@@ -64,7 +73,16 @@ All kinds of OS-specific changes to configure
i[3456]86-*-darwin*) if $arch64; then
arch=amd64; system=macosx
else
-@@ -937,6 +941,7 @@ case "$target" in
+@@ -921,7 +925,7 @@ case "$target" in
+ powerpc*-*-linux*) arch=power;
+ if $arch64; then model=ppc64; else model=ppc; fi
+ system=elf;;
+- powerpc-*-netbsd*) arch=power; model=ppc; system=elf;;
++ powerpc-*-netbsd*) arch=power; model=ppc; system=netbsd;;
+ powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;;
+ s390x*-*-linux*) arch=s390x; model=z10; system=elf;;
+ armv6*-*-linux-gnueabihf) arch=arm; model=armv6; system=linux_eabihf;;
+@@ -947,6 +951,7 @@ case "$target" in
x86_64-*-mingw*) arch=amd64; system=mingw;;
aarch64-*-linux*) arch=arm64; system=linux;;
x86_64-*-cygwin*) arch=amd64; system=cygwin;;
@@ -72,7 +90,16 @@ All kinds of OS-specific changes to configure
esac
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
-@@ -973,7 +978,6 @@ case "$arch,$nativecc,$system,$model" in
+@@ -974,7 +979,7 @@ fi
+ nativecccompopts="$bytecccompopts"
+ nativeccprivatecompopts="$byteccprivatecompopts"
+ nativeccprofopts=''
+-nativecclinkopts=''
++nativecclinkopts="-L/usr/lib -R/usr/lib -R/usr/pkg/lib"
+ # FIXME the naming of nativecclinkopts is broken: these are options for
+ # ld (for shared libs), not for cc
+ nativeccrpath="$byteccrpath"
+@@ -983,7 +988,6 @@ case "$arch,$nativecc,$system,$model" in
*,*,nextstep,*) nativecclinkopts="-posix";;
*,*,rhapsody,*) if $arch64; then partialld="ld -r -arch ppc64"; fi;;
amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";;
@@ -80,7 +107,7 @@ All kinds of OS-specific changes to configure
power,gcc*,elf,ppc) partialld="ld -r -m elf32ppclinux";;
power,gcc*,elf,ppc64) partialld="ld -r -m elf64ppc";;
power,gcc*,elf,ppc64le) partialld="ld -r -m elf64lppc";;
-@@ -991,8 +995,8 @@ case "$arch,$system" in
+@@ -1001,8 +1005,8 @@ case "$arch,$system" in
fi;;
amd64,solaris) as="${TOOLPREF}as --64"
aspp="${TOOLPREF}gcc -m64 -c";;
@@ -91,16 +118,26 @@ All kinds of OS-specific changes to configure
power,elf) if $arch64; then
as="${TOOLPREF}as -a64 -mppc64"
aspp="${TOOLPREF}gcc -m64 -c"
-@@ -1048,6 +1052,8 @@ case "$arch,$system" in
+@@ -1023,7 +1027,7 @@ case "$arch,$system" in
+ aspp="${TOOLPREF}cc -c";;
+ *,freebsd) as="${TOOLPREF}as"
+ aspp="${TOOLPREF}cc -c";;
+- amd64,*|arm,*|arm64,*|i386,*|power,bsd*|sparc,*)
++ amd64,*|arm,*|arm64,*|i386,*|power,bsd*|power,netbsd|sparc,*)
+ as="${TOOLPREF}as"
+ case "$ccfamily" in
+ clang-*)
+@@ -1058,6 +1062,9 @@ case "$arch,$system" in
arm,linux*) profiling='true';;
power,elf) profiling='true';;
power,bsd*) profiling='true';;
++ power,netbsd) profiling='true';;
+ *,*,dragonfly) profiling='true';;
+ amd64,solaris) profiling='true';;
*) profiling='false';;
esac
-@@ -1642,6 +1648,8 @@ fi
+@@ -1652,6 +1659,8 @@ fi
x11_include="not found"
x11_link="not found"
@@ -109,7 +146,7 @@ All kinds of OS-specific changes to configure
if test -z "$x11_include_dir" -a -z "$x11_lib_dir"; then
if pkg-config --exists x11 2>/dev/null; then
x11_include=`pkg-config --cflags x11`
-@@ -1688,6 +1696,7 @@ if test "$x11_include" = "not found"; th
+@@ -1698,6 +1707,7 @@ if test "$x11_include" = "not found"; th
/usr/XFree86/include/X11 \
\
/usr/include \
@@ -117,7 +154,7 @@ All kinds of OS-specific changes to configure
/usr/local/include \
/usr/unsupported/include \
/usr/athena/include \
-@@ -1745,6 +1754,7 @@ if test "$x11_include" = "not found"; th
+@@ -1755,6 +1765,7 @@ if test "$x11_include" = "not found"; th
\
/usr/lib64 \
/usr/lib \
@@ -125,7 +162,7 @@ All kinds of OS-specific changes to configure
/usr/local/lib \
/usr/unsupported/lib \
/usr/athena/lib \
-@@ -1766,19 +1776,16 @@ if test "$x11_include" = "not found"; th
+@@ -1776,19 +1787,16 @@ if test "$x11_include" = "not found"; th
if test $dir = /usr/lib; then
x11_link="-lX11"
else
diff --git a/lang/ocaml/patches/patch-testsuite_tests_lib-dynlink-native_Makefile b/lang/ocaml/patches/patch-testsuite_tests_lib-dynlink-native_Makefile
new file mode 100644
index 00000000000..1291bb4ca98
--- /dev/null
+++ b/lang/ocaml/patches/patch-testsuite_tests_lib-dynlink-native_Makefile
@@ -0,0 +1,16 @@
+$NetBSD: patch-testsuite_tests_lib-dynlink-native_Makefile,v 1.1 2017/10/10 12:10:05 he Exp $
+
+Fix apparently erroneous feature test, this stuff depends
+on "native dynamic linking" support.
+
+--- testsuite/tests/lib-dynlink-native/Makefile.orig 2017-07-13 08:56:45.000000000 +0000
++++ testsuite/tests/lib-dynlink-native/Makefile
+@@ -23,7 +23,7 @@ LD_PATH = $(TOPDIR)/otherlibs/$(UNIXLIBV
+
+ .PHONY: default
+ default:
+- @if ! $(SUPPORTS_SHARED_LIBRARIES) || $(BYTECODE_ONLY) ; then \
++ @if ! $(NATDYNLINK) || $(BYTECODE_ONLY) ; then \
+ echo " ... testing 'main' => skipped"; \
+ else \
+ $(SET_LD_PATH) $(MAKE) all; \
diff --git a/lang/ocaml/patches/patch-testsuite_tests_tool-ocamldoc-man_Makefile b/lang/ocaml/patches/patch-testsuite_tests_tool-ocamldoc-man_Makefile
new file mode 100644
index 00000000000..1a14ae7230f
--- /dev/null
+++ b/lang/ocaml/patches/patch-testsuite_tests_tool-ocamldoc-man_Makefile
@@ -0,0 +1,24 @@
+$NetBSD: patch-testsuite_tests_tool-ocamldoc-man_Makefile,v 1.3 2017/10/10 12:10:05 he Exp $
+
+After one of our other local patches, output lands in a different
+file than what this make job expects. Follow suit.
+
+--- testsuite/tests/tool-ocamldoc-man/Makefile.orig 2016-11-04 16:08:24.000000000 +0000
++++ testsuite/tests/tool-ocamldoc-man/Makefile
+@@ -39,7 +39,7 @@ run: *.mli
+ F="`basename $$file .mli`"; \
+ $(OCAMLDOC) $(DOCFLAGS) -hide-warnings -man $ \
+ -o index $$file; \
+- tail -n +2 $$F.3o > $$F.result; \
++ tail -n +2 $$F.3 > $$F.result; \
+ $(DIFF) $$F.reference $$F.result >/dev/null \
+ && echo " => passed" || echo " => failed"; \
+ done
+@@ -49,6 +49,6 @@ promote: defaultpromote
+
+ .PHONY: clean
+ clean: defaultclean
+- @rm -f *.result *.html *.tex *.log *.out *.sty *.toc *.css *.aux *.3o
++ @rm -f *.result *.html *.tex *.log *.out *.sty *.toc *.css *.aux *.3
+
+ include $(BASEDIR)/makefiles/Makefile.common