Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007121OCamlconfigure and build/installpublic2016-01-11 08:052017-04-10 14:43
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version4.02.3 
Target VersionFixed in Version 
Summary0007121: [cross-compilation] Use target's ld as a basis for ${partialld}
DescriptionCurrently, the ${partialld} variable in configure is either provided or guessed as "ld -r" or "ld -r -arch ppc64/x86_64" or "ld -r -m elf_x86_64". For cross-compilation, something starting with "${TARGET_TRIPLET}-ld" is needed.

The following diff, which I'm not very happy with, solves the issue for me:

  diff --git a/configure b/configure
  index e5ae7a5..0fd96b5 100755
  --- a/configure
  +++ b/configure
  @@ -884,6 +884,7 @@ case "$arch,$nativecc,$system,$model" in
     power,gcc*,elf,ppc) partialld="ld -r -m elf32ppclinux";;
     power,gcc*,elf,ppc64) partialld="ld -r -m elf64ppc";;
     power,gcc*,elf,ppc64le) partialld="ld -r -m elf64lppc";;
  + *,*gcc*,*,*) partialld="${target}-ld -r";;

If the user has provided the value for partialld on the ./configure command-line, the value can get overwritten (this is already the case). The current case/in/esac construct also seems to have grown quite organically.

Does anyone know whether the architectures in the list (nextstep, rhapsody, mac os x amd64, solaris amd64, linux ppc32, ppc64, ppc64le) are supported and whether they come with prefixed toolchains.

Strictly speaking, binutils can support various file formats. For instance, slackware64 doesn't ship a 32-bits nor windows toolchains but its binutils have been configured to handle the corresponding executables (I guess that some maintainers like to play with old games [ or UEFI but that's less likely :) ]). However, it seems unlikely someone would rely on that to build OCaml and figuring out the values to -m or -arch is very difficult (and probably impossible to automate in a sane way). Therefore, trying to prefixed tools seems like the best option to me.
Tagscross-compilation, patch
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2016-01-11 08:05 adrien New Issue
2016-02-08 12:38 doligez Status new => acknowledged
2016-02-08 12:38 doligez Target Version => 4.03.0+dev / +beta1
2016-04-14 17:58 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:38 doligez Category OCaml internal build/install (Makefiles, configure) => configure and build/install
2017-04-10 14:42 doligez Target Version undecided =>
2017-04-10 14:43 doligez Tag Attached: cross-compilation
2017-04-10 14:43 doligez Tag Attached: patch

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker