Bug 242389 - lang/ocaml: fix build on powerpc64 elfv2
Summary: lang/ocaml: fix build on powerpc64 elfv2
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs mailing list
Depends on:
Reported: 2019-12-02 21:03 UTC by Piotr Kubaj
Modified: 2019-12-02 21:03 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (michipili)

patch (7.64 KB, patch)
2019-12-02 21:03 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (michipili)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-12-02 21:03:07 UTC
Created attachment 209630 [details]

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.