Bug 189063 - lang/ocaml: Add armv6 support
Summary: lang/ocaml: Add armv6 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-28 08:10 UTC by Michael Grünewald
Modified: 2014-07-08 13:13 UTC (History)
0 users

See Also:


Attachments
Patch for arm support (9.12 KB, patch)
2014-07-07 12:24 UTC, Michael Grünewald
michipili: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grünewald 2014-04-28 08:10:00 UTC
Andy Ray is able to build OCaml on armv6 and we are working together to integrate this in ports:


Andy Ray wrote:

> I've been working on OCaml 4.01.0 FreeBSD armv6 support (specifically on the  raspberry pi but with other targets in mind as well).

> I have a small patch to enable native code compilation here; https://github.com/andrewray/mirage-fpga/releases

> At the moment I am basically running from source using OPAM but it would be really nice to roll this support into ports, if possible.

> Please let me know if you are interested in this and if there is anything I can do to help.

See also: https://bitbucket.org/michipili/ports-bsd/issue/8/add-armv6-support-to-lang-ocaml
Comment 1 Michael Grünewald 2014-04-28 08:11:00 UTC
Wooops, this should have category=ports, my bad!
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-04-29 02:10:29 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

ports PR.
Comment 3 Edwin Groothuis freebsd_committer 2014-04-29 02:10:43 UTC
Class Changed
From-To: update->maintainer-update

Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
Comment 4 evilkidder 2014-05-01 12:55:10 UTC
https://bitbucket.org/michipili/ports-bsd/pull-request/1/native-code-compilation-on-armv6-raspberry/diff

Summary;

* create 2 new patch files which modify the ocaml arm backend to support freebsd
* modify the ocaml configure script patch to detect arm+freebsd an a
platform appropriate for native code compilation
* modify the ports Makefile to set correct assembler options for ocaml
and compile the correct backend

The backend is modified in two files; arm.S and arm/arch.ml.  These
are both based on using the SYS_freebsd define to select an ARM
compilation strategy appropriate for freebsd - specifically softvfp
and the use of EABI.

The configure script does the following;

* detect armv6/frebsd as appropriate for natdynlink
* set the platform triple armv6*-*-freebsd* to arm/armv6/freebsd which
enables the native code compiler
* although it is not used in this build process, also sets the
autodetected cc+as options (if my upstream ocaml patches are accepted,
this may be in 4.02)

This patch extends to original patch only and should still be
appropriate for processing with the post-patch target.

The changes to the ports Makefile are

* The 'as' option passed to 'configure' must include -mfpu and -meabi
options.  There is now a new conditional section to set up 'as' and it
has been remove from the initial setup of CONFIGURE_ARGS.
* ARCH=armv6 is mapped to OCAML_ARCH=arm and the configure script
allowed to set things up appropriately.

This ARCH mapping is the thing I am least confident of as I am a bit
unsure of what is going on.  Other targets such as powerpc seem to do
things differently.

-Andy
Comment 5 Michael Grünewald 2014-05-08 09:45:13 UTC
Due to change in the ports  (@353142) we had to rebase the fix. We are
now testing it under armv6 and anger and will submit a patch after this.
Comment 6 John Marino freebsd_committer 2014-05-10 19:17:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marino

I'll take it.
Comment 7 John Marino freebsd_committer 2014-06-06 13:02:32 UTC
what is the new ETA for the patch?
Comment 8 Michael Grünewald 2014-06-06 13:24:42 UTC
Andy Ray told me he hope to finish hist tests by the end of this week, so that we may hope to submit a patch within the very next days, if everything goes well.

(Not owning any ARM architecture, I cannot be more helpful than this!)
Comment 9 John Marino freebsd_committer 2014-06-11 08:15:20 UTC
by the way, what is the long term plan for USE_OCAML_LDCONFIG?
Once every ocaml port is staged (there's only 2700 of them in total), then ocaml ldconfig code will be completely dead, right?  And should be removed?

Or should some kind of post-install script be created to make it work again?  The bsd.ocaml.mk change looks like a very temporary bandaid to me...
Comment 10 John Marino freebsd_committer 2014-06-20 10:27:22 UTC
It's been two full weeks so I don't mind asking for an update for either the arm6 patch or the answer to the question about long-term plan for ocaml ldconfig...
Comment 11 John Marino freebsd_committer 2014-07-02 23:16:54 UTC
Michael, I'm going to close this PR in a couple of days.  I'm tired of looking at it in my inbox and my direct questions aren't getting answered.  Since no patch is here, there's nothing to do for anybody so throwing it back on heap doesn't make sense either.
Comment 12 Michael Grünewald 2014-07-07 12:24:15 UTC
Created attachment 144486 [details]
Patch for arm support

Here is the promised patch for armv6 support, which should be credited to Andy Ray.

I should think a bit about the future of LD_CONFIG, once I have something looking like a plan, I will let you know!
Comment 13 commit-hook freebsd_committer 2014-07-08 13:11:21 UTC
A commit references this bug:

Author: marino
Date: Tue Jul  8 13:11:05 UTC 2014
New revision: 361233
URL: http://svnweb.freebsd.org/changeset/ports/361233

Log:
  lang/ocaml: Add ARMv6 support

  Redports confirms that changes do not break i386 and amd64 builds (8x).

  PR:		189063
  Submitted by:	maintainer (Michael Gruenewald)
  Patch by:	Andy Ray

Changes:
  head/lang/ocaml/Makefile
  head/lang/ocaml/files/patch-asmcomp__arm__arch.ml
  head/lang/ocaml/files/patch-asmrun__arm.S
  head/lang/ocaml/files/patch-configure
Comment 14 John Marino freebsd_committer 2014-07-08 13:13:53 UTC
okay, thanks.
You should think about the LD_CONFIG now as all ports will be either staged or deleted in less than 2 months.