caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] need help to investigate an ocaml build error on ppc64le archi
@ 2014-03-20 15:53 Normand
  2014-03-20 18:36 ` Normand
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Normand @ 2014-03-20 15:53 UTC (permalink / raw)
  To: caml-list

Hello there,
I am trying to investigate a failure while porting ocaml on ppc64le archi (flag1)
This is most probably related to some changes I did not made yet.
But because I do not understand anything about ocaml I do not know where to search.

I understand that the bad unix.o is generated by the call to ocamlcompopt.sh
calling itself ocamlrun with the parameters of flag2.

But I do not understand what archi specific files are used by this command line.

I would appreciate any suggestion on the subject.

flag1: the original failure log extract.
===
make[2]: Entering directory `/home/michel/rpmbuild/BUILD/ocaml-4.01.0/otherlibs/unix'
../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unix.ml
../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unixLabels.ml
../../boot/ocamlrun ../../tools/ocamlmklib -o unix -oc unix -ocamlopt '../../ocamlcompopt.sh' -linkall \
           unix.cmx unixLabels.cmx
../../ocamlcompopt.sh -shared -o unix.cmxs -I . unix.cmxa
/usr/bin/ld: unix.cmxs.startup.o: ABI version 1 is not compatible with ABI version 2 output
/usr/bin/ld: failed to merge target specific data of file unix.cmxs.startup.o
/usr/bin/ld: unix.a(unix.o): ABI version 1 is not compatible with ABI version 2 output
/usr/bin/ld: failed to merge target specific data of file unix.a(unix.o)
/usr/bin/ld: unix.a(unixLabels.o): ABI version 1 is not compatible with ABI version 2 output
/usr/bin/ld: failed to merge target specific data of file unix.a(unixLabels.o)
collect2: error: ld returned 1 exit status
===

flag2: unix.o generated from unix.ml
===
+ exec ../../boot/ocamlrun ../../ocamlopt -nostdlib -I ../../stdlib -c -w +33..39 -warn-error A -g -nolabels unix.ml
===
$file unix.ml
unix.ml: Mathematica 3.0 notebook
===
$readelf -h unix.o |grep Flags
    Flags:                             0x0
===

no full log because too big for attachment in ML

-- 
Michel Normand


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

* Re: [Caml-list] need help to investigate an ocaml build error on ppc64le archi
  2014-03-20 15:53 [Caml-list] need help to investigate an ocaml build error on ppc64le archi Normand
@ 2014-03-20 18:36 ` Normand
  2014-03-22 12:20 ` Richard W.M. Jones
  2014-03-22 12:24 ` Richard W.M. Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Normand @ 2014-03-20 18:36 UTC (permalink / raw)
  To: caml-list

the related full log temporarily available at http://paste.fedoraproject.org/87125/39533331/

Normand wrote:
> Hello there,
> I am trying to investigate a failure while porting ocaml on ppc64le archi (flag1)
> This is most probably related to some changes I did not made yet.
> But because I do not understand anything about ocaml I do not know where to search.
>
> I understand that the bad unix.o is generated by the call to ocamlcompopt.sh
> calling itself ocamlrun with the parameters of flag2.
>
> But I do not understand what archi specific files are used by this command line.
>
> I would appreciate any suggestion on the subject.
>
> flag1: the original failure log extract.
> ===
> make[2]: Entering directory `/home/michel/rpmbuild/BUILD/ocaml-4.01.0/otherlibs/unix'
> ../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unix.ml
> ../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unixLabels.ml
> ../../boot/ocamlrun ../../tools/ocamlmklib -o unix -oc unix -ocamlopt '../../ocamlcompopt.sh' -linkall \
>            unix.cmx unixLabels.cmx
> ../../ocamlcompopt.sh -shared -o unix.cmxs -I . unix.cmxa
> /usr/bin/ld: unix.cmxs.startup.o: ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.cmxs.startup.o
> /usr/bin/ld: unix.a(unix.o): ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.a(unix.o)
> /usr/bin/ld: unix.a(unixLabels.o): ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.a(unixLabels.o)
> collect2: error: ld returned 1 exit status
> ===
>
> flag2: unix.o generated from unix.ml
> ===
> + exec ../../boot/ocamlrun ../../ocamlopt -nostdlib -I ../../stdlib -c -w +33..39 -warn-error A -g -nolabels unix.ml
> ===
> $file unix.ml
> unix.ml: Mathematica 3.0 notebook
> ===
> $readelf -h unix.o |grep Flags
>     Flags:                             0x0
> ===
>
> no full log because too big for attachment in ML
>

-- 
Michel Normand


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

* Re: [Caml-list] need help to investigate an ocaml build error on ppc64le archi
  2014-03-20 15:53 [Caml-list] need help to investigate an ocaml build error on ppc64le archi Normand
  2014-03-20 18:36 ` Normand
@ 2014-03-22 12:20 ` Richard W.M. Jones
  2014-03-22 12:24 ` Richard W.M. Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Richard W.M. Jones @ 2014-03-22 12:20 UTC (permalink / raw)
  To: Normand; +Cc: caml-list

For context, normand is using the ppc64 backend that Red Hat have been
maintaining out of tree for a few years.

The patch is here:

https://git.fedorahosted.org/cgit/fedora-ocaml.git/commit/?id=a85437a0d2ffdf7a340d379789500eb583ae4708

Rich.

-- 
Richard Jones
Red Hat

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

* Re: [Caml-list] need help to investigate an ocaml build error on ppc64le archi
  2014-03-20 15:53 [Caml-list] need help to investigate an ocaml build error on ppc64le archi Normand
  2014-03-20 18:36 ` Normand
  2014-03-22 12:20 ` Richard W.M. Jones
@ 2014-03-22 12:24 ` Richard W.M. Jones
  2014-03-28 11:09   ` [Caml-list] Where is defined the caml_program initial entry point called from asmrun/*/ Normand
  2 siblings, 1 reply; 6+ messages in thread
From: Richard W.M. Jones @ 2014-03-22 12:24 UTC (permalink / raw)
  To: Normand; +Cc: caml-list

On Thu, Mar 20, 2014 at 04:53:33PM +0100, Normand wrote:
> Hello there,
> I am trying to investigate a failure while porting ocaml on ppc64le archi (flag1)
> This is most probably related to some changes I did not made yet.
> But because I do not understand anything about ocaml I do not know where to search.
> 
> I understand that the bad unix.o is generated by the call to ocamlcompopt.sh
> calling itself ocamlrun with the parameters of flag2.
> 
> But I do not understand what archi specific files are used by this command line.
> 
> I would appreciate any suggestion on the subject.

ocamlcompopt.sh is a shell script wrapper around ocamlopt which is
just used within the OCaml build system (so we can run the compiler
we've just compiled).

The first thing to do is to add the -verbose option to those commands
(run them by hand).  That will print the 'as' and 'gcc' subcommands
that ocamlopt is running.

Rich.

> flag1: the original failure log extract.
> ===
> make[2]: Entering directory `/home/michel/rpmbuild/BUILD/ocaml-4.01.0/otherlibs/unix'
> ../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unix.ml
> ../../ocamlcompopt.sh -c -w +33..39 -warn-error A -g -nolabels unixLabels.ml
> ../../boot/ocamlrun ../../tools/ocamlmklib -o unix -oc unix -ocamlopt '../../ocamlcompopt.sh' -linkall \
>           unix.cmx unixLabels.cmx
> ../../ocamlcompopt.sh -shared -o unix.cmxs -I . unix.cmxa
> /usr/bin/ld: unix.cmxs.startup.o: ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.cmxs.startup.o
> /usr/bin/ld: unix.a(unix.o): ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.a(unix.o)
> /usr/bin/ld: unix.a(unixLabels.o): ABI version 1 is not compatible with ABI version 2 output
> /usr/bin/ld: failed to merge target specific data of file unix.a(unixLabels.o)
> collect2: error: ld returned 1 exit status
> ===
> 
> flag2: unix.o generated from unix.ml
> ===
> + exec ../../boot/ocamlrun ../../ocamlopt -nostdlib -I ../../stdlib -c -w +33..39 -warn-error A -g -nolabels unix.ml
> ===
> $file unix.ml
> unix.ml: Mathematica 3.0 notebook
> ===
> $readelf -h unix.o |grep Flags
>    Flags:                             0x0
> ===
> 
> no full log because too big for attachment in ML
> 
> -- 
> Michel Normand
> 
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

-- 
Richard Jones
Red Hat

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

* [Caml-list] Where is defined the caml_program initial entry point called from asmrun/*/
  2014-03-22 12:24 ` Richard W.M. Jones
@ 2014-03-28 11:09   ` Normand
  2014-03-28 11:59     ` John Carr
  0 siblings, 1 reply; 6+ messages in thread
From: Normand @ 2014-03-28 11:09 UTC (permalink / raw)
  To: caml-list


I still have problems while porting ocaml on ppc64le archi. I was able to generate the ocamlcompopt, but obviously with missing changes because the first trial is segfault.

Investigating the failure with gdb I was able to trace the code from "caml_start_program" calling "caml_program"
https://git.fedorahosted.org/cgit/fedora-ocaml.git/tree/asmrun/power64-elf.S#n350
(url without my own patches)

But I am not able to find the source code associated to the "caml_program"

Could somebody give me a clue ? I guess this is generated with help of asmcomp/*/emit.mlp
and may be the asmcomp/cmmgen.ml  but the generated asmcom/cmmgen.s do not match the disassemble code displayed via gdb.


-- 
Michel Normand


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

* Re: [Caml-list] Where is defined the caml_program initial entry point called from asmrun/*/
  2014-03-28 11:09   ` [Caml-list] Where is defined the caml_program initial entry point called from asmrun/*/ Normand
@ 2014-03-28 11:59     ` John Carr
  0 siblings, 0 replies; 6+ messages in thread
From: John Carr @ 2014-03-28 11:59 UTC (permalink / raw)
  To: Normand; +Cc: caml-list


The result of an ocaml program is the side effect of loading
(initializing) all modules.  Cmmgen.entry_point generates a function
called caml_program that runs the module initializer functions of
everything you link.  If you need to see the exact assembly code
you can use -S to save the assembly file with this generated function.
It may be in /tmp.

Make sure you understand asmrun/stack.h, which defines part of the
binary interface between compiler and runtime and between runtime
C and assembly code.  If the definitions don't match your program may
crash when it throws an exception or garbage collects.

> 
> I still have problems while porting ocaml on ppc64le archi. I was able to generate the ocamlcompopt, but obviously with missing changes because the first trial is segfault.
> 
> Investigating the failure with gdb I was able to trace the code from "caml_start_program" calling "caml_program"
> https://git.fedorahosted.org/cgit/fedora-ocaml.git/tree/asmrun/power64-elf.S#n350
> (url without my own patches)
> 
> But I am not able to find the source code associated to the "caml_program"
> 
> Could somebody give me a clue ? I guess this is generated with help of asmcomp/*/emit.mlp
> and may be the asmcomp/cmmgen.ml  but the generated asmcom/cmmgen.s do not match the disassemble code displayed via gdb.
> 
> 
> -- 
> Michel Normand
> 
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

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

end of thread, other threads:[~2014-03-28 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20 15:53 [Caml-list] need help to investigate an ocaml build error on ppc64le archi Normand
2014-03-20 18:36 ` Normand
2014-03-22 12:20 ` Richard W.M. Jones
2014-03-22 12:24 ` Richard W.M. Jones
2014-03-28 11:09   ` [Caml-list] Where is defined the caml_program initial entry point called from asmrun/*/ Normand
2014-03-28 11:59     ` John Carr

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).