Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005910OCamlOCaml backend (code generation)public2013-01-28 09:302013-05-10 08:33
Reporterjteg68 
Assigned Tomeurer 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformraspberrypiOSraspbianOS Version
Product Version4.00.1 
Target VersionFixed in Version4.00.2+dev 
Summary0005910: assembler complains of invalid code
DescriptionRunning 'opam install ocamlnet' the build always stops due to errors in the generated assmbler code.
The computer is a raspberrypi with a patched ocaml compiler.

root@raspberrypi:~# ocamlc -v
The OCaml compiler, version 4.00.1
Standard library directory: /root/.opam/4.00.1+raspberrypi/lib/ocaml

root@raspberrypi:~# uname -a
Linux raspberrypi 3.2.27+ 0000250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux


result from 'opam install --debug ocamlnet 2> opam.err'
root@raspberrypi:~# tail opam.err -n30
...
make[1]: Leaving directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'
make[1]: Entering directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'
ocamlfind ocamlopt -I ../../src/netsys -I ../../src/netstring -I ../../src/netgssapi -package "cryptokit unix" -c netmech_scram.ml
make[1]: Leaving directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'
### stderr ###
...[truncated]
Warning 11: this match case is unused.
File "nethttpd_services.ml", line 1118, characters 4-5:
Warning 11: this match case is unused.
/tmp/camlasm26c358.s: Assembler messages:
/tmp/camlasm26c358.s:9540: Error: shift expression is too large
/tmp/camlasm26c358.s:9632: Error: shift expression is too large
File "netmech_scram.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasm26c358.s
make[1]: *** [netmech_scram.cmx] Fel 2
make: *** [opt] Fel 2

[17247] 17247 unlocking /root/.opam/4.00.1+raspberrypi/lock
'opam install --debug eliom' failed.



Steps To Reproduceopam install ocamlnet
TagsNo tags attached.
Attached Files? file icon camlasm26c358.s [^] (277,903 bytes) 2013-01-28 09:30

- Relationships
has duplicate 0005994resolvedmeurer Error: shift expression is too large 
has duplicate 0006006resolvedmeurer Cannot "ocamlopt" the expression "x mod 1" on ARM 
has duplicate 0006131resolvedmeurer Ref: ID 0005910 - same error at different location in code for haxe compile 

-  Notes
(0008803)
jteg68 (reporter)
2013-01-28 09:36

The original command was 'opam install eliom', but as the offending file is in ocamlnet I also tried 'opam install ocamlnet'. The output file is from the eliom install attempt, the result is identical in the two cases.

/Jörgen
(0008804)
frisch (developer)
2013-01-28 09:43

Since this seems to be a back-end related problem, it is probably related to the patched compiler you are using. I suggest to send this bug report to the maintainer of this compiler.
(0008805)
meurer (developer)
2013-01-28 09:51

It'd help to know what patches were used. And why don't you use the trunk/4.00.1-dev version, which already supports ARMv6?
(0008807)
jteg68 (reporter)
2013-01-28 10:34

The patch was from
http://www.cl.cam.ac.uk/projects/ocamllabs/projects/rpi.html [^]

"...
Alternatively, you can also use OPAM to compile a custom compiler (see the Jane Street blog post above for instructions on how to install OPAM):

$ opam switch 4.00.1+raspberrypi
..."

I'll try 4.00.1-dev instead tonight.

Thanks,
Jörgen
(0008809)
jteg68 (reporter)
2013-01-28 15:12

root@raspberrypi:~# opam switch show
4.01.0dev+trunk

'opam install eliom' gave the output below. It looks like the same error as before.

The offending instruction seems to be
        mov r2, r1, lsl 0000032

/Jörgen


==== ERROR [while recompiling ocamlnet.3.6.0] ====
# command make opt
# path /root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0
# exit-code 2
# env-file /root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/ocamlnet-d37749.env
# stdout-file /root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/ocamlnet-d37749.out
# stderr-file /root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/ocamlnet-d37749.err
### stdout ###
...[truncated]
make[2]: Entering directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
make[2]: Inget behöver göras för "realgenerate".
make[2]: Leaving directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
make[1]: Leaving directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
make[1]: Entering directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
make[1]: "depend" är färsk.
make[1]: Leaving directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
make[1]: Entering directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
ocamlfind ocamlopt -I ../../src/netsys -I ../../src/netstring -I ../../src/netgssapi -package "cryptokit unix" -c netmech_scram.ml
make[1]: Leaving directory `/root/.opam/4.01.0dev+trunk/build/ocamlnet.3.6.0/src/netmech-scram'
### stderr ###
...[truncated]
Warning 11: this match case is unused.
File "nethttpd_services.ml", line 1118, characters 4-5:
Warning 11: this match case is unused.
/tmp/camlasm209b09.s: Assembler messages:
/tmp/camlasm209b09.s:9460: Error: shift expression is too large
/tmp/camlasm209b09.s:9552: Error: shift expression is too large
File "netmech_scram.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasm209b09.s
make[1]: *** [netmech_scram.cmx] Fel 2
make: *** [opt] Fel 2
(0008815)
meurer (developer)
2013-01-29 07:39

It looks like a bug in the ARM instruction selection. I'll try to look into this during the week.
(0009020)
guleesh (reporter)
2013-04-01 20:12

any progress on this issue ?
I have encountered the same problem with , shift expression is too large

Again the problem seems to be
 lsl 0000032

which is too large for ARM6 (?)
(0009250)
meurer (developer)
2013-05-07 14:17

I'm sorry, I was too busy with real life to have a look at the issue. The problem is indeed related to the shift left by 32. I'm going to push a fix later.
(0009257)
meurer (developer)
2013-05-08 15:24

Fixed in trunk and version/4.00.
(0009259)
wime (reporter)
2013-05-10 08:32

Thanks for the fix!

- Issue History
Date Modified Username Field Change
2013-01-28 09:30 jteg68 New Issue
2013-01-28 09:30 jteg68 File Added: camlasm26c358.s
2013-01-28 09:36 jteg68 Note Added: 0008803
2013-01-28 09:43 frisch Note Added: 0008804
2013-01-28 09:50 meurer Assigned To => meurer
2013-01-28 09:50 meurer Status new => assigned
2013-01-28 09:51 meurer Note Added: 0008805
2013-01-28 10:34 jteg68 Note Added: 0008807
2013-01-28 15:12 jteg68 Note Added: 0008809
2013-01-29 07:39 meurer Note Added: 0008815
2013-04-01 20:12 guleesh Note Added: 0009020
2013-05-07 12:55 meurer Relationship added has duplicate 0005994
2013-05-07 14:15 meurer Relationship added has duplicate 0006006
2013-05-07 14:15 meurer Status assigned => acknowledged
2013-05-07 14:17 meurer Note Added: 0009250
2013-05-08 15:24 meurer Note Added: 0009257
2013-05-08 15:24 meurer Status acknowledged => resolved
2013-05-08 15:24 meurer Fixed in Version => 4.00.2+dev
2013-05-08 15:24 meurer Resolution open => fixed
2013-05-10 08:32 wime Note Added: 0009259
2013-08-19 08:19 meurer Relationship added has duplicate 0006131


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker