pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fixing lang/ocaml for NetBSD/powerpc?



Hi,

I've noticed that lang/ocaml fails to build for NetBSD/macppc 4.0
with the following build failure:

gcc -O2 -I/usr/include -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE 
-DTARGET_power -DSYS_elf  -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT 
-DDB_DBM_HSEARCH -I/usr/include  -c -o signals_asm.o signals_asm.c
signals_asm.c: In function 'handle_signal':
signals_asm.c:87: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:87: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:88: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c: In function 'trap_handler':
signals_asm.c:160: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:161: error: 'struct sigcontext' has no member named 'regs'
gmake[1]: *** [signals_asm.o] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/lang/ocaml/work/ocaml-3.10.2/asmrun'
gmake: *** [runtimeopt] Error 2
*** Error code 2

The attached patch gets the package compiling, however, it misses
a number of files when it's installed (see list of "complaints"
as the second attachment), and I've not been able to figure out
what causes that.

As can be seen from the patch below, we fall into the "SYS_elf"
branch up until now used only for Linux, with the result that I
had to add some ifdefs in there.  The if'ed code is liberally
adapted from the FreeBSD code in the following section in the
file (can you say "cargo cult"? :)

The package itself does not appear to contain any self-tests, and
since I've never actually used this packge myself, I don't know
if the result even works as it should.  Testing and further input
is therefore hereby solicitated.

(I just picked this one up because this package being broken
resulted in 36 other packages being skipped in my latest pkgsrc
bulk build for NetBSD/powerpc 4.0...)

Regards,

- Håvard
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ocaml/distinfo,v
retrieving revision 1.43
diff -u -p -r1.43 distinfo
--- distinfo    25 Apr 2008 07:13:39 -0000      1.43
+++ distinfo    18 Jan 2009 15:58:09 -0000
@@ -37,3 +37,4 @@ SHA1 (patch-br) = c26f18532d3756188eb9c7
 SHA1 (patch-bs) = 8554ef37cdeac1998978adc74a9c709a84cccb92
 SHA1 (patch-bt) = a1b9034f3034712bbedab51aed430285ca02ee5e
 SHA1 (patch-bu) = df80c076248e1ad1ab6eae195bda724ea354a55e
+SHA1 (patch-bv) = 595641bb079174f393e420bdf5c48fe8ca1912cf
--- /dev/null   2009-01-18 16:46:48.000000000 +0100
+++ patches/patch-bv    2009-01-18 16:46:48.000000000 +0100
@@ -0,0 +1,38 @@
+$NetBSD$
+
+--- ./asmrun/signals_osdep.h.orig      2007-11-26 17:58:51.000000000 +0100
++++ ./asmrun/signals_osdep.h
+@@ -158,10 +158,9 @@
+   #define CONTEXT_SP (CONTEXT_STATE.CONTEXT_REG(r1))
+   #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+ 
+-/****************** PowerPC, ELF (Linux) */
++/****************** PowerPC, ELF (Linux | NetBSD) */
+ 
+ #elif defined(TARGET_power) && defined(SYS_elf)
+-
+   #define DECLARE_SIGNAL_HANDLER(name) \
+     static void name(int sig, struct sigcontext * context)
+ 
+@@ -169,11 +168,21 @@
+      sigact.sa_handler = (void (*)(int)) (name); \
+      sigact.sa_flags = 0
+ 
++ #ifdef __NetBSD__
++  typedef register_t context_reg;
++  #define CONTEXT_PC (context->sc_frame.srr0)
++  #define CONTEXT_EXCEPTION_POINTER (context->sc_frame.fixreg[29])
++  #define CONTEXT_YOUNG_LIMIT (context->sc_frame.fixreg[30])
++  #define CONTEXT_YOUNG_PTR (context->sc_frame.fixreg[31])
++
++ #else
++
+   typedef unsigned long context_reg;
+   #define CONTEXT_PC (context->regs->nip)
+   #define CONTEXT_EXCEPTION_POINTER (context->regs->gpr[29])
+   #define CONTEXT_YOUNG_LIMIT (context->regs->gpr[30])
+   #define CONTEXT_YOUNG_PTR (context->regs->gpr[31])
++ #endif /* __NetBSD__ */
+ 
+ /****************** PowerPC, BSD */
+ 
pkg_create: can't stat `/usr/pkg/lib/ocaml/arg.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/array.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/arrayLabels.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/buffer.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/callback.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/camlinternalMod.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/camlinternalOO.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/char.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/complex.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/digest.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/filename.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/format.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/gc.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/genlex.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/hashtbl.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/int32.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/int64.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/lazy.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/lexing.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/list.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/listLabels.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/map.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/marshal.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/moreLabels.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/nativeint.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/obj.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/oo.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/parsing.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/pervasives.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/printexc.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/printf.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/queue.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/random.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/scanf.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/set.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/sort.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/stack.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/stdLabels.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/stream.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/string.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/stringLabels.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/sys.p.cmx'
pkg_create: can't stat `/usr/pkg/lib/ocaml/weak.p.cmx'


Home | Main Index | Thread Index | Old Index