Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build Android cross-compiler with OCaml 4.02.0 #6588

Closed
vicuna opened this issue Sep 29, 2014 · 12 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Sep 29, 2014

Original bug ID: 6588
Reporter: juergenhoetzel
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2016-12-07T10:49:06Z)
Resolution: fixed
Priority: normal
Severity: major
Platform: android-ndk
Version: 4.02.0+beta1 / +rc1
Fixed in version: 4.02.1+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

I was able to build a cross Compiler with OCaml 4.01.0 using this config: https://github.com/vouillon/ocaml-android

But when I try to build with 4.02.0, building of the arm native stdlib fails:

../boot/ocamlrun ../ocamlopt -strict-sequence -w +33..39 -g -warn-error A -bin-annot -nostdlib -safe-string ./Compflags char.cmx -c char.ml
I/97

Fatal error: Liveness.fundecl
Fatal error: exception Misc.Fatal_error
Makefile.shared:79: recipe for target 'char.cmx' failed

I did some git-bisecting and it seems this commit causes the error:

commit c4f3a6c
Author: Xavier Leroy xavier.leroy@inria.fr
Date: Fri Jul 18 14:07:35 2014 +0000

#6484 and #6486: CSE across memory allocations can present the GC with memory roots that are illegal.
Plus: lift the previous restriction that all arithmetic ops and loads have at most one result register, this isn't true for ARM with soft floats.
Plus: code refactoring and more comments.


git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@15012 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

Any hints/help appreciated

Steps to reproduce

Install the following opam packages:

in repo default: ocaml-src

in repo android: android-ndk-linux (https://github.com/juergenhoetzel/opam-android-repository)

Use the updated build scripts to build the crosscompiler:

https://github.com/juergenhoetzel/ocaml-android

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 2, 2014

Comment author: @mshinwell

I will try to have a look at this tomorrow (2014-10-03)

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 3, 2014

Comment author: @mshinwell

I've reproduced this, and am investigating.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 3, 2014

Comment author: @mshinwell

I've found the problem, and am talking to Xavier about a proposed fix.

One other thing: do you realise you are generating pre-ARMv6 code?

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 7, 2014

Comment author: Kakadu

Any chance that this issue will be closed until 4.02.1 release?

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 7, 2014

Comment author: @mshinwell

I expect this to be fixed in 4.02.1

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 9, 2014

Comment author: @xavierleroy

Mark's investigations suggest a connection with ARMv4/v5 support. A possible workaround is to add "-farch armv6" to the ocamlopt command-line. (This should be safe since all modern ARM devices are v6 at least.) Could you try this and let us know how it works?

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 9, 2014

Comment author: juergenhoetzel

char.ml can be compiled now:

? ../boot/ocamlrun ../ocamlopt -farch armv6 -strict-sequence -w +33..39 -g -warn-error A -bin-annot -nostdlib -safe-string ./Compflags char.cmx -c char.ml

but the compiler still bails on random.ml:

../boot/ocamlrun ../ocamlopt -farch armv6 -strict-sequence -w +33..39 -g -warn-error A -bin-annot -nostdlib -safe-string ./Compflags random.cmx -c random.ml
I/62
I/63

Fatal error: Liveness.fundecl
Fatal error: exception Misc.Fatal_error

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 9, 2014

Comment author: @mshinwell

Acknowledged

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 9, 2014

Comment author: @xavierleroy

Thanks for the quick feedback. Indeed there are two bugs: one is specific to ARM v4&v5, the other is a more general issue in CSE. Fixes are on the way.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 10, 2014

Comment author: @mshinwell

We believe these problems are fixed in the tip of the 4.02 branch. Please could you re-test with that?

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 10, 2014

Comment author: juergenhoetzel

Thanks a lot! I can confirm that this is fixed in HEAD of the 4.02 branch.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 13, 2014

Comment author: @mshinwell

Fixed for 4.02.1

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.