qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
Date: Fri, 13 Oct 2017 12:38:59 +0100	[thread overview]
Message-ID: <20171013113859.GG20515@redhat.com> (raw)
In-Reply-To: <a591ebd3-ae7f-cde6-1cd2-d4859c17494f@redhat.com>

On Fri, Oct 13, 2017 at 12:55:40PM +0200, Thomas Huth wrote:
> On 13.10.2017 12:52, Thomas Huth wrote:
> > On 13.10.2017 12:28, Daniel P. Berrange wrote:
> >> The system compiler in OpenBSD is gcc 4.2.1 which is too
> >> old for our needs. If doing 'pkg_add gcc' you can get a
> >> much newer version (4.9.4 in OpenBSD 6.1) which works with
> >> QEMU. This installs binaries with two naming schemes:
> >>
> >>   $ pkg_info  -L gcc | grep bin
> >>   /usr/local/bin/ecpp
> >>   /usr/local/bin/egcc
> >>   /usr/local/bin/egcc-ar
> >>   /usr/local/bin/egcc-nm
> >>   /usr/local/bin/egcc-ranlib
> >>   /usr/local/bin/egcov
> >>   /usr/local/bin/x86_64-unknown-openbsd6.0-egcc
> >>   /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-ar
> >>   /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-nm
> >>   /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-ranlib
> >>   /usr/local/bin/x86_64-unknown-openbsd6.0-gcc-4.9.3
> >>
> >> We pick the short name this it won't change across OpenBSD
> >> releases.
> >>
> >> This means users don't need to manually pass custom --cc
> >> and --cxx args to configure to avoid immediate failure.
> >>
> >> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> >> ---
> >>  configure | 18 ++++++++++++++++--
> >>  1 file changed, 16 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/configure b/configure
> >> index 06f18ea9af..fcb7523933 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -255,7 +255,21 @@ cross_prefix=""
> >>  audio_drv_list=""
> >>  block_drv_rw_whitelist=""
> >>  block_drv_ro_whitelist=""
> >> -host_cc="cc"
> >> +
> >> +case `uname -s` in
> >> +    OpenBSD)
> >> +    # Default system cc in OpenBSD is unsufficient
> > 
> > s/unsufficient/insufficient/
> > 
> >> +    # we need the 'gcc' pkg added, whch provides
> > 
> > s/whch/which/
> > 
> >> +    # these modified binary names
> >> +    host_cc="egcc"
> >> +    host_cxx="eg++"
> >> +    ;;
> >> +         *)
> >> +    host_cc="cc"
> >> +    host_cxx="c++"
> >> +    ;;
> >> +esac
> > 
> > Do we really need such work-arounds in our configure script? GCC 4.2 is
> > really veeeery old nowadays, so if the OpenBSD folks refuse to update
> > the default in their distro, IMHO they should be punished by having to
> > select the C compiler manually everywhere.
> 
> By the way, looks like OpenBSD is also switching to clang by default soon:
> 
> https://www.phoronix.com/scan.php?page=news_item&px=OpenBSD-Default-Clang

In a few years time we could potentially revert this patch, but in the
meantime it is clearly beneficial for anyone using OpenBSD and has no
significant maint burden for us to carry it while there are widely
supported OpenBSD releases which need it.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2017-10-13 11:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 10:28 [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default Daniel P. Berrange
2017-10-13 10:52 ` Thomas Huth
2017-10-13 10:55   ` Thomas Huth
2017-10-13 11:38     ` Daniel P. Berrange [this message]
2017-10-13 11:46       ` Thomas Huth
2017-10-13 16:14         ` Peter Maydell
2017-10-16 14:47           ` Brad Smith
2017-10-16  7:44     ` Gerd Hoffmann
2017-10-16 10:14       ` Daniel P. Berrange
2017-10-13 11:37   ` Daniel P. Berrange
2017-11-06 14:25   ` Kamil Rytarowski

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=20171013113859.GG20515@redhat.com \
    --to=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).