[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ocaml on arm64 vs pic/pie



Hello,

In ubuntu toolchain defaults to PIE. As part of ocaml 4.04 transition
I have rebuilt ppx-deriving which failed on arm64 only.

The failure mode is segmentation fault, however throughout the build
log I see things like this:

+ ocamlfind ocamlopt -shared -linkall src/ppx_deriving.cmxa -o
src/ppx_deriving.cmxs
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving' which may
bind externally can not be used when making a shared object; recompile
with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving' which may
bind externally can not be used when making a shared object; recompile
with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3519'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3611'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3620'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3629'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3638'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3647'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3656'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol
`camlPpx_deriving__loop_2040' which may bind externally can not be
used when making a shared object; recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__fun_3677'
which may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__93' which
may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__95' which
may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__95' which
may bind externally can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: src/ppx_deriving.a(ppx_deriving.o): relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol `camlPpx_deriving__103'
which may bind externally can not be used when making a shared object;
recompile with -fPIC

And so on and so forth. Please see
https://launchpadlibrarian.net/326596780/buildlog_ubuntu-artful-arm64.ppx-deriving_4.0-1build1_BUILDING.txt.gz

I see that for arm architecture ocaml emits PIC/no-PIC compatible asm.
But I don't see anything like that in the arm64 port. Thus the
question arises, is ocaml PIC/PIE capable on arm64?

-- 
Regards,

Dimitri.


Reply to: