qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
Date: Fri, 13 Oct 2017 12:37:17 +0100
User-agent: Mutt/1.9.0 (2017-09-02)

On Fri, Oct 13, 2017 at 12:52:26PM +0200, 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 <address@hidden>
> > ---
> >  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.

I really object to such a user hostile POV. It is not beneficial to QEMU
to punish our users for choices they make, and our punishment will do
nothing to encourage OpenBSD distro maintainers to switch their compiler.

This is a straightforward change to 'configure' that makes it 'just work'
with no special args on current OpenBSD releases. Making it 'just work' is
a goal we have for every aspect of the configure script, and there's no
reason why we shouldn't try this for OpenBSD, as we do for other platforms,
unless we're going to drop OpenBSD entirely.

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 via email to

[Prev in Thread] Current Thread [Next in Thread]