Skip to content

Cinaps stanza 1.0 fails to build the cinaps executable under arm32 #4069

@NathanReb

Description

@NathanReb

Expected Behavior

Everything should work fine under arm32.

Actual Behavior

From what I gathered from ocaml-ci's log, it appears that building the cgenerated cinaps executable fails, getting relocation errors from ld. I'm guessing this might be due to missing flags along the chain somewhere. The dune runtest fails with the following:

(cd _build/default && /home/opam/.opam/4.11/bin/ocamlopt.opt -w -24 -o lib/.cinaps/cinaps.exe /home/opam/.opam/4.11/lib/ocaml/unix.cmxa -I /home/opam/.opam/4.11/lib/ocaml /home/opam/.opam/4.11/lib/cinaps/runtime/cinaps_runtime.cmxa lib/.cinaps/.cinaps.eobjs/native/dune__exe__Cinaps.cmx)
/usr/bin/ld: lib/.cinaps/.cinaps.eobjs/native/dune__exe__Cinaps.o: relocation R_ARM_THM_MOVW_ABS_NC against `camlCinaps_runtime' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/.cinaps/.cinaps.eobjs/native/dune__exe__Cinaps.o: in function `.L111':
:(.text+0xfc): dangerous relocation: unsupported relocation
/usr/bin/ld: :(.text+0x100): dangerous relocation: unsupported relocation
/usr/bin/ld: :(.text+0x104): dangerous relocation: unsupported relocation
/usr/bin/ld: :(.text+0x108): dangerous relocation: unsupported relocation
/usr/bin/ld: lib/.cinaps/.cinaps.eobjs/native/dune__exe__Cinaps.o: in function `camlDune__exe__Cinaps__6':
:(.data+0x4): dangerous relocation: unsupported relocation
...

Reproduction

I wrote a minimal example here: https://github.com/NathanReb/dune-cinaps-arm32
I openend a dummy PR on the repo to trigger an ocaml-ci build, here is the arm32 build: https://ci.ocamllabs.io/github/NathanReb/dune-cinaps-arm32/commit/c5312927c1f56868dae15c9c6762d022e6faaaf8/variant/debian-10-4.11_arm32

Specifications

  • Version of dune (output of dune --version): 2.7.1
  • Version of ocaml (output of ocamlc --version): 4.11.1
  • Operating system (distribution and version): linux-arm64:debian-10-4.11_arm32

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions