Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006283OCamlOCaml backend (code generation)public2013-12-30 17:382014-03-24 15:11
ReporterRichard Jones 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
Platformaarch64OSlinuxOS VersionFedora 19
Product Version 
Target VersionFixed in Version 
Summary0006283: [aarch64] ocamldoc fails to link with multiple errors: relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC
DescriptionI am try to compile OCaml (from subversion) on aarch64. Since I do not have access to real hardware, I am using qemu aarch64 emulation as described here:

http://rwmj.wordpress.com/2013/12/22/how-to-run-aarch64-binaries-on-an-x86-64-host-using-qemu-userspace-emulation/#content [^]

plus the following patch to fix a bug in qemu:

https://lists.gnu.org/archive/html/qemu-devel/2013-12/msg04379.html [^]

When building OCaml on Fedora 19 / aarch64 it fails to link ocamldoc:

../ocamlcompopt.sh -pp './remove_DEBUG' -I ../parsing -I ../utils -I ../typing -I ../driver -I ../bytecomp -I ../tools -I ../toplevel/ -I ../stdlib -I ../otherlibs/str -I ../otherlibs/dynlink -I ../otherlibs/unix -I ../otherlibs/num -I ../otherlibs/graph -warn-error A -c odoc.ml
../ocamlcompopt.sh -o ocamldoc.opt -linkall unix.cmxa str.cmxa dynlink.cmxa ../compilerlibs/ocamlcommon.cmxa -I ../parsing -I ../utils -I ../typing -I ../driver -I ../bytecomp -I ../tools -I ../toplevel/ -I ../stdlib -I ../otherlibs/str -I ../otherlibs/dynlink -I ../otherlibs/unix -I ../otherlibs/num -I ../otherlibs/graph -nostdlib ../tools/depend.cmx odoc_config.cmx odoc_messages.cmx odoc_global.cmx odoc_types.cmx odoc_misc.cmx odoc_text_parser.cmx odoc_text_lexer.cmx odoc_text.cmx odoc_name.cmx odoc_parameter.cmx odoc_value.cmx odoc_type.cmx odoc_exception.cmx odoc_class.cmx odoc_module.cmx odoc_print.cmx odoc_str.cmx odoc_comments_global.cmx odoc_parser.cmx odoc_lexer.cmx odoc_see_lexer.cmx odoc_env.cmx odoc_merge.cmx odoc_sig.cmx odoc_ast.cmx odoc_control.cmx odoc_inherit.cmx odoc_search.cmx odoc_scan.cmx odoc_cross.cmx odoc_comments.cmx odoc_dep.cmx odoc_analyse.cmx odoc_info.cmx odoc_dag2html.cmx odoc_to_text.cmx odoc_ocamlhtml.cmx odoc_html.cmx odoc_man.cmx odoc_latex_style.cmx odoc_latex.cmx odoc_texi.cmx odoc_dot.cmx odoc_gen.cmx odoc_args.cmx odoc.cmx
odoc_type.o: In function `camlOdoc_type__entry':
(.text+0xc): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlOdoc_type' defined in .data section in odoc_type.o
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x10): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x1c): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x28): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x34): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x40): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x4c): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x58): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x64): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x70): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x7c): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make[3]: *** [ocamldoc.opt] Error 2
make[3]: Leaving directory `/home/rjones/d/ocaml/ocamldoc'
make[2]: *** [ocamldoc.opt] Error 2
make[2]: Leaving directory `/home/rjones/d/ocaml'
make[1]: *** [opt.opt] Error 2
make[1]: Leaving directory `/home/rjones/d/ocaml'
make: *** [world.opt] Error 2
Steps To ReproduceOn an aarch64 platform or emulation, do:

./configure
make world.opt -j1
TagsNo tags attached.
Attached Filespatch file icon 0001-arm64-Align-code-and-data-to-8-bytes.patch [^] (1,460 bytes) 2014-03-24 11:53 [Show Content]

- Relationships

-  Notes
(0010770)
Richard Jones (reporter)
2013-12-30 17:40

I should note the versions of gcc, binutils that I am using are more up to date than the ones in Fedora 19. They are:

gcc-4.8.2-7.fc21.aarch64
binutils-2.24-9.fc21.aarch64
(0011088)
Richard Jones (reporter)
2014-03-24 11:54

I believe this to be an alignment problem, not a truncation problem (the error message is certainly confusing). Making code and data aligned to 8 bytes, as in the attached patch, cures the ocamldoc problem for me. However I'm going to build a few more virt tools before I can be certain that I've fixed this.
(0011089)
Richard Jones (reporter)
2014-03-24 15:11

It does look as if the patch fixes the problem for the virt tools as well. I have included it in Fedora Rawhide in order to get wider testing.

- Issue History
Date Modified Username Field Change
2013-12-30 17:38 Richard Jones New Issue
2013-12-30 17:40 Richard Jones Note Added: 0010770
2014-03-24 11:53 Richard Jones File Added: 0001-arm64-Align-code-and-data-to-8-bytes.patch
2014-03-24 11:54 Richard Jones Note Added: 0011088
2014-03-24 15:11 Richard Jones Note Added: 0011089


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker