caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Adrien Nader <adrien@notk.org>
Cc: "Christopher Zimmermann" <christopher@gmerlin.de>,
	"caml users" <caml-list@inria.fr>,
	"Sébastien Hinderer" <Sebastien.Hinderer@inria.fr>
Subject: Re: [Caml-list] use cc instead of gcc as default C compiler?
Date: Wed, 25 Oct 2017 09:05:47 +0200	[thread overview]
Message-ID: <CAPFanBHxETgs51Lac2LSbgoPrpzAm7SH4+XUkpnuN7WA_QG6ng@mail.gmail.com> (raw)
In-Reply-To: <20171025065201.GA24593@notk.org>

[-- Attachment #1: Type: text/plain, Size: 3252 bytes --]

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 <adrien@notk.org> 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
>

[-- Attachment #2: Type: text/html, Size: 4180 bytes --]

  reply	other threads:[~2017-10-25  7:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 15:05 Christopher Zimmermann
2017-10-22  9:20 ` SP
2017-10-23  7:46   ` Sébastien Hinderer
2017-10-23  7:57 ` Gabriel Scherer
2017-10-23 19:34   ` SP
2017-10-23 19:41   ` Christopher Zimmermann
2017-10-23 19:49     ` Adrien Nader
2017-10-24  5:15       ` [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)? Francois BERENGER
2017-10-24  7:55         ` Milo Davis
2017-10-25  2:31           ` Francois BERENGER
2017-10-25  7:06             ` [Caml-list] libsvm OCaml bindings and segfaults Francois BERENGER
2017-10-25  9:08               ` Philippe Veber
     [not found]       ` <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de>
2017-10-25  6:52         ` [Caml-list] use cc instead of gcc as default C compiler? Adrien Nader
2017-10-25  7:05           ` Gabriel Scherer [this message]
2017-10-25  7:14             ` Sébastien Hinderer
2017-10-25  7:20               ` Adrien Nader
2017-10-25  7:10           ` Sébastien Hinderer
2017-10-25  8:04           ` Christopher Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPFanBHxETgs51Lac2LSbgoPrpzAm7SH4+XUkpnuN7WA_QG6ng@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=Sebastien.Hinderer@inria.fr \
    --cc=adrien@notk.org \
    --cc=caml-list@inria.fr \
    --cc=christopher@gmerlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).