Bug 1156300 - FTBFS on ppc64 and ppc64le
Summary: FTBFS on ppc64 and ppc64le
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ocaml
Version: 22
Hardware: ppc64le
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker F-ExcludeArch-ppc64le, PPC64LETracker
TreeView+ depends on / blocked
 
Reported: 2014-10-24 06:45 UTC by Dan Horák
Modified: 2015-08-13 12:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-13 12:32:05 UTC
normand: needinfo-


Attachments (Terms of Use)
fix configure for ppc64* (958 bytes, patch)
2014-10-24 06:45 UTC, Dan Horák
no flags Details | Diff

Description Dan Horák 2014-10-24 06:45:00 UTC
Created attachment 950240 [details]
fix configure for ppc64*

ocaml-4.02.0-4.fc22 is FTBFS on ppc64* arches

...
gcc -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_power64 -DSYS_elf  -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64   -c -o dynlink.o dynlink.c
DSYS_elf -DMODEL_ppc64 -o power64-elf.o power64-elf.S || \
{ echo "If your assembler produced syntax errors, it is probably";\
          echo "unhappy with the preprocessor. Check your assembler, or";\
          echo "try producing power64-elf.o by hand.";\
          exit 2; }
/bin/sh: DSYS_elf: command not found
If your assembler produced syntax errors, it is probably
unhappy with the preprocessor. Check your assembler, or
try producing power64-elf.o by hand.
Makefile:191: recipe for target 'power64-elf.o' failed
make[2]: [power64-elf.o] Error 2 (ignored)
cp power64-elf.o power64.o
cp: cannot stat 'power64-elf.o': No such file or directory
Makefile:97: recipe for target 'power64.o' failed
make[2]: *** [power64.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/ocaml-8c1e5cdf9154b7c4f979327a554bdde5c8f76436/asmrun'
Makefile:658: recipe for target 'makeruntimeopt' failed
make[1]: *** [makeruntimeopt] Error 2

Please see attachment for a fix of this error

Comment 1 Dan Horák 2014-10-24 06:46:38 UTC
But with the fixed configure it still fails, now with

...
ln -s power64le/proc.ml asmcomp/proc.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39+48 -warn-error A -bin-annot -safe-string -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c asmcomp/proc.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39+48 -warn-error A -bin-annot -safe-string -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c asmcomp/proc.ml
File "asmcomp/proc.ml", line 88, characters 10-22:
Warning 3: deprecated: Array.create
File "asmcomp/proc.ml", line 92, characters 10-22:
Warning 3: deprecated: Array.create
File "asmcomp/proc.ml", line 108, characters 12-24:
Warning 3: deprecated: Array.create
File "asmcomp/proc.ml", line 162, characters 12-24:
Warning 3: deprecated: Array.create
File "asmcomp/proc.ml", line 1:
Error: The implementation asmcomp/proc.ml
       does not match the interface asmcomp/proc.cmi:
       The value `op_is_pure' is required but not provided
       The value `regs_are_volatile' is required but not provided
Makefile:822: recipe for target 'asmcomp/proc.cmo' failed
make[1]: Leaving directory '/builddir/build/BUILD/ocaml-4.02.0'
Makefile:259: recipe for target 'opt' failed
make[1]: *** [asmcomp/proc.cmo] Error 2

Comment 2 Dan Horák 2014-10-24 06:55:15 UTC
the last failing scratch build is http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=2157351

Comment 3 Richard W.M. Jones 2014-10-24 08:18:08 UTC
This used to work fine, just a few weeks ago.  Why did it suddenly
stop working?

Comment 4 Richard W.M. Jones 2014-10-24 08:18:33 UTC
Oh I see, Fedora not RHEL.

Comment 5 Dan Horák 2014-10-24 08:44:30 UTC
(In reply to Richard W.M. Jones from comment #4)
> Oh I see, Fedora not RHEL.

yes, and it's 4.02, 4.01 is OK

Comment 6 Richard W.M. Jones 2014-10-24 09:20:03 UTC
I've added this guesswork patch which may fix the ppc64/ppc64le
build.  It could really use checking by someone more familiar with
the POWER architecture.

https://git.fedorahosted.org/cgit/fedora-ocaml.git/commit/?h=fedora-22-4.02&id=0d60237e349595e1022c2258fe6fcb4137d9e128

'regs_are_volatile' seems to be a hack to deal with the 8087
stack.  Every other architecture apart from i386 has this returning false.

'op_is_pure' is required by the new CSE code (which caused us
endless trouble on arm64).  I have copied this definition from
the one used by ppc32, on the basis that POWER is similar for
32 and 64 bit, but it still may be wrong, and that would cause
CSE-related code gen failures, that are hard to track down and fix.

This patch was not even compile tested.

Comment 7 Richard W.M. Jones 2014-10-24 09:20:47 UTC
Both patches are included in ocaml-4.02.0-5.fc22.

Comment 8 Dan Horák 2014-10-24 10:06:14 UTC
it still doesn't build - http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=2158978 - and there are few more issues

incomplete work in progress (based on ppc port) is

diff --git a/asmcomp/power64/emit.mlp b/asmcomp/power64/emit.mlp
index d84ac5c..db77452 100644
--- a/asmcomp/power64/emit.mlp
+++ b/asmcomp/power64/emit.mlp
@@ -370,7 +370,7 @@ let instr_size = function
       if chunk = Byte_signed
       then load_store_size addr + 1
       else load_store_size addr
-  | Lop(Istore(chunk, addr)) -> load_store_size addr
+  | Lop(Istore(chunk, addr, _)) -> load_store_size addr
   | Lop(Ialloc n) -> 4
   | Lop(Ispecific(Ialloc_far n)) -> 5
   | Lop(Iintop Imod) -> 3
@@ -397,7 +397,7 @@ let instr_size = function
   | Lsetuptrap lbl -> 1
   | Lpushtrap -> 7
   | Lpoptrap -> 1
-  | Lraise -> 6
+  | Lraise _ -> 6
 
 let label_map code =
   let map = Hashtbl.create 37 in
@@ -581,7 +581,7 @@ let rec emit_instr i dslot =
         emit_load_store loadinstr addr i.arg 0 i.res.(0);
         if chunk = Byte_signed then
           `    extsb   {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
-    | Lop(Istore(chunk, addr)) ->
+    | Lop(Istore(chunk, addr, _)) ->
         let storeinstr =
           match chunk with
             Byte_unsigned | Byte_signed -> "stb"
@@ -772,7 +772,7 @@ let rec emit_instr i dslot =
        `       mr      {emit_gpr 29}, {emit_gpr 11}\n`
     | Lpoptrap ->
         `      ld      {emit_gpr 29}, 0({emit_gpr 29})\n`
-    | Lraise ->
+    | Lraise k ->
         `      ld      {emit_gpr 0}, 8({emit_gpr 29})\n`;
         `      ld      {emit_gpr 1}, 16({emit_gpr 29})\n`;
         `      ld      {emit_gpr 2}, 24({emit_gpr 29})\n`;
diff --git a/asmcomp/power64/proc.ml b/asmcomp/power64/proc.ml
index 372303d..0a4a442 100644
--- a/asmcomp/power64/proc.ml
+++ b/asmcomp/power64/proc.ml
@@ -85,11 +85,11 @@ let rotate_registers = true
 (* Representation of hard registers by pseudo-registers *)
 
 let hard_int_reg =
-  let v = Array.create 23 Reg.dummy in
+  let v = Array.make 23 Reg.dummy in
   for i = 0 to 22 do v.(i) <- Reg.at_location Int (Reg i) done; v
 
 let hard_float_reg =
-  let v = Array.create 31 Reg.dummy in
+  let v = Array.make 31 Reg.dummy in
   for i = 0 to 30 do v.(i) <- Reg.at_location Float (Reg(100 + i)) done; v
 
 let all_phys_regs =
@@ -105,7 +105,7 @@ let stack_slot slot ty =
 
 let calling_conventions
     first_int last_int first_float last_float make_stack stack_ofs arg =
-  let loc = Array.create (Array.length arg) Reg.dummy in
+  let loc = Array.make (Array.length arg) Reg.dummy in
   let int = ref first_int in
   let float = ref first_float in
   let ofs = ref stack_ofs in
@@ -159,7 +159,7 @@ let loc_results res =
 
 let poweropen_external_conventions first_int last_int
                                    first_float last_float arg =
-  let loc = Array.create (Array.length arg) Reg.dummy in
+  let loc = Array.make (Array.length arg) Reg.dummy in
   let int = ref first_int in
   let float = ref first_float in
   let ofs = ref (14 * size_addr) in
diff --git a/asmcomp/power64/scheduling.ml b/asmcomp/power64/scheduling.ml
index b7bba9b..b582b6a 100644
--- a/asmcomp/power64/scheduling.ml
+++ b/asmcomp/power64/scheduling.ml
@@ -46,7 +46,7 @@ method reload_retaddr_latency = 12
 method oper_issue_cycles = function
     Iconst_float _ | Iconst_symbol _ -> 2
   | Iload(_, Ibased(_, _)) -> 2
-  | Istore(_, Ibased(_, _)) -> 2
+  | Istore(_, Ibased(_, _), _) -> 2
   | Ialloc _ -> 4
   | Iintop(Imod) -> 40 (* assuming full stall *)
   | Iintop(Icomp _) -> 4

Comment 9 Dan Horák 2014-10-24 10:14:49 UTC
and here my naive attempt gets out of knowledge :-)

Comment 10 Richard W.M. Jones 2014-10-24 10:19:05 UTC
FYI it's easier to test build from this git repo:

  https://git.fedorahosted.org/git/fedora-ocaml.git

in the branch fedora-22-4.02.

Comment 11 Dan Horák 2014-10-24 10:20:34 UTC
(In reply to Richard W.M. Jones from comment #10)
> FYI it's easier to test build from this git repo:
> 
>   https://git.fedorahosted.org/git/fedora-ocaml.git
> 
> in the branch fedora-22-4.02.

yes, that's where I started

Comment 13 Dan Horák 2014-10-24 11:42:48 UTC
and success - http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=2159054

Thanks a lot.

Comment 14 Richard W.M. Jones 2014-10-24 11:43:53 UTC
Builds anyway.  Whether it truly works or not is another question.

Keep an eye out for any odd build failures in the dependent packages,
and file bugs for them ..

Comment 15 Jaroslav Reznik 2015-03-03 16:23:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 16 Rafael Fonseca 2015-08-13 12:29:57 UTC
Can we close this bug or are there issues left?

Comment 17 Richard W.M. Jones 2015-08-13 12:32:05 UTC
I'm testing OCaml on ppc64 & ppc64le fairly regularly now, so
I think this is fixed now.


Note You need to log in before you can comment on or make changes to this bug.