All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
@ 2017-10-13 10:28 Daniel P. Berrange
  2017-10-13 10:52 ` Thomas Huth
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel P. Berrange @ 2017-10-13 10:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, Daniel P. Berrange

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
+    # we need the 'gcc' pkg added, whch provides
+    # these modified binary names
+    host_cc="egcc"
+    host_cxx="eg++"
+    ;;
+         *)
+    host_cc="cc"
+    host_cxx="c++"
+    ;;
+esac
+
 libs_softmmu=""
 libs_tools=""
 audio_pt_int=""
@@ -466,7 +480,7 @@ else
 fi
 
 if test -z "${CXX}${cross_prefix}"; then
-  cxx="c++"
+  cxx="$host_cxx"
 else
   cxx="${CXX-${cross_prefix}g++}"
 fi
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  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
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Thomas Huth @ 2017-10-13 10:52 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell, Paolo Bonzini

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.

 Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 10:52 ` Thomas Huth
@ 2017-10-13 10:55   ` Thomas Huth
  2017-10-13 11:38     ` Daniel P. Berrange
  2017-10-16  7:44     ` Gerd Hoffmann
  2017-10-13 11:37   ` Daniel P. Berrange
  2017-11-06 14:25   ` Kamil Rytarowski
  2 siblings, 2 replies; 11+ messages in thread
From: Thomas Huth @ 2017-10-13 10:55 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell, Paolo Bonzini

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

 Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 10:52 ` Thomas Huth
  2017-10-13 10:55   ` Thomas Huth
@ 2017-10-13 11:37   ` Daniel P. Berrange
  2017-11-06 14:25   ` Kamil Rytarowski
  2 siblings, 0 replies; 11+ messages in thread
From: Daniel P. Berrange @ 2017-10-13 11:37 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Peter Maydell, Paolo Bonzini

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 <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.

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 :|

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 10:55   ` Thomas Huth
@ 2017-10-13 11:38     ` Daniel P. Berrange
  2017-10-13 11:46       ` Thomas Huth
  2017-10-16  7:44     ` Gerd Hoffmann
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel P. Berrange @ 2017-10-13 11:38 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Peter Maydell, Paolo Bonzini

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 :|

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 11:38     ` Daniel P. Berrange
@ 2017-10-13 11:46       ` Thomas Huth
  2017-10-13 16:14         ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2017-10-13 11:46 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Peter Maydell, Paolo Bonzini

On 13.10.2017 13:38, Daniel P. Berrange wrote:
> On Fri, Oct 13, 2017 at 12:55:40PM +0200, Thomas Huth wrote:
>> On 13.10.2017 12:52, Thomas Huth wrote:
[...]
>> 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.

I disagree. If the next OpenBSD release uses Clang by default, we're not
building QEMU there with the *working default* C compiler anymore.
You're then rather forcing the OpenBSD users then to install an
additional (likely unliked, since GPLv3) GCC package on their systems.

So IMHO, just drop this patch and wait for the next OpenBSD release, and
the problem will be solved automatically. (and the few users who still
use an older release of OpenBSD will likely use the QEMU from their
ports system anyway)

 Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 11:46       ` Thomas Huth
@ 2017-10-13 16:14         ` Peter Maydell
  2017-10-16 14:47           ` Brad Smith
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2017-10-13 16:14 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Daniel P. Berrange, QEMU Developers, Paolo Bonzini

On 13 October 2017 at 12:46, Thomas Huth <thuth@redhat.com> wrote:
> I disagree. If the next OpenBSD release uses Clang by default, we're not
> building QEMU there with the *working default* C compiler anymore.
> You're then rather forcing the OpenBSD users then to install an
> additional (likely unliked, since GPLv3) GCC package on their systems.
>
> So IMHO, just drop this patch and wait for the next OpenBSD release, and
> the problem will be solved automatically. (and the few users who still
> use an older release of OpenBSD will likely use the QEMU from their
> ports system anyway)

Another possible approach would be to have a configure test
for whatever feature it is that we need in our compiler,
and then run through a list that starts with "cc" and
goes on to try "egcc" etc until it finds one that works.
That way we'll automatically DTRT when OpenBSD upgrades
their "cc" to a working one.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 10:55   ` Thomas Huth
  2017-10-13 11:38     ` Daniel P. Berrange
@ 2017-10-16  7:44     ` Gerd Hoffmann
  2017-10-16 10:14       ` Daniel P. Berrange
  1 sibling, 1 reply; 11+ messages in thread
From: Gerd Hoffmann @ 2017-10-16  7:44 UTC (permalink / raw)
  To: Thomas Huth, Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell, Paolo Bonzini

  Hi,

> 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

It did happen already.  On openbsd 6.2 (released a week ago) cc is
clang:

$ cc --version
OpenBSD clang version 4.0.0 (tags/RELEASE_400/final) (based on LLVM
4.0.0)

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-16  7:44     ` Gerd Hoffmann
@ 2017-10-16 10:14       ` Daniel P. Berrange
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel P. Berrange @ 2017-10-16 10:14 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Thomas Huth, qemu-devel, Peter Maydell, Paolo Bonzini

On Mon, Oct 16, 2017 at 09:44:42AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > 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
> 
> It did happen already.  On openbsd 6.2 (released a week ago) cc is
> clang:
> 
> $ cc --version
> OpenBSD clang version 4.0.0 (tags/RELEASE_400/final) (based on LLVM
> 4.0.0)

Oh, I didn't notice that was out already. Lets drop my patch and I'll
update the BSD page on the wiki

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 :|

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 16:14         ` Peter Maydell
@ 2017-10-16 14:47           ` Brad Smith
  0 siblings, 0 replies; 11+ messages in thread
From: Brad Smith @ 2017-10-16 14:47 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth; +Cc: Paolo Bonzini, QEMU Developers

On 10/13/2017 12:14 PM, Peter Maydell wrote:

> On 13 October 2017 at 12:46, Thomas Huth<thuth@redhat.com>  wrote:
>> I disagree. If the next OpenBSD release uses Clang by default, we're not
>> building QEMU there with the *working default* C compiler anymore.
>> You're then rather forcing the OpenBSD users then to install an
>> additional (likely unliked, since GPLv3) GCC package on their systems.
>>
>> So IMHO, just drop this patch and wait for the next OpenBSD release, and
>> the problem will be solved automatically. (and the few users who still
>> use an older release of OpenBSD will likely use the QEMU from their
>> ports system anyway)
> Another possible approach would be to have a configure test
> for whatever feature it is that we need in our compiler,
> and then run through a list that starts with "cc" and
> goes on to try "egcc" etc until it finds one that works.
> That way we'll automatically DTRT when OpenBSD upgrades
> their "cc" to a working one.

The release is already out.

One issue that needs to be fixed in the configure script. Have the TLS test
link with libpthread if the initial test fails.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default
  2017-10-13 10:52 ` Thomas Huth
  2017-10-13 10:55   ` Thomas Huth
  2017-10-13 11:37   ` Daniel P. Berrange
@ 2017-11-06 14:25   ` Kamil Rytarowski
  2 siblings, 0 replies; 11+ messages in thread
From: Kamil Rytarowski @ 2017-11-06 14:25 UTC (permalink / raw)
  To: Thomas Huth, Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell, Paolo Bonzini

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

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.
> 
>  Thomas
> 

OpenBSD switched to Clang/LLVM and they insist to support older
releases. We can silently ignore their GCC 4.2.1 (the latest one GPLv2
release).


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-11-06 14:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.