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

Re: [Xen-devel] [PATCH] mini-os: link to libgcc.a to fix build with gcc7



On Fri, Jun 30, 2017 at 03:56:24PM +0100, Roger Pau Monné wrote:
> On Fri, Jun 30, 2017 at 03:50:23PM +0100, Wei Liu wrote:
> > 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@xxxxxxxxx>
> > > > > ---
> > > > >  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.
> 
> It is Linux only, but you can also use clang on Linux? FWIW, I've
> heard someone managed to compile this on NetBSD.

On second thought I don't think we want to make this worse. So the
change in this patch should be conditional on gcc.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.