From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 878AC7EE89 for ; Wed, 25 Oct 2017 09:06:30 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-qt0-f177.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.216.177 as permitted sender) identity=mailfrom; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qt0-f177.google.com) identity=helo; client-ip=209.85.216.177; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-qt0-f177.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A6wafLxTZKyPxRwF6VcEkAtFHB9psv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa64ZRyN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnY6Uy/yPgtt?= =?us-ascii?q?J+nzBpWaz4Huj7jzqKvofh5QiTGhTbR3JRSw5UWN54hFybdlf4890BrEpDNucu?= =?us-ascii?q?hb3ys8LF6Jnhv6zsG34J0l9D5f7aEP7clFBIrzdb45QLgQNz8mPno4/oW/uhDJ?= =?us-ascii?q?VwqC4j0HWWUbiBdSKwfA5RD+GJz2t32p5aJGxCCGMJiuHvgPUjO44vIuFUbl?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BLAADcNvBZhrHYVdFbGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFAEBAQEBAQEBAQEBBwEBAQEBhBhuJweDc4E2mDKBenuBVoZqjxAKI4U?= =?us-ascii?q?YAoReB0MUAQEBAQEBAQEBAQESAQEBCAsLCCgvgjgFAR4GgjsBAQEBAgEjHQEbE?= =?us-ascii?q?gsBAwELBgULDQ0dAgIiAREBBQEKEgYTEol1AQMNCBCcR0CMDIIFBQEcgwkFg2k?= =?us-ascii?q?KGScDCliCbAEBAQEBBQEBAQEBAQEZAgYSgxyCB4FQgWmCdTWFMoJngmEFiDcMm?= =?us-ascii?q?SqCL4U2jRCCcpAzlWsUBR+BFQ8nY4EZNCElXjWCLwmCGiofgXU+NopPgVUBAQE?= X-IPAS-Result: =?us-ascii?q?A0BLAADcNvBZhrHYVdFbGgEBAQECAQEBAQgBAQEBFAEBAQE?= =?us-ascii?q?BAQEBAQEBBwEBAQEBhBhuJweDc4E2mDKBenuBVoZqjxAKI4UYAoReB0MUAQEBA?= =?us-ascii?q?QEBAQEBAQESAQEBCAsLCCgvgjgFAR4GgjsBAQEBAgEjHQEbEgsBAwELBgULDQ0?= =?us-ascii?q?dAgIiAREBBQEKEgYTEol1AQMNCBCcR0CMDIIFBQEcgwkFg2kKGScDCliCbAEBA?= =?us-ascii?q?QEBBQEBAQEBAQEZAgYSgxyCB4FQgWmCdTWFMoJngmEFiDcMmSqCL4U2jRCCcpA?= =?us-ascii?q?zlWsUBR+BFQ8nY4EZNCElXjWCLwmCGiofgXU+NopPgVUBAQE?= X-IronPort-AV: E=Sophos;i="5.43,430,1503352800"; d="scan'208,217";a="242266941" Received: from mail-qt0-f177.google.com ([209.85.216.177]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 25 Oct 2017 09:06:29 +0200 Received: by mail-qt0-f177.google.com with SMTP id h4so33525505qtk.8; Wed, 25 Oct 2017 00:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rwmZhgXIfQonjQdyVdjUCDMK/CnM/cDGFZt5eUJC6q4=; b=MeqfeKzY98mS9IhVXVeoe1koAr/TKcM+7XjW0BIqy/vfM24KOdjXomDmV9VnpNAARO pTuLa09BNK31LgLGLNbIR+VOiKvzTcaw8FbEiZscmgFjiu9gylAmKYWuXYgC1vF/4gDX A0pT+hyjlvHHKQm2dxPOM+W2XUckKa83PoVww+NnvvEcZowcLtklcT/JGxV6jAOrgi8D Zdjbp74vsNoscqzcTuOeuSQMXk/EUL3OtRzq+rGgGap2+yzEb3zusAqG8o/OGBybGxYT wTK3DHf5rhqWcLJMSbk8HGVan+s3+48lIpRue5q/QBDO+iT/vRkhqtVST/1WDIswaywu UcOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rwmZhgXIfQonjQdyVdjUCDMK/CnM/cDGFZt5eUJC6q4=; b=OVvi4On8c3xKtZi73qNWZs623YL9IUwYl4dgjV0WVFAVMbE7q6kly40gktSJLbKxni 070iYJ2HC1oh4Jrt772SLkPQdTINHjy0BQYoaxXJRuOtUyXXy1dqMluFePUopFfG72Cu aMMeAxjCoCPWy8rugG0nQziG4aDY8JtqnWcIto5EtSMROEq/vGgQNWBfqlKby/TcRnsJ LW82tsoBkkF3AmZy09DAb375tNeCzIG9PnH4gNLCJtYvYJbFJeOxyZOmmLB8cPeqOVuv EKc3P24A+qmbFu21X6+nKtmvEiVip3IbiUSovPAwCM3IvmnQvXgPZoiwF4msvm3jG/mW R1RA== X-Gm-Message-State: AMCzsaUvWQUl9+FZtxSZrI7hP1Ss/VcUMVx1A7lhJLaZw7/BXtohHSCJ wiRgPSubAaZB/a2R3O9Yjt578/XhI4Sron/zqJ4= X-Google-Smtp-Source: ABhQp+T799tZFOKlLHLun1Me1rk3FPlMvfTV69V7bN8Bfxd9LH912svelWlAIpFnCC5iuP4sD6jrWxqKPvrR43INDbo= X-Received: by 10.200.0.135 with SMTP id c7mr29832158qtg.66.1508915188045; Wed, 25 Oct 2017 00:06:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.178.65 with HTTP; Wed, 25 Oct 2017 00:05:47 -0700 (PDT) In-Reply-To: <20171025065201.GA24593@notk.org> References: <20171019170538.73d6473c@mortimer.gmerlin.de> <441EA0D0-D075-4407-B50D-8CAEDD6039DF@gmerlin.de> <20171023194954.GA13292@notk.org> <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de> <20171025065201.GA24593@notk.org> From: Gabriel Scherer Date: Wed, 25 Oct 2017 09:05:47 +0200 Message-ID: To: Adrien Nader Cc: Christopher Zimmermann , caml users , =?UTF-8?Q?S=C3=A9bastien_Hinderer?= Content-Type: multipart/alternative; boundary="f403045edae0c79b36055c59b14b" Subject: Re: [Caml-list] use cc instead of gcc as default C compiler? --f403045edae0c79b36055c59b14b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =C2=AB therefore fail to build projects wi= th not > > >so modest requirements =C2=BB ? > > > > 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 cla= ng > 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 > --f403045edae0c79b36055c59b14b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If gcc is not found, then the current configure = does fall back to `cc`, which I suppose would work fine on a Clang-only Ope= nBSD system. (Currently the configure fails if gcc is not found and we are = in a cross-compiling scenario (host <> target), and this could be imp= roved, but the support for cross-compilation is due to be overhauled anyway= .)

As far as I know, the autoconf work has not started yet, bu= t it is still planned for a reasonably close future.

I guess i= t 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 conf= igure script. Currently the major clang-using system that OCaml users maint= ain in OSX, and there gcc is just an alias for clang (or maybe they still u= se 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 d= one
> >through opam will use gcc and therefore fail to build projects wit= h not
> >so modest requirements. At the moment I'm just wondering at wh= ich level
> >in the toolchain this neuds fixing. OCaml configure, opam-reposito= ry or
> >opam source?
> >
> >Could you elaborate on that =C2=AB therefore fail to build project= s with not
> >so modest requirements =C2=BB ?
>
> 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 c= lang 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<= br> and unmaintained. *TEN* years. It shouldn't be a surprise it starts
causing issues. The very reason 'gcc' has been used by ocaml instea= d 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 fallbac= k
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.=C2=A0 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

--f403045edae0c79b36055c59b14b--