Re: [PATCH spice-common] meson: fix building for big-endian host

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

 



> 
> Hi
> 
> On Thu, Jan 17, 2019 at 12:35 PM Frediano Ziglio <fziglio@xxxxxxxxxx> wrote:
> >
> > >
> > > Hi
> > >
> > > On Thu, Jan 17, 2019 at 12:15 PM Frediano Ziglio <fziglio@xxxxxxxxxx>
> > > wrote:
> > > >
> > > > >
> > > > > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > > > >
> > > > > autofoo build-sys defines WORDS_BIGENDIAN, and spice-common code uses
> > > > > it.
> > > > >
> > > > > Later, I think it would make sense to switch to G_BIG_ENDIAN instead.
> > > > >
> > > >
> > > > This comment should not be in the commit message.
> > > >
> > > > IMHO WORDS_BIGENDIAN is fine, is pretty standard and Meson is currently
> > > > providing definitions in the Autoconf style as it's quite standard.
> > >
> > > WORDS_BIGENDIAN is standard?
> > >
> >
> > I didn't say that, please read my sentence again.
> >
> > > meson doesn't provide it.
> > >
> >
> > I know... so?
> > Programs have been using it for decades.
> > Same apply to HAVE_xxx or ENABLE_yyy.
> 
> What I mean is that it is simpler to use G_BYTE_ORDER == G_BIG_ENDIAN,
> since it's part of glib headers. You don't need a configure-time
> check.
> 

But not all files depends on GLib, adding WORDS_BIGENDIAN is just
another way to fix and would prevent possible future bug if we add
some files using that definition.

> This bug wouldn't exist.
> 

It won't exists if we also continue to use autoconf but this is
not a good reason either.

> >
> > > >
> > > > > Fixes:
> > > > > https://gitlab.freedesktop.org/spice/spice-common/issues/2
> > > > >
> > > > > Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > > > > ---
> > > > >  meson.build | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/meson.build b/meson.build
> > > > > index 049409b..8579680 100644
> > > > > --- a/meson.build
> > > > > +++ b/meson.build
> > > > > @@ -33,6 +33,9 @@ spice_common_config_data = configuration_data()
> > > > >  if get_option('extra-checks')
> > > > >    spice_common_config_data.set('ENABLE_EXTRA_CHECKS', '1')
> > > > >  endif
> > > > > +if host_machine.endian() == 'big'
> > > > > +  spice_common_config_data.set('WORDS_BIGENDIAN', '1')
> > > > > +endif
> > > > >
> > > > >  spice_common_generate_code = get_option('generate-code')
> > > > >  spice_common_generate_client_code = spice_common_generate_code ==
> > > > >  'all'
> > > > >  or
> > > > >  spice_common_generate_code == 'client'
> > > >
> >
> > Frediano
> 
> 
> 
> --
> Marc-André Lureau
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]