xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Minios-devel <minios-devel@lists.xenproject.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Olaf Hering <olaf@aepfle.de>, Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] mini-os: link to libgcc.a to fix build with gcc7
Date: Fri, 30 Jun 2017 15:50:23 +0100	[thread overview]
Message-ID: <20170630145023.4zsdm63i6delu7zq@citrix.com> (raw)
In-Reply-To: <20170630144841.sxzpctkyhx453gb5@MacBook-Pro-de-Roger.local>

On Fri, Jun 30, 2017 at 03:48:41PM +0100, Roger Pau Monné wrote:
> On Fri, Jun 30, 2017 at 03:41:04PM +0100, Wei Liu wrote:
> > CC minios-devel
> > 
> > On Mon, Jun 26, 2017 at 03:28:35PM +0200, Olaf Hering wrote:
> > > gcc7 generates a call to __udivmoddi4 ...
> > > 
> > > stubdom/mini-os-x86_32-grub/mini-os.o: In function `_strtoll_r':
> > > stubdom/newlib-x86_32/i686-xen-elf/newlib/libc/stdlib/../../../../../newlib-1.16.0/newlib/libc/stdlib/strtoll_r.c:110: undefined reference to `__udivmoddi4'
> > > make[2]: *** [Makefile:167: stubdom/mini-os-x86_32-grub/mini-os] Error 1
> > > 
> > > ... which the linker only finds if libgcc.a is provided on the commandline.
> > > 
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > > ---
> > >  Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/Makefile b/Makefile
> > > index ef8559b..b9c1336 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -162,7 +162,7 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
> > >  	$(CPP) $(ASFLAGS) -P $< -o $@
> > >  
> > >  $(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
> > > -	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
> > > +	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) $$(gcc -print-libgcc-file-name $(CFLAGS)) -o $@.o
> > 
> > Append it to LDLIBS?
> 
> This will break compilation with non-gcc.
> 

I thought about that but mini-os is Linux only? I've tried to build it
on FreeBSD.

If I was wrong, then we should tell gcc to not generate code that relies
on libgcc. That seems impossible by reading the doc...

> Roger.

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

  reply	other threads:[~2017-06-30 14:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 13:28 [PATCH] mini-os: link to libgcc.a to fix build with gcc7 Olaf Hering
2017-06-30 14:41 ` Wei Liu
2017-06-30 14:48   ` Roger Pau Monné
2017-06-30 14:50     ` Wei Liu [this message]
2017-06-30 14:56       ` Roger Pau Monné
2017-06-30 15:13         ` Wei Liu
2017-06-30 16:58           ` Olaf Hering
2017-06-30 17:01             ` Olaf Hering

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=20170630145023.4zsdm63i6delu7zq@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=olaf@aepfle.de \
    --cc=roger.pau@citrix.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xen.org \
    /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).