Bug 242389

Summary: lang/ocaml: fix build on powerpc64 elfv2
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Piotr Kubaj <pkubaj>
Status: Closed FIXED    
Severity: Affects Only Me CC: michipili
Priority: --- Flags: bugzilla: maintainer-feedback? (michipili)
Version: Latest   
Hardware: powerpc   
OS: Any   
Attachments:
Description Flags
patch pkubaj: maintainer-approval? (michipili)

Description Piotr Kubaj freebsd_committer freebsd_triage 2019-12-02 21:03:07 UTC
Created attachment 209630 [details]
patch

LLVM miscompiles ocaml on powerpc64 elfv2:
ld: error: bytecomp/printlambda.ml:23:(.text+0x16): relocation R_PPC64_TOC16_DS out of range: 73024 is not in [-32768, 32767]

Use GCC instead. I tested on amd64 that it compiles successfully.

Add a conditional patch enabled only on powerpc64 elfv2 to use elfv2 abi instead of elfv1.

Add a bunch of other patches to correctly check for abi instead of relying on endianness.
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-12-16 12:56:13 UTC
A commit references this bug:

Author: pkubaj
Date: Mon Dec 16 12:56:08 UTC 2019
New revision: 520254
URL: https://svnweb.freebsd.org/changeset/ports/520254

Log:
  lang/ocaml: fix build on powerpc64 elfv2

  LLVM miscompiles ocaml on powerpc64 elfv2:
  ld: error: bytecomp/printlambda.ml:23:(.text+0x16): relocation R_PPC64_TOC16_DS out of range: 73024 is not in [-32768, 32767]

  Use GCC instead on powerpc64.

  Add a conditional patch enabled only on powerpc64 elfv2 to use elfv2 abi instead of elfv1.

  Add a bunch of other patches to correctly check for abi instead of relying on endianness.

  PR:		242389
  Approved by:	michipili@gmail.com (maintainer)

Changes:
  head/lang/ocaml/Makefile
  head/lang/ocaml/files/extra-patch-asmcomp_power_arch.ml
  head/lang/ocaml/files/patch-asmrun_power.S
  head/lang/ocaml/files/patch-byterun_caml_stack.h
  head/lang/ocaml/files/patch-testsuite_tests_asmcomp_power.S