caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Bytecode run on AIX - "unknown C primitive" error
@ 2010-01-19 20:31 Dawid Toton
  2010-01-20  9:20 ` [Caml-list] " Christoph Bauer
  0 siblings, 1 reply; 8+ messages in thread
From: Dawid Toton @ 2010-01-19 20:31 UTC (permalink / raw)
  To: caml-list

I have installed part of this OCaml port
http://home.arcor.de/chr_bauer/ocaml-aix.html
on a computer running on AIX. It seems that everything built correctly 
except ocamlopt. So I have ocamlrun and standard library and this should 
be enough for bytecode to run.

I have to build the bytecode on a different machine (because it's 
difficult to do on AIX). I believe this shouldn't induce any problems.

Trivial bytecode executes correctly regardless where it is created.

I set LIBPATH to point to ocaml/stublibs and try running some bytecode 
uning Unix module. This results in:
Fatal error: unknown C primitive `unix_getsockopt_bool'

If I compile simple "let _ = Unix.sleep 1" on the target machine, I get 
bytecode that causes ocamlrun to crash with:
Illegal instruction (core dumped)

Does anybody have an idea for workaround? Some understanding what's 
going on?

I'm using AIX 5.3

Dawid


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Bytecode run on AIX - "unknown C primitive" error
  2010-01-19 20:31 Bytecode run on AIX - "unknown C primitive" error Dawid Toton
@ 2010-01-20  9:20 ` Christoph Bauer
  2010-01-20 10:07   ` Sylvain Le Gall
  2010-01-20 18:18   ` [Caml-list] " Dawid Toton
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Bauer @ 2010-01-20  9:20 UTC (permalink / raw)
  To: Dawid Toton, caml-list

unfortunatly I haven't a solution for the bytecode stuff. I only use
ocaml with native compiled code. This works very well.

Christoph Bauer

> From: caml-list-bounces@yquem.inria.fr 
> [mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of Dawid Toton
> Sent: Tuesday, January 19, 2010 9:32 PM
> To: caml-list@yquem.inria.fr
> Subject: [Caml-list] Bytecode run on AIX - "unknown C primitive" error
> 
> I have installed part of this OCaml port 
> http://home.arcor.de/chr_bauer/ocaml-aix.html
> on a computer running on AIX. It seems that everything built 
> correctly except ocamlopt. So I have ocamlrun and standard 
> library and this should be enough for bytecode to run.
> 
> I have to build the bytecode on a different machine (because 
> it's difficult to do on AIX). I believe this shouldn't induce 
> any problems.
> 
> Trivial bytecode executes correctly regardless where it is created.
> 
> I set LIBPATH to point to ocaml/stublibs and try running some 
> bytecode uning Unix module. This results in:
> Fatal error: unknown C primitive `unix_getsockopt_bool'
> 
> If I compile simple "let _ = Unix.sleep 1" on the target 
> machine, I get bytecode that causes ocamlrun to crash with:
> Illegal instruction (core dumped)
> 
> Does anybody have an idea for workaround? Some understanding 
> what's going on?
> 
> I'm using AIX 5.3
> 
> Dawid
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bytecode run on AIX - "unknown C primitive" error
  2010-01-20  9:20 ` [Caml-list] " Christoph Bauer
@ 2010-01-20 10:07   ` Sylvain Le Gall
  2010-01-20 10:36     ` [Caml-list] " Christoph Bauer
  2010-01-20 18:18   ` [Caml-list] " Dawid Toton
  1 sibling, 1 reply; 8+ messages in thread
From: Sylvain Le Gall @ 2010-01-20 10:07 UTC (permalink / raw)
  To: caml-list

On 20-01-2010, Christoph Bauer <christoph.bauer@lmsintl.com> wrote:
> unfortunatly I haven't a solution for the bytecode stuff. I only use
> ocaml with native compiled code. This works very well.
>

I confirm that ocamlopt/AIX works well (thanks to Christoph). 

The best solution is maybe to understand why ocamlopt cannot be built ?

Regards
Sylvain Le Gall

> Christoph Bauer
>
>> From: caml-list-bounces@yquem.inria.fr 
>> [mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of Dawid Toton
>> Sent: Tuesday, January 19, 2010 9:32 PM
>> To: caml-list@yquem.inria.fr
>> Subject: [Caml-list] Bytecode run on AIX - "unknown C primitive" error
>> 
>> I have installed part of this OCaml port 
>> http://home.arcor.de/chr_bauer/ocaml-aix.html
>> on a computer running on AIX. It seems that everything built 
>> correctly except ocamlopt. So I have ocamlrun and standard 
>> library and this should be enough for bytecode to run.
>> 
>> I have to build the bytecode on a different machine (because 
>> it's difficult to do on AIX). I believe this shouldn't induce 
>> any problems.
>> 
>> Trivial bytecode executes correctly regardless where it is created.
>> 
>> I set LIBPATH to point to ocaml/stublibs and try running some 
>> bytecode uning Unix module. This results in:
>> Fatal error: unknown C primitive `unix_getsockopt_bool'
>> 
>> If I compile simple "let _ = Unix.sleep 1" on the target 
>> machine, I get bytecode that causes ocamlrun to crash with:
>> Illegal instruction (core dumped)
>> 
>> Does anybody have an idea for workaround? Some understanding 
>> what's going on?
>> 
>> I'm using AIX 5.3
>> 
>> Dawid
>> 
>> _______________________________________________
>> Caml-list mailing list. Subscription management:
>> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>> Archives: http://caml.inria.fr
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>> 

Regards,
Sylvain Le Gall


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Re: Bytecode run on AIX - "unknown C primitive" error
  2010-01-20 10:07   ` Sylvain Le Gall
@ 2010-01-20 10:36     ` Christoph Bauer
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Bauer @ 2010-01-20 10:36 UTC (permalink / raw)
  To: Sylvain Le Gall, caml-list

> I confirm that ocamlopt/AIX works well (thanks to Christoph). 
> 
> The best solution is maybe to understand why ocamlopt cannot 
> be built ?

It's a long time since I worked on that. 

I suspected that ld, didn't export all needed symbols. 
Playing with linker flags didn't help.

With an older version (3.09.3) I also cannot load unix.cma.
I get this error message:

  Cannot load required shared library dllunix.
  Reason: dynamic loading not supported on this platform.

So in config/s.h I defined for 3.11.0

#define SUPPORT_DYNAMIC_LINKING

and tried to fix the compiler/linker flags in config/Makefile.
The linker is called with -bexpall, but as you can see, it doesn't solve the
case.

Regards,
Christoph Bauer

Ceterum censeo Ocaml 3.11.2 Issue #4844, #4034 et #4644 includam esse

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Bytecode run on AIX - "unknown C primitive" error
  2010-01-20  9:20 ` [Caml-list] " Christoph Bauer
  2010-01-20 10:07   ` Sylvain Le Gall
@ 2010-01-20 18:18   ` Dawid Toton
  2010-01-22 11:24     ` Christoph Bauer
  1 sibling, 1 reply; 8+ messages in thread
From: Dawid Toton @ 2010-01-20 18:18 UTC (permalink / raw)
  To: caml-list


> unfortunatly I haven't a solution for the bytecode stuff. I only use
> ocaml with native compiled code. This works very well.
>   
Native code would also be sufficient (to save me from translating lot of 
code to C).

The problem is that the assembler available on AIX doesn't unserstand 
power-aix.S:

as  -o power-aix.o power-aix.S
Assembler:
power-aix.S: line 103: 1252-023 The symbol .caml_garbage_collection is 
not defined.
power-aix.S: line 103: 1252-087 The target of the branch instruction
        must be a relocatable or external expression.
power-aix.S: line 457: 1252-023 The symbol caml_young_limit is not defined.
power-aix.S: line 457: 1252-040 The specified expression is not valid.
        Make sure that all symbols are defined.
        Check the rules on symbols used in an arithmetic expression
        concerning relocation.
...... (many similar messages)

How have you obtained running ocamlopt?

Dawid


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Bytecode run on AIX - "unknown C primitive" error
  2010-01-20 18:18   ` [Caml-list] " Dawid Toton
@ 2010-01-22 11:24     ` Christoph Bauer
  2010-01-27 15:10       ` [Caml-list] OCaml on AIX Dawid Toton
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Bauer @ 2010-01-22 11:24 UTC (permalink / raw)
  To: Dawid Toton, caml-list


> The problem is that the assembler available on AIX doesn't unserstand
> power-aix.S:
> 
> as  -o power-aix.o power-aix.S
> Assembler:
> power-aix.S: line 103: 1252-023 The symbol 
> .caml_garbage_collection is not defined.
> power-aix.S: line 103: 1252-087 The target of the branch instruction
>         must be a relocatable or external expression.
> power-aix.S: line 457: 1252-023 The symbol caml_young_limit 
> is not defined.
> power-aix.S: line 457: 1252-040 The specified expression is not valid.
>         Make sure that all symbols are defined.
>         Check the rules on symbols used in an arithmetic expression
>         concerning relocation.
> ...... (many similar messages)

Please try:

$ cd asmrun
$ cpp -DSYS_aix power-aix.S > power-aix.s
$ as -u  power-aix.s
$ cd ..
$ make opt

Christoph Bauer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] OCaml on AIX
  2010-01-22 11:24     ` Christoph Bauer
@ 2010-01-27 15:10       ` Dawid Toton
  2010-04-19 14:56         ` Christoph Bauer
  0 siblings, 1 reply; 8+ messages in thread
From: Dawid Toton @ 2010-01-27 15:10 UTC (permalink / raw)
  To: caml-list

Christoph Bauer pisze:
> Please try:
>
> $ cd asmrun
> $ cpp -DSYS_aix power-aix.S > power-aix.s
> $ as -u  power-aix.s
> $ cd ..
> $ make opt
>
> Christoph Bauer
>
>   
Apparently I can go directly without preprocessor (and cpp I have on the 
AIX machine doesn't like asm syntax):

$ cp power-aix.S power-aix.s
$ as -u -o power-aix.o power-aix.s
$ cd ..
$ gmake opt

So I get working native code.
The remaining problem is that camlp4 crashes on some Unix call when 
preprocessing. I solved it by preprocessing all the code on another machine.

Thank you for your help.

Dawid


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] OCaml on AIX
  2010-01-27 15:10       ` [Caml-list] OCaml on AIX Dawid Toton
@ 2010-04-19 14:56         ` Christoph Bauer
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Bauer @ 2010-04-19 14:56 UTC (permalink / raw)
  To: caml-list; +Cc: Dawid Toton, Slavcho Nikolov, Sylvain Le Gall

 
Dawid wrote:

> So I get working native code.
> The remaining problem is that camlp4 crashes on some Unix call when preprocessing. I solved it by preprocessing all > the code on another machine.

I looked again into that problem. ocamlrun opens a DLL (dllunix.so)
and this dll trys to use symbols from ocamlrun (caml_alloc_string).
Unfortunatly this doesn't work.

The easiest solution is, to link ocamlrun agains libcamlrun_shared.so and to
set an internal libpath.

Download it from here:
http://home.arcor.de/chr_bauer/ocaml-aix.html

Christoph Bauer


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-19 14:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-19 20:31 Bytecode run on AIX - "unknown C primitive" error Dawid Toton
2010-01-20  9:20 ` [Caml-list] " Christoph Bauer
2010-01-20 10:07   ` Sylvain Le Gall
2010-01-20 10:36     ` [Caml-list] " Christoph Bauer
2010-01-20 18:18   ` [Caml-list] " Dawid Toton
2010-01-22 11:24     ` Christoph Bauer
2010-01-27 15:10       ` [Caml-list] OCaml on AIX Dawid Toton
2010-04-19 14:56         ` Christoph Bauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).