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
Wooops, this should have category=ports, my bad!
Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
* 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
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.
I'll take it.
what is the new ETA for the patch?
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!)
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...
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...
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.
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!
A commit references this bug:
Date: Tue Jul 8 13:11:05 UTC 2014
New revision: 361233
lang/ocaml: Add ARMv6 support
Redports confirms that changes do not break i386 and amd64 builds (8x).
Submitted by: maintainer (Michael Gruenewald)
Patch by: Andy Ray
You should think about the LD_CONFIG now as all ports will be either staged or deleted in less than 2 months.