If gcc is not found, then the current configure does fall back to `cc`, which I suppose would work fine on a Clang-only OpenBSD system. (Currently the configure fails if gcc is not found and we are in a cross-compiling scenario (host <> target), and this could be improved, but the support for cross-compilation is due to be overhauled anyway.) As far as I know, the autoconf work has not started yet, but it is still planned for a reasonably close future. I guess it would also be possible for the ./configure to use clang by default under OpenBSD -- but I'm not sure where to cleanly integrate this in the configure script. Currently the major clang-using system that OCaml users maintain in OSX, and there gcc is just an alias for clang (or maybe they still use the GCC frontend and LLVM backend?), so we never had to adapt configure to explicitly invoke clang to support it -- or really implement much in the form of system-dependent compiler choice. On Wed, Oct 25, 2017 at 8:52 AM, Adrien Nader wrote: > Hi, > > On Wed, Oct 25, 2017, Christopher Zimmermann wrote: > > >> My Problem is that custom OCaml builds, especially the ones done > > >through opam will use gcc and therefore fail to build projects with not > > >so modest requirements. At the moment I'm just wondering at which level > > >in the toolchain this neuds fixing. OCaml configure, opam-repository or > > >opam source? > > > > > >Could you elaborate on that « therefore fail to build projects with not > > >so modest requirements » ? > > > > In my case it is core_kernel v0.9 which fails on OpenBSD gcc 4.2.1 > because it uses -mpopcnt, while it compiles just fine with OpenBSD cc clang > 4.0.0. > > I believe there are several things to change. I outline my thoughts > below; I've sorted them by due date: > > 1- (overdue): Openbsd should stop shipping GCC 4.2: it's ten years old > and unmaintained. *TEN* years. It shouldn't be a surprise it starts > causing issues. The very reason 'gcc' has been used by ocaml instead of > 'cc' was to avoid bad compilers on old systems and now openbsd is > re-creating similar issues, only with a different twist. > > 2- (easy, compatible): OCaml's configure script should probably fallback > to clang if GCC isn't found. That way, with openbsd not shipping GCC 4.2 > anymore, clang would be automatically selected. I assumue ports ship a > modern GCC and installing this one would still result in a working > setup. Unsurprisingly, this is the step where you're invited to > contribute: it should really be a small change. My only concern is that > I seem to recall past discussions related to detecting clang but not > their outcome. > > 3- (longer term): I know that there has been some work on a replacement > of the configure script with something autoconf-based (and before anyone > complains, this doesn't include automake nor libtool). I don't know the > current status of this work however. > > -- > Adrien > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >