xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Juergen Gross <JGross@suse.com>,
	xuquan8@huawei.com, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	samuel.thibault@ens-lyon.org, dgdegra@tycho.nsa.gov
Subject: Re: Stubdom GMP build failure for gcc 6
Date: Fri, 28 Oct 2016 13:59:27 +0100	[thread overview]
Message-ID: <20161028125927.GG30231@citrix.com> (raw)
In-Reply-To: <58136727020000780011A860@prv-mh.provo.novell.com>

On Fri, Oct 28, 2016 at 06:56:39AM -0600, Jan Beulich wrote:
> >>> On 28.10.16 at 14:50, <wei.liu2@citrix.com> wrote:
> > On Fri, Oct 28, 2016 at 06:29:49AM -0600, Jan Beulich wrote:
> >> >>> On 28.10.16 at 14:10, <wei.liu2@citrix.com> wrote:
> >> > There have been a few reports on stubdom build failure with gcc 6
> >> > toolchain. I spent some time yesterday to figure what went wrong. Here
> >> > is what I found.
> >> > 
> >> > When building GMP library, its configure script generates small C
> >> > programs to determine various aspects of the system. Unfortunately the
> >> > build rune for it is incorrect, so the test program ends up consuming
> >> > newlib headers while linking against the host glibc. It's amazing that
> >> > this even worked in the past few years! :-)
> >> > 
> >> > Unfortunately my attempt to fix it by providing LDFLAGS="-nostdlib
> >> > -LXXX" doesn't work. It turns out that there is no crt generated in
> >> > newlib. I'm not sure if that's because the newlib port is incomplete or
> >> > I haven't discovered a way to teach it to generate one.
> >> 
> >> Considering that they can't reasonably try to run any of these
> >> test programs (after all this is a cross build), wouldn't it suffice to
> >> make up crt*.o just for the configure process, and just providing
> >> the necessary symbols to make linking succeed? Agreed this, if
> >> anything, makes the present situation even uglier, but it might
> >> work.
> > 
> > It might. But that's not sustainable IMO.
> 
> I agree, and tried to indicate so with the last sentence. It was just
> a thought for a possible non-intrusive workaround for 4.8.
> 
> > One thing is that gmp configure doesn't try to run those test programs,
> > because the configure rune doesn't indicate a cross-build, although it
> > is actually one.
> 
> Considering what you write further down, DYM "does try to run"
> (in which case indeed we're hosed)?
> 

Yes, I meant "does try to run".

> >> But what I'm not understanding - what did change with gcc 6
> >> here? There's surely no libc version dependency in the compiler,
> >> so whatever worked in older gcc for linking purposes should work
> >> here too.
> >> 
> > 
> > It's not it doesn't link anymore.
> > 
> > A sample test program:
> > 
> >    typedef unsigned short ac__type_sizeof_;
> > static long int longval () { return (long int) (sizeof
> > (ac__type_sizeof_)); }
> > static unsigned long int ulongval () { return (long int) (sizeof
> > (ac__type_sizeof_)); }
> > #include <stdio.h>
> > #include <stdlib.h>
> > int
> > main ()
> > {
> > 
> >   FILE *f = fopen ("conftest.val", "w");
> >   if (! f)
> >     return 1;
> >   if (((long int) (sizeof (ac__type_sizeof_))) < 0)
> >     {
> >       long int i = longval ();
> >       if (i != ((long int) (sizeof (ac__type_sizeof_))))
> > 	return 1;
> >       fprintf (f, "%ld\n", i);
> >     }
> >   else
> >     {
> >       unsigned long int i = ulongval ();
> >       if (i != ((long int) (sizeof (ac__type_sizeof_))))
> > 	return 1;
> >       fprintf (f, "%lu\n", i);
> >     }
> >   return ferror (f) || fclose (f) != 0;
> >   ;
> >   return 0;
> > }
> > 
> > ferror is a macro in newlib, which checks if one certain bit X is set. I
> > suppose the same bit X has a different semantics now in glibc, and then
> > fprintf (a function from glibc) happens to set bit X. This program will
> > then exit with non-zero and configure deems it failed to run.
> 
> But how is any of this gcc version dependent?
> 

Oh, yes, the subject line is misleading. Sorry.

I wrote that because it was discovered in the context of trying to
compile stubdom gmp with gcc 6.

Wei.

> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-10-28 12:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 12:10 Stubdom GMP build failure for gcc 6 Wei Liu
2016-10-28 12:29 ` Jan Beulich
2016-10-28 12:50   ` Wei Liu
2016-10-28 12:56     ` Jan Beulich
2016-10-28 12:59       ` Wei Liu [this message]
2016-10-29 17:19     ` Wei Liu
2016-10-28 13:30 ` Ian Jackson
2016-10-28 13:36   ` Wei Liu
2016-10-28 15:42     ` Ian Jackson
2016-10-28 14:44 ` Juergen Gross
2016-10-28 15:38   ` Wei Liu
  -- strict thread matches above, loose matches on Subject: below --
2016-10-29  5:16 Pry Mar
2016-10-29 17:28 ` Wei Liu

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=20161028125927.GG30231@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xuquan8@huawei.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).