xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mini-os: link to libgcc.a to fix build with gcc7
@ 2017-06-26 13:28 Olaf Hering
  2017-06-30 14:41 ` Wei Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2017-06-26 13:28 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering

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
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
 	gzip -f -9 -c $@ >$@.gz

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

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

end of thread, other threads:[~2017-06-30 17:01 UTC | newest]

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

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